con.commit();
TupleQueryModel tupleQuery = QueryParserUtil.parseTupleQuery(QueryLanguage.SERQL,
"select X from {X} rdf:type {Y} rdf:type {rdfs:Class}", null);
MapBindingSet bindings = new MapBindingSet(1);
Cursor<? extends BindingSet> iter;
iter = con.evaluate(tupleQuery, bindings, false);
int resultCount = verifyQueryResult(iter, 1);
assertEquals("Wrong number of query results", 2, resultCount);
bindings.addBinding("Y", painter);
iter = con.evaluate(tupleQuery, bindings, false);
resultCount = verifyQueryResult(iter, 1);
assertEquals("Wrong number of query results", 1, resultCount);
bindings.addBinding("Z", painting);
iter = con.evaluate(tupleQuery, bindings, false);
resultCount = verifyQueryResult(iter, 1);
assertEquals("Wrong number of query results", 1, resultCount);
bindings.removeBinding("Y");
iter = con.evaluate(tupleQuery, bindings, false);
resultCount = verifyQueryResult(iter, 1);
assertEquals("Wrong number of query results", 2, resultCount);
}