VariableField x = new VariableField("X");
VariableField y = new VariableField("Y");
VariableField z = new VariableField("Z");
Pattern p1 = new Pattern(x, new ResourceField(predicate1), y);
Pattern p2 = new Pattern(y, new ResourceField(predicate1), z);
KiWiReasoningConnection connection = rpersistence.getConnection();
try {
List<QueryResult> results = asList(connection.query(ImmutableSet.of(p1,p2), null, null, null, true));
Assert.assertEquals(1, results.size());
Assert.assertEquals(2, results.get(0).getJustifications().size());