}\r
}\r
js++;\r
- \r
}\r
}\r
\r
\r
i2 += same2;\r
}\r
- \r
}\r
}\r
\r
Statement s2 = ss2.get(i2+off2);\r
\r
if (objectsLeft != null) {\r
- \r
- objectsLeft.add(s1.getObject());\r
- objectsRight.add(s2.getObject());\r
- \r
+ objectsLeft.add(s1.getObject());\r
+ objectsRight.add(s2.getObject());\r
} \r
comparableStatements.map(s1, s2);\r
//comparableResources.map(s1.getObject(), s2.getObject());\r
ss1.addAll(g.getStatements(r1, b.HasProperty));\r
ss2.addAll(g.getStatements(r2, b.HasProperty));\r
sortStatement(ss1, ss2);\r
-// Collections.sort(ss1, scomp);\r
-// Collections.sort(ss2, scomp);\r
\r
int i1 = 0; \r
int i2 = 0;\r
Statement s2 = ss2.get(i2);\r
int c = scomp.compare(s1, s2);\r
switch (c) {\r
- case 0:{\r
- boolean b1 = g.hasValue(s1.getObject());\r
- boolean b2 = g.hasValue(s2.getObject());\r
- if (b1 == b2) {\r
- if (b1) {\r
- Object v1 = g.getValue(s1.getObject());\r
- Object v2 = g.getValue(s2.getObject());\r
- boolean eq = compareValue(v1, v2);\r
- if (!eq) {\r
- addModification(s1, s2);\r
- comparableStatements.map(s1, s2);\r
- comparableResources.map(s1.getObject(),s2.getObject());\r
+ case 0:{\r
+ boolean b1 = g.hasValue(s1.getObject());\r
+ boolean b2 = g.hasValue(s2.getObject());\r
+ if (b1 == b2) {\r
+ if (b1) {\r
+ Object v1 = g.getValue(s1.getObject());\r
+ Object v2 = g.getValue(s2.getObject());\r
+ boolean eq = compareValue(v1, v2);\r
+ if (!eq) {\r
+ addModification(s1, s2);\r
+ comparableStatements.map(s1, s2);\r
+ comparableResources.map(s1.getObject(),s2.getObject());\r
+ }\r
+ } else {\r
+ compareProps(s1.getObject(), s2.getObject());\r
}\r
} else {\r
- compareProps(s1.getObject(), s2.getObject());\r
+ addModification(s1, s2);\r
+ comparableStatements.map(s1, s2);\r
+ comparableResources.map(s1.getObject(),s2.getObject());\r
}\r
- } else {\r
- addModification(s1, s2);\r
- comparableStatements.map(s1, s2);\r
- comparableResources.map(s1.getObject(),s2.getObject());\r
+ i1++;\r
+ i2++;\r
+ break;\r
+ }\r
+ case -1:{\r
+ System.out.println("Compare Prop diff1s " + printStatement(g,s1));\r
+ addDeletion(s1);\r
+ i1++;\r
+ break;\r
+ }\r
+ \r
+ case 1:{\r
+ System.out.println("Compare Prop diff2s " + printStatement(g,s2));\r
+ addAddition(s2);\r
+ i2++;\r
+ break;\r
}\r
- i1++;\r
- i2++;\r
- break;\r
- }\r
- case -1:{\r
- System.out.println("Compare Prop diff1s " + printStatement(g,s1));\r
- addDeletion(s1);\r
- i1++;\r
- break;\r
- }\r
- \r
- case 1:{\r
- System.out.println("Compare Prop diff2s " + printStatement(g,s2));\r
- addAddition(s2);\r
- i2++;\r
- break;\r
- }\r
}\r
- \r
- \r
+\r
}\r
\r
ss1.clear();\r
\r
}\r
\r
- \r
public static boolean compareValue(Object v1, Object v2) {\r
if (v1 instanceof Object[] && v2 instanceof Object[])\r
return Arrays.deepEquals((Object[])v1, (Object[])v2);\r
}\r
\r
\r
- \r
public class PredicateComparator implements Comparator<Statement> {\r
@Override\r
public int compare(Statement o1, Statement o2) {\r
}\r
}\r
\r
-\r
- \r
public class ResComparator implements Comparator<Resource> {\r
@Override\r
public int compare(Resource o1, Resource o2) {\r
return 0;\r
}\r
}\r
- \r
- \r
+\r
}\r