queryBuilder.append(" USING NAMESPACE foaf = <" + FOAF_NS + ">");
GraphQuery query = testCon.prepareGraphQuery(QueryLanguage.SERQL, queryBuilder.toString());
query.setBinding("name", nameBob);
GraphResult result = query.evaluate();
try {
assertNotNull(result);
assertTrue(result.hasNext());
while (result.hasNext()) {
Statement st = result.next();
assertTrue(name.equals(st.getPredicate()) || mbox.equals(st.getPredicate()));
if (name.equals(st.getPredicate())) {
assertEquals("unexpected value for name: " + st.getObject(), nameBob, st.getObject());
}
else {
assertEquals(mbox, st.getPredicate());
assertEquals("unexpected value for mbox: " + st.getObject(), mboxBob, st.getObject());
}
}
}
finally {
result.close();
}
}