AbstractQueryBuilder implements Cloneable, PrologClause<T>, ValuesClause<T> { public Node makeNode(Object o) { return Converters.makeNode( o, query.getPrefixMapping() ); } protected  AbstractQueryBuilder(); Node makeNode(Object o); @Deprecated static Object makeNodeOrPath(Object o, PrefixMapping pMapping); ElementSubQuery asSubQuery(); TriplePath makeTriplePath(Object s, Object p, Object o); Expr makeExpr(String expression); @Deprecated static String quote(String q); @Deprecated static Node checkVar(Node n ); @Deprecated static Node makeNode(Object o, PrefixMapping pMapping); @Deprecated static Var makeVar(Object o); abstract HandlerBlock getHandlerBlock(); @Override final PrologHandler getPrologHandler(); @Override ValuesHandler getValuesHandler(); final WhereHandler getWhereHandler(); @SuppressWarnings("unchecked") final T addWhere( AbstractQueryBuilder<?> whereClause); @Override final ExprFactory getExprFactory(); void setVar(Var var, Node value); void setVar(Object var, Object value); @Override T addPrefix(String pfx, Resource uri); @Override T addPrefix(String pfx, Node uri); @SuppressWarnings("unchecked") @Override T addPrefix(String pfx, String uri); @SuppressWarnings("unchecked") @Override T addPrefixes(Map<String, String> prefixes); @SuppressWarnings("unchecked") @Override T addPrefixes(PrefixMapping prefixMapping); @SuppressWarnings("unchecked") @Override T setBase(String base); @SuppressWarnings("unchecked") @Override T setBase(Object base); @Deprecated static Collection<Node> makeValueNodes( Iterator<?> iter, PrefixMapping prefixMapping ); Collection<Node> makeValueNodes( Iterator<?> iter ); @SuppressWarnings("unchecked") @Override T addValueVar(Object var); @SuppressWarnings("unchecked") @Override T addValueVar(Object var, Object... objects); @SuppressWarnings("unchecked") @Override T addValueVars(Map<?,K> dataTable); @SuppressWarnings("unchecked") @Override T addValueRow(Object... values); @SuppressWarnings("unchecked") @Override T addValueRow(Collection<?> values); @Override List<Var> getValuesVars(); @Override Map<Var,List<Node>> getValuesMap(); @SuppressWarnings("unchecked") @Override T clearValues(); @Override String toString(); final String buildString(); final Query build(); static Query clone(Query q2); static Query rewrite(Query q2, Map<Var, Node> values);  }
@Test public void testMakeNode() { Node n = builder.makeNode(null); assertEquals(Node.ANY, n); n = builder.makeNode(RDF.type); assertEquals(RDF.type.asNode(), n); Node n2 = NodeFactory.createBlankNode(); n = builder.makeNode(n2); assertEquals(n2, n); builder.addPrefix("demo", "http: n = builder.makeNode("demo:type"); assertEquals(NodeFactory.createURI("http: n = builder.makeNode("<one>"); assertEquals(NodeFactory.createURI("one"), n); try { n = builder.makeNode(builder); fail( "Should have thrown IllegalArgumentException"); } catch (IllegalArgumentException expected) { } n = builder.makeNode( Integer.valueOf( 5 )); assertTrue( n.isLiteral() ); LiteralLabel ll = LiteralLabelFactory.createTypedLiteral( Integer.valueOf(5)); assertEquals( NodeFactory.createLiteral(ll), n ); n = builder.makeNode( NodeFactory.createVariable("foo")); assertTrue( n.isVariable()); assertEquals( "foo", n.getName()); assertTrue( n instanceof Var ); n = builder.makeNode( "'text'@en"); assertTrue( n.isLiteral() ); assertEquals( "text", n.getLiteralLexicalForm()); assertEquals( "en", n.getLiteralLanguage()); }