/** 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. * @param rs1 * @param rs2 * @return true if they are equivalent */ public static boolean equalsExact(ResultSet rs1, ResultSet rs2) { if ( ! compareHeader(rs1, rs2) ) return false ; return equivalentByOrder(convert(rs1) , convert(rs2), new EqualityTest(){}) ; }
/** compare two result sets for equivalence. Equivalence 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. * @param rs1 * @param rs2 * @return true if they are equivalent */ public static boolean equalsByTermAndOrder(ResultSet rs1, ResultSet rs2) { if ( ! compareHeader(rs1, rs2) ) return false ; return equivalentByOrder(convert(rs1) , convert(rs2), new BNodeIso(NodeUtils.sameTerm)) ; }
/** 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. * @param rs1 * @param rs2 * @return true if they are equivalent */ public static boolean equalsByValueAndOrder(ResultSet rs1, ResultSet rs2) { if ( ! compareHeader(rs1, rs2) ) return false ; return equivalentByOrder(convert(rs1) , convert(rs2), new BNodeIso(NodeUtils.sameValue)) ; }