throws Exception
{
MemoryStore store = new MemoryStore(dataDir);
store.initialize();
URIFactory factory = store.getURIFactory();
URI foo = factory.createURI("http://www.foo.example/foo");
URI bar = factory.createURI("http://www.foo.example/bar");
SailConnection con = store.getConnection();
con.addStatement(foo, RDF.TYPE, bar);
TupleQueryModel query = QueryParserUtil.parseTupleQuery(QueryLanguage.SERQL,
"SELECT X, P, Y FROM {X} P {Y}", null);
Cursor<? extends BindingSet> iter = con.evaluate(query,
EmptyBindingSet.getInstance(), false);
BindingSet bindingSet = iter.next();
assertEquals(bindingSet.getValue("X"), foo);
assertEquals(bindingSet.getValue("P"), RDF.TYPE);
assertEquals(bindingSet.getValue("Y"), bar);
iter.close();
con.close();
store.shutDown();
store = new MemoryStore(dataDir);
store.initialize();
factory = store.getURIFactory();
foo = factory.createURI("http://www.foo.example/foo");
bar = factory.createURI("http://www.foo.example/bar");
con = store.getConnection();
iter = con.evaluate(query, EmptyBindingSet.getInstance(), false);