public Node getIRI() { return Node.createURI(name) ; } }
public OpProcedure(String iri, ExprList args, Op op) { this(Node.createURI(iri), args, op) ; }
public UpdateLoad(String source, String dest) { this(source, Node.createURI(dest), false) ; }
@Override public Node createURI(String uri) { return Node.createURI(uri); }
private static Node createIRI(String iriStr) { try { return Node.createURI(IRIResolver.resolveGlobal(iriStr)) ; } catch (RuntimeException ex) { return null ; } }
public boolean containsNamedModel(String uri) { Node n = Node.createURI(uri) ; return dsg.containsGraph(n) ; }
protected Node createNode(String iri) { // Is it a bNode label? i.e. <_:xyz> if ( isBNodeIRI(iri) ) { String s = iri.substring(bNodeLabelStart.length()) ; Node n = Node.createAnon(new AnonId(s)) ; return n ; } return Node.createURI(iri) ; }
public void emitIRI(int line, int column, String iriStr) { Node n = Node.createURI(iriStr) ; Item item = Item.createNode(n, line, column) ; listAdd(item) ; }
public boolean containsNamedModel(String uri) { checkGraphName(uri) ; // Don't look in the cache - just ask the DSG which either caches graphs // or asks the storage as needed. The significant case is whether an // empty graph is contained in a dataset. If it's pure quad storage, // the answer is usually better as "no"; if it's an in-memory // dataset the answer is "yes". return dsg.containsGraph(Node.createURI(uri)) ; }
public Model getNamedModel(String uri) { Node n = Node.createURI(uri) ; Graph g = dsg.getGraph(n) ; if ( g == null ) return null ; return graph2model(g) ; }
private void endElementURI(String ns, String localName, String name) { endAccumulate() ; String uri = buff.toString() ; Node n = Node.createURI(uri) ; if ( checkVarName("URI: "+uri) ) addBinding(binding, Var.alloc(varName), n) ; }
public void addNamedModel(String uri, Model model) throws LabelExistsException { addToCache(model) ; Node n = Node.createURI(uri) ; dsg.addGraph(n, model.getGraph()) ; }
public void removeNamedModel(String uri) { Node n = Node.createURI(uri) ; removeFromCache(dsg.getGraph(n)) ; dsg.removeGraph(n) ; }
@Override public void postParse2(Query query) { super.postParse2(query) ; if ( isNode() ) // Already done. return ; String full = query.getPrefix(prefix) ; if ( full == null ) throw new QueryException("Query error: QName '"+seen+"' can not be expanded.") ; super._setNode(Node.createURI(full+lcname)) ; }
private static Node convert(AResource r) { if (!r.isAnonymous()) return Node.createURI(r.getURI()); // String id = r.getAnonymousID(); Node rr = (Node) r.getUserData(); if (rr == null) { rr = Node.createAnon(); r.setUserData(rr); } return rr; }
public void replaceNamedModel(String uri, Model model) { Node n = Node.createURI(uri) ; removeFromCache(dsg.getGraph(n)) ; dsg.removeGraph(n) ; addToCache(model) ; dsg.addGraph(n, model.getGraph() ) ; }
/** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { sadiActivity = new SADIActivity(); OntModelImpl model = new OntModelImpl(OntModelSpec.OWL_MEM); ontProperty = new OntPropertyImpl(Node.createURI("/x"), model); ontClass = new OntClassImpl(Node.createURI("/y"), model); restrictionNode = new RestrictionNode(ontProperty, ontClass); sadiActivityInputPort = new SADIActivityInputPort(sadiActivity, restrictionNode, "port-name", 2); }
/** * @throws java.lang.Exception */ @Before public void setUp() throws Exception { model = new OntModelImpl(OntModelSpec.OWL_MEM); ontProperty = new OntPropertyImpl(Node.createURI("/x"), model); ontClass = new OntClassImpl(Node.createURI("/y"), model); restrictedProperty = new RestrictionNode(ontProperty, ontClass); parentRestrictedProperty = new RestrictionNode(ontProperty, ontClass); parentRestrictedProperty.add(restrictedProperty); }
@Test public void gr_union_02() { List<Node> gnodes = list(gn1, gn2) ; Graph g = new GraphUnionRead(dsg, gnodes) ; Node s = Node.createURI("http://example/s") ; long x = Iter.count(g.find(s, null, null)) ; assertEquals(3, x) ; }