java.lang.Object
org.apache.jena.sparql.resultset.ResultSetCompare
Comparison of ResultSets.
Note that reading ResultSets is destructive so consider using
ResultSetRewindable
from ResultSetFactory.makeRewindable(org.apache.jena.rdf.model.Model)-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanequal(Binding bind1, Binding bind2, EqualityTest test) Compare two bindings, use the node equality test providedstatic booleanequalsByTerm(ResultSet rs1, ResultSet rs2) compare two result sets for equivalence.static booleanequalsByTerm(RowSet rs1, RowSet rs2) static booleanequalsByTermAndOrder(ResultSet rs1, ResultSet rs2) compare two result sets for equivalence.static booleanequalsByTermAndOrder(RowSet rs1, RowSet rs2) static booleanequalsByTest(Collection<Binding> b1, Collection<Binding> b2, EqualityTest match) static booleanequalsByValue(ResultSet rs1, ResultSet rs2) Compare two result sets for equivalence.static booleanequalsByValue(RowSet rs1, RowSet rs2) static booleanequalsByValueAndOrder(ResultSet rs1, ResultSet rs2) Compare two result sets for equivalence.static booleanequalsByValueAndOrder(RowSet rs1, RowSet rs2) static booleanequalsExact(ResultSet rs1, ResultSet rs2) compare two result sets for exact equality equivalence.static booleanequalsExact(RowSet rs1, RowSet rs2) static booleanisomorphic(ResultSet rs1, ResultSet rs2) Compare two result sets for bNode isomorphism equivalence.static booleanisomorphic(RowSet rs1, RowSet rs2)
-
Constructor Details
-
ResultSetCompare
public ResultSetCompare()
-
-
Method Details
-
equalsByValue
Compare two result sets for equivalence. Equivalence 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
-
equalsByValue
-
equalsByTest
public static boolean equalsByTest(Collection<Binding> b1, Collection<Binding> b2, EqualityTest match) -
equalsByTerm
compare two result sets for equivalence. Equivalence 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
-
equalsByTerm
-
equalsByValueAndOrder
Compare two result sets for equivalence. Equivalence means: Each row in rs1 matches 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
-
equalsByValueAndOrder
-
equalsByTermAndOrder
compare two result sets for equivalence. Equivalence means: Each row in rs1 matches 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
-
equalsByTermAndOrder
-
equalsExact
compare two result sets for exact equality equivalence. Exact equalitymeans: Each row in rs1 matches the same index row in rs2. Rows match if they have the same variables with the same values, bNodes must have same labels Destructive - rs1 and rs2 are both read, possibly to exhaustion.- Parameters:
rs1-rs2-- Returns:
- true if they are equivalent
-
equalsExact
-
isomorphic
Compare two result sets for bNode isomorphism equivalence. Only does RDF term comparison. -
isomorphic
-
equal
Compare two bindings, use the node equality test provided
-