+ Collection<Statement> stms = graph.getStatements(sub2, p2);
+ Statement stm2 = null;
+ if (o2 == null) {
+ // Matching literal resources are not included in bijection map.
+ if (stms.size() == 1) {
+ stm2 = stms.iterator().next();
+ } else {
+ throw new DatabaseException("Did not find matching statement from bijection for (" + sub1 +","+p1+","+o1+"), got (" + sub2 +","+p2+","+o2+")");
+ }
+ } else {
+ for (Statement s : stms) {
+ if (s.getObject().equals(o2)) {
+ stm2 = s;
+ break;
+ }