.append(" ?").append(variable2).append(" . OPTIONAL { ?")
.append(variable1).append(" ").append(prefix2).append(":")
.append(predicate2).append(" ?").append(variable3)
.append(" .} FILTER ( ! bound(?").append(variable3).append(") ) }");
Query q = QueryParser.getInstance().parse(queryStrBuf.toString());
Assert.assertTrue(SelectQuery.class.isAssignableFrom(q.getClass()));
SelectQuery selectQuery = (SelectQuery) q;
Assert.assertTrue(selectQuery.getSelection().size() == 2);
Set<Variable> vars = new HashSet<Variable>(2);
Variable var1 = new Variable(variable1);
Variable var2 = new Variable(variable2);