WhereHandler implements Handler { public void addGraph(Node graph, WhereHandler subQuery) { getClause().addElement(new ElementNamedGraph(graph, subQuery.getElement())); } WhereHandler(Query query);  WhereHandler(); Element getQueryPattern(); Query getQuery(); void addAll(WhereHandler whereHandler); Element getElement(); ElementGroup getClause(); void addWhere(TriplePath t); void addWhere(ValuesHandler values); void addOptional(TriplePath t); void addOptional(WhereHandler whereHandler); void addFilter(String expression); void addFilter(Expr expr); void addSubQuery(AbstractQueryBuilder<?> subQuery); ElementSubQuery makeSubQuery(AbstractQueryBuilder<?> subQuery); void addUnion(AbstractQueryBuilder<?> subQuery); void addGraph(Node graph, WhereHandler subQuery); void addGraph(Node graph, TriplePath subQuery); void addBind(Expr expr, Var var); void addBind(String expression, Var var); @Override void setVars(Map<Var, Node> values); @Override void build(); Node list(Object... objs); void addMinus( AbstractQueryBuilder<?> qb ); void addValueVar(PrefixMapping prefixMapping, Object var); void addValueVar(PrefixMapping prefixMapping, Object var, Object... objects); void addValueVars(PrefixMapping prefixMapping, Map<?,K> dataTable); void addValueRow(PrefixMapping prefixMapping, Object... values); void addValueRow(PrefixMapping prefixMapping, Collection<?> values); List<Var> getValuesVars(); Map<Var,List<Node>> getValuesMap(); void clearValues();  }
@Test public void addGraph() { WhereHandler handler2 = new WhereHandler(new Query()); handler2.addWhere(new TriplePath(new Triple(NodeFactory.createURI("one"), NodeFactory.createURI("two"), NodeFactory.createURI("three")))); handler.addGraph(NodeFactory.createURI("graph"), handler2); handler.build(); assertContainsRegex(WHERE + OPEN_CURLY + "GRAPH" + SPACE + uri("graph") + SPACE + OPEN_CURLY + uri("one") + SPACE + uri("two") + SPACE + uri("three") + OPT_SPACE + CLOSE_CURLY + CLOSE_CURLY, query.toString()); }