}
TupleQuery tupleQuery = testCon.prepareTupleQuery(QueryLanguage.SERQL,
"SELECT S, P, O FROM {S} P {O} WHERE P = <" + pred.stringValue() + ">", null);
TupleResult iter;
iter = tupleQuery.evaluate();
try {
assertTrue(iter.hasNext());
BindingSet bindings = iter.next();
assertEquals(subj, bindings.getValue("S"));
assertEquals(pred, bindings.getValue("P"));
assertEquals(obj, bindings.getValue("O"));
assertFalse(iter.hasNext());
}
finally {
iter.close();
}
tupleQuery = testCon.prepareTupleQuery(QueryLanguage.SERQL, "SELECT S, P, O FROM {S} P {O} WHERE P = <"
+ pred.stringValue() + ">", null);
tupleQuery.setBinding("S", subj);
tupleQuery.setBinding("P", pred);
tupleQuery.setBinding("O", obj);
iter = tupleQuery.evaluate();
try {
assertTrue(iter.hasNext());
BindingSet bindings = iter.next();
assertEquals(subj, bindings.getValue("S"));
assertEquals(pred, bindings.getValue("P"));
assertEquals(obj, bindings.getValue("O"));
assertFalse(iter.hasNext());
}
finally {
iter.close();
}
}