/** * 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); }
/** make a URI node with the specified URIref string * @deprecated Use {@link NodeFactory#createURI(String)} instead*/ @Deprecated public static Node createURI( String uri ) { return NodeFactory.createURI(uri) ; }
public static Set<Node> convertToNodes(Collection<String> uris) { Set<Node> nodes = new HashSet<Node>() ; for ( String x : uris ) nodes.add(NodeFactory.createURI(x)) ; return nodes ; }
protected Node createNode(String iri) { if ( skolomizedBNodes ) return RiotLib.createIRIorBNode(iri) ; else return NodeFactory.createURI(iri) ; }
/** Delete a named model of a Dataset */ @Override public void deleteModel(String graphUri) { updater.httpDelete(NodeFactory.createURI(graphUri)) ; }
/** * Creates a random URI node by using the {@code http} scheme name. * * @return the randomly generated node. */ public static Node randomUri() { return NodeFactory.createURI(UriGenerator.random( DEFAULT_LENGTH, DEFAULT_URI_SCHEME_NAME)); }
@Override public Node getEventId(String metaGraphValue) { return NodeFactory.createURI(Quadruple.removeMetaInformation(metaGraphValue)); } };
/** * Appends a URI to the command text as a constant using appropriate * formatting * * @param uri * URI to append */ public void appendIri(String uri) { this.appendNode(NodeFactory.createURI(uri)); }
/** * Return a property Node which represents the direct version of a * transitively closed property. See <code>makeDirect(String)</code>; * this method makes a new Node with the direct respelling of * <code>node</code>s URI. */ public static Node makeDirect(Node node) { return NodeFactory.createURI( makeDirect( node.getURI() ) ); }
public static NodeValue uuid() { String str = "urn:uuid:" + uuidString() ; Node n = NodeFactory.createURI(str) ; return NodeValue.makeNode(n) ; }
@Override public void delete(String uri) { this.getAccessor().httpDelete(NodeFactory.createURI(uri)); }
private void endElementURI(String ns, String localName, String name) { endAccumulate() ; String uri = buff.toString() ; Node n = NodeFactory.createURI(uri) ; if ( checkVarName("URI: " + uri) ) addBinding(binding, Var.alloc(varName), n) ; }
@Override public void addNamedModel(String uri, Model model) throws LabelExistsException { checkGraphName(uri) ; // Assumes single writer. addToCache(model) ; Node n = NodeFactory.createURI(uri) ; dsg.addGraph(n, model.getGraph()) ; }
@Override public void removeNamedModel(String uri) { checkGraphName(uri) ; Node n = NodeFactory.createURI(uri) ; // Assumes single writer. removeFromCache(dsg.getGraph(n)) ; dsg.removeGraph(n) ; }
@Override public void store(String uri, Model model) { Node graphNode = NodeFactory.createURI(uri); DatasetGraphAccessor accessor = this.getAccessor(); Dataset ds = DatasetFactory.create(model); DatasetGraph dsg = ds.asDatasetGraph(); Graph g = dsg.getDefaultGraph(); accessor.httpPut(graphNode, g); }
private static Node convert(AResource r) { if (!r.isAnonymous()) return NodeFactory.createURI(r.getURI()); // String id = r.getAnonymousID(); Node rr = (Node) r.getUserData(); if (rr == null) { rr = NodeFactory.createAnon(); r.setUserData(rr); } return rr; }
@Override public void replaceNamedModel(String uri, Model model) { // Assumes single writer. checkGraphName(uri) ; Node n = NodeFactory.createURI(uri) ; removeFromCache(dsg.getGraph(n)) ; dsg.removeGraph(n) ; addToCache(model) ; dsg.addGraph(n, model.getGraph() ) ; }
@Override public Expr evaluate(NodeTest nodeTest, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) { IsATest isATest = (IsATest) nodeTest; Var tmpVar = Var.alloc(Var.alloc(VarIDGenerator.createID())); elementGroup.addTriplePattern(new Triple(var.asNode(), RDF.type.asNode(), tmpVar.asNode())); return new E_Equals(new ExprVar(tmpVar.asNode()), new NodeValueNode(NodeFactory.createURI(isATest.getPathExpression(new SesameValueBackend()).replace("<", "").replace(">", "").replaceFirst("is-a ", "")))); } }
@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 Var evaluate(NodeSelector nodeSelector, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) { ReversePropertySelector reversePropertySelector = (ReversePropertySelector) nodeSelector; Var id = Var.alloc(VarIDGenerator.createID()); ElementPathBlock epb = new ElementPathBlock(); epb.addTriple(new TriplePath(var.asNode(), new P_Inverse(new P_Link(NodeFactory.createURI(reversePropertySelector.getProperty().toString()))), id.asNode())); ElementGroup group = new ElementGroup(); group.addElement(epb); elementGroup.addElement(group); return id; } }