public static NodeValue strDatatype(NodeValue v1, NodeValue v2) { if (!v1.isString()) throw new ExprEvalException("Not a string (arg 1): " + v1); if (!v2.isIRI()) throw new ExprEvalException("Not an IRI (arg 2): " + v2); String lex = v1.asString(); Node dt = v2.asNode(); // Check? Node n = Node.createLiteral(lex, null, Node.getType(dt.getURI())); return NodeValue.makeNode(n); }