public Node create(String label) { return Node.createAnon() ; }
/** generate a blank node consistently */ private static Node newBlank(Node n, Map<Node, Node> bNodeMap) { if ( ! bNodeMap.containsKey(n) ) bNodeMap.put(n, Node.createAnon() ); return bNodeMap.get(n) ; } }
public Node allocNode() { if ( generateVars ) return allocAnonVariable() ; return Node.createAnon() ; }
public Node create(String label) { String $ = format("B0x%04X", ++counter) ; return Node.createAnon(new AnonId($)) ; }
public Node create(String label) { if ( label == null ) label = SysRIOT.BNodeGenIdPrefix+counter++ ; return Node.createAnon(new AnonId(label)) ; }
@Override public Node_Blank read(Kryo kryo, Input input, Class<Node_Blank> type) { final String label = input.readString(); final Node_Blank retNode = (Node_Blank) Node.createAnon(AnonId.create(label)); return retNode; }
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) ; }
private void createExpression(Property p) { if( subj != null ) { TripleAdder.add( graph, subj, p, obj ); } else { Node c = Node.createAnon(); TripleAdder.add( graph, c, p, obj ); obj = c; } }
@Override public Node_Blank read(Kryo kryo, Input input, Class<Node_Blank> type) { final String label = input.readString(); final Node_Blank retNode = (Node_Blank) Node.createAnon(AnonId.create(label)); return retNode; }
public static Node build(Document doc) { String lex = doc.get(LARQ.fLex) ; if ( lex != null ) return buildLiteral(doc) ; String uri = doc.get(LARQ.fURI) ; if ( uri != null ) return Node.createURI(uri) ; String bnode = doc.get(LARQ.fBNodeID) ; if ( bnode != null ) return Node.createAnon(new AnonId(bnode)) ; throw new ARQLuceneException("Can't build: "+doc) ; }
final public void emitBNode(int line, int column, String label) { Node n = null ; if ( label.equals("") ) // Fresh anonymous bNode n = Node.createAnon() ; else n = bNodeLabels.asNode(label) ; Item item = Item.createNode(n, line, column) ; listAdd(item) ; }
public void visitInverse(ATermAppl term) { Node node = Node.createAnon(); Node prop = convert( term.getArgument( 0 ) ); TripleAdder.add( graph, node, OWL.inverseOf, prop ); obj = node; }
protected final Node triplesBlankNode() { nextToken() ; // Skip [ Node subject = Node.createAnon() ; if ( peekPredicate() ) predicateObjectList(subject) ; expect("Triples not terminated properly in []-list", RBRACKET) ; // Exit: after the ] return subject ; }
private void convertNary(ATermAppl axiom, Resource type, Property p) { Node n = Node.createAnon(); TripleAdder.add( graph, n, RDF.type, type ); ATermList concepts = (ATermList) axiom.getArgument( 0 ); converter.visitList( concepts ); TripleAdder.add( graph, n, p, converter.getResult() ); }
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 visitSelf(ATermAppl term) { Node restr = Node.createAnon(); Node prop = convert( term.getArgument( 0 ) ); TripleAdder.add( graph, restr, RDF.type, OWL.Restriction ); TripleAdder.add( graph, restr, OWL.onProperty, prop ); TripleAdder.add( graph, restr, OWL2.hasSelf, JenaUtils.XSD_BOOLEAN_TRUE ); obj = restr; }
@Test public void nodec_blank_03() { test (Node.createAnon()) ; }
private Node createRestriction(ATermAppl term, Property restrType) { Node restr = Node.createAnon(); Node prop = convert( term.getArgument( 0 ) ); Node val = convert( term.getArgument( 1 ) ); TripleAdder.add( graph, restr, RDF.type, OWL.Restriction ); TripleAdder.add( graph, restr, OWL.onProperty, prop ); TripleAdder.add( graph, restr, restrType, val ); obj = restr; return restr; }
@Test public void nodec_blank_02() { test (Node.createAnon(new AnonId("a:b:c-d"))) ; } @Test public void nodec_blank_03() { test (Node.createAnon()) ; }
public void visitList(ATermList list) { if( list.isEmpty() ) { obj = RDF.nil.asNode(); } else { Node rdfList = Node.createAnon(); Node first = convert( list.getFirst() ); TripleAdder.add( graph, rdfList, RDF.first, first ); visitList( list.getNext() ); TripleAdder.add( graph, rdfList, RDF.rest, obj ); obj = rdfList; } }