.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);
vars.add(var1);
vars.add(var2);
Assert.assertTrue(selectQuery.getSelection().containsAll(vars));
GroupGraphPattern ggp = selectQuery.getQueryPattern();
List<Expression> constraints = ggp.getFilter();
Assert.assertTrue(UnaryOperation.class.isAssignableFrom(constraints
.get(0).getClass()));
UnaryOperation uop = (UnaryOperation) constraints.get(0);
Assert.assertTrue(uop.getOperatorString().equals("!"));