@Test
public void testSelectQuery() throws Exception {
String query = "PREFIX \t:\t<test://test/>\n" + "SELECT ?s ?p \n"
+ "WHERE { ?s ?p \"Test2\" }";
BlankNode bNode = this.model.createBlankNode();
this.model.addStatement(subject, predicate, "Test1");
this.model.addStatement(subject, predicate, "Test2");
this.model.addStatement(bNode, predicate, "Test2");
QueryResultTable result = this.model.sparqlSelect(query);
ClosableIterator<QueryRow> it = result.iterator();
assertTrue(it.hasNext());
QueryRow row = it.next();
assertTrue(result.getVariables().size() == 2);
assertEquals(predicate, row.getValue("p"));
assertTrue(subject.equals(row.getValue("s")) || bNode.equals(row.getValue("s")));
row = it.next();
assertEquals(predicate, row.getValue("p"));
assertTrue(subject.equals(row.getValue("s")) || bNode.equals(row.getValue("s")));
it.close();
}