com.hp.hpl.jena.sparql.resultset
Class ResultSetCompare

java.lang.Object
  extended by com.hp.hpl.jena.sparql.resultset.ResultSetCompare

public class ResultSetCompare
extends Object


Nested Class Summary
static class ResultSetCompare.BNodeIso
           
 
Constructor Summary
ResultSetCompare()
           
 
Method Summary
static boolean equal(Binding bind1, Binding bind2, NodeUtils.EqualityTest test)
          Compare two bindings, use the node equality test provided
static boolean equalsByTerm(ResultSet rs1, ResultSet rs2)
          compare two result sets for equivalence.
static boolean equalsByTermAndOrder(ResultSet rs1, ResultSet rs2)
          compare two result sets for equivalence.
static boolean equalsByTest(Collection<Binding> b1, Collection<Binding> b2, NodeUtils.EqualityTest match)
           
static boolean equalsByValue(ResultSet rs1, ResultSet rs2)
          Compare two result sets for equivalence.
static boolean equalsByValueAndOrder(ResultSet rs1, ResultSet rs2)
          compare two result sets for equivalence.
static boolean isomorphic(ResultSet rs1, ResultSet rs2)
          Compare two result sets for bNode isomorphism equivalence.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetCompare

public ResultSetCompare()
Method Detail

equalsByValue

public static boolean equalsByValue(ResultSet rs1,
                                    ResultSet rs2)
Compare two result sets for equivalence. Equivalance means: A row rs1 has one matching row in rs2, and vice versa. A row is only matched once. Rows match if they have the same variables with the same values. bNodes must map to a consistent other bNodes. Value comparisons of nodes. Destructive - rs1 and rs2 are both read, possibly to exhaustion.

Parameters:
rs1 -
rs2 -
Returns:
true if they are equivalent

equalsByTest

public static boolean equalsByTest(Collection<Binding> b1,
                                   Collection<Binding> b2,
                                   NodeUtils.EqualityTest match)

equalsByTerm

public static boolean equalsByTerm(ResultSet rs1,
                                   ResultSet rs2)
compare two result sets for equivalence. Equivalance means: A row rs1 has one matching row in rs2, and vice versa. A row is only matched once. Rows match if they have the same variables with the same values, bNodes must map to a consistent other bNodes. Term comparisons of nodes. Destructive - rs1 and rs2 are both read, possibly to exhaustion.

Parameters:
rs1 -
rs2 -
Returns:
true if they are equivalent

equalsByValueAndOrder

public static boolean equalsByValueAndOrder(ResultSet rs1,
                                            ResultSet rs2)
compare two result sets for equivalence. Equivalance means: Each row in rs1 matchs the same index row in rs2. Rows match if they have the same variables with the same values, bNodes must map to a consistent other bNodes. Value comparisons of nodes. Destructive - rs1 and rs2 are both read, possibly to exhaustion.

Parameters:
rs1 -
rs2 -
Returns:
true if they are equivalent

equalsByTermAndOrder

public static boolean equalsByTermAndOrder(ResultSet rs1,
                                           ResultSet rs2)
compare two result sets for equivalence. Equivalance means: Each row in rs1 matchs the same index row in rs2. Rows match if they have the same variables with the same values, bNodes must map to a consistent other bNodes. RDF term comparisons of nodes. Destructive - rs1 and rs2 are both read, possibly to exhaustion.

Parameters:
rs1 -
rs2 -
Returns:
true if they are equivalent

isomorphic

public static boolean isomorphic(ResultSet rs1,
                                 ResultSet rs2)
Compare two result sets for bNode isomorphism equivalence. Only does RDF term comparison.


equal

public static boolean equal(Binding bind1,
                            Binding bind2,
                            NodeUtils.EqualityTest test)
Compare two bindings, use the node equality test provided



Licenced under the Apache License, Version 2.0