/** * Creates a sub subscription id URI from the specified * {@code subscriptionId} which is assumed to be a {@link SubscriptionId}. * * @param subSubscriptionId * the subscription identifier to use. * * @return the sub subscription id URI as a Jena {@link Node_URI}. */ public static final Node createSubSubscriptionIdUri(String subSubscriptionId) { return NodeFactory.createURI(SUBSUBSCRIPTION_NS + subSubscriptionId); }
@Override public Node handle(Node node, String lexicalForm, RDFDatatype datatype) { return NodeFactory.createLiteral(lexicalForm) ; } } ;
private static Node fresh( String uri ) { return uri == null ? NodeFactory.createAnon() : NodeFactory.createURI( uri ); }
@Override public Expr evaluate(NodeTest nodeTest, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) { PathEqualityTest pathEqualityTest = (PathEqualityTest) nodeTest; Var tmpVar = LDPathEvaluator.evaluate(pathEqualityTest.getPath(), elementGroup, var, evaluatorConfiguration); if(pathEqualityTest.getNode() instanceof org.openrdf.model.impl.LiteralImpl) { return new E_Equals(new ExprVar(tmpVar.asNode()), new NodeValueNode(NodeFactory.createLiteral(((LiteralImpl) pathEqualityTest.getNode()).getLabel().toString()))); } else { return new E_Equals(new ExprVar(tmpVar.asNode()), new NodeValueNode(NodeFactory.createURI(pathEqualityTest.getNode().toString()))); } } }
@Override public Node create() { return NodeFactory.createAnon() ; } }
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 = NodeFactory.createLiteral(lex, null, NodeFactory.getType(dt.getURI())) ; return NodeValue.makeNode(n) ; }
/** * @deprecated Use {@link NodeFactory#getType(String)} instead */ @Deprecated public static RDFDatatype getType( String s ) { return NodeFactory.getType(s) ; }
/** * {@inheritDoc} */ @Override public Object parse(String lexicalForm) throws DatatypeFormatException { return NodeFactory.createVariable(lexicalForm); }
public Node allocNode() { return NodeFactory.createAnon() ; }
/** Cast a NodeValue to a date/time type (xsd dateTime, date, time, g*) according to F&O * <a href="http://www.w3.org/TR/xpath-functions/#casting-to-datetimes">17.1.5 Casting to date and time types</a> * Throws an exception on incorrect case. * * @throws ExprEvalTypeException */ public static NodeValue dateTimeCast(NodeValue nv, String typeURI) { RDFDatatype t = NodeFactory.getType(typeURI) ; return dateTimeCast(nv, t) ; }
protected Node createVariable(String s, int line, int column) { s = s.substring(1) ; // Drop the marker return NodeFactory.createVariable(s) ; }
public GraphSPARQL(DatasetGraph dataset, String uri) { this(dataset, NodeFactory.createURI(uri)) ; }
@Override public Node handle(Node node, String lexicalForm, RDFDatatype datatype) { return NodeFactory.createLiteral(lexicalForm, "", datatype) ; } } ;
static private Node makeURI(String uri) { return uri == null ? NodeFactory.createAnon() : NodeFactory.createURI( uri ); }
public ResourceImpl(AnonId id, ModelCom m) { this( NodeFactory.createAnon( id ), m ); }
/** make a variable node with a given name * @deprecated Use {@link NodeFactory#createVariable(String)} instead*/ @Deprecated public static Node createVariable( String name ) { return NodeFactory.createVariable(name) ; }
public OpProcedure(String iri, ExprList args, Op op) { this(NodeFactory.createURI(iri), args, op) ; }
@Override public Node createStringLiteral(String lexical, long line, long col) { return NodeFactory.createLiteral(lexical) ; }
protected Node createNode(String iri) { // Is it a bNode label? i.e. <_:xyz> if ( isBNodeIRI(iri) ) { String s = iri.substring(bNodeLabelStart.length()) ; Node n = NodeFactory.createAnon(new AnonId(s)) ; return n ; } return NodeFactory.createURI(iri) ; }
/** make a blank node with the specified label * @deprecated Use {@link NodeFactory#createAnon(AnonId)} instead*/ @Deprecated public static Node createAnon( AnonId id ) { return NodeFactory.createAnon(id) ; }