Note: I have not spotted any failures with the previous logic.
gitlab #21
Change-Id: I22cb17b35c6c21c65b93f6a2f04dd8e4ef0e4511
if (leftPath.getLength() != rightPath.getLength())
continue;
if (comparableResources.contains(leftPath.getEnd(), rightPath.getEnd())) {
- map.map(leftPath, rightPath);
- break;
+ boolean preds = true;
+ for (int i = 0; i < leftPath.getLength(); i++) {
+ Statement sl = leftPath.getStatements().get(i);
+ Statement sr = rightPath.getStatements().get(i);
+ if (!sl.getPredicate().equals(sr.getPredicate()) && !comparableResources.contains(sl.getPredicate(), sr.getPredicate())) {
+ preds = false;
+ break;
+ }
+ }
+ if (preds) {
+ map.map(leftPath, rightPath);
+ break;
+ }
}
}
}