/** Create a new AnonId from the string argument supplied * @param idStr A string representation of the id to be created. */ public AnonId( String idStr ) { blankNodeId = BlankNodeId.create(idStr) ; }
/** Create a new AnonId from the string argument supplied * @param idStr A string representation of the id to be created. */ public AnonId( String idStr ) { blankNodeId = BlankNodeId.create(idStr) ; }
public AnonId() { blankNodeId = BlankNodeId.create() ; }
public AnonId() { blankNodeId = BlankNodeId.create() ; }
/** make a blank node with the specified label * @deprecated Use {@link #createBlankNode(String)} */ @Deprecated public static Node createAnon(String string) { Objects.requireNonNull(string, "Argument to NodeFactory.createAnon is null") ; BlankNodeId id = BlankNodeId.create(string) ; return new Node_Blank(id) ; }
/** make a blank node with the specified label */ public static Node createBlankNode(String string) { BlankNodeId id = BlankNodeId.create(string) ; return new Node_Blank(id) ; }
/** make a blank node with a fresh anon id * @deprecated Use {@link #createBlankNode()} */ @Deprecated public static Node createAnon() { return createAnon(BlankNodeId.create()) ; }
/** Make a fresh blank node */ public static Node createBlankNode() { return createBlankNode(BlankNodeId.create()) ; }
/** make a blank node with the specified label */ public static Node createBlankNode(String string) { BlankNodeId id = BlankNodeId.create(string) ; return new Node_Blank(id) ; }
/** make a blank node with the specified label * @deprecated Use {@link #createBlankNode(String)} */ @Deprecated public static Node createAnon(String string) { Objects.requireNonNull(string, "Argument to NodeFactory.createAnon is null") ; BlankNodeId id = BlankNodeId.create(string) ; return new Node_Blank(id) ; }
/** make a blank node with a fresh anon id * @deprecated Use {@link #createBlankNode()} */ @Deprecated public static Node createAnon() { return createAnon(BlankNodeId.create()) ; }
/** Make a fresh blank node */ public static Node createBlankNode() { return createBlankNode(BlankNodeId.create()) ; }
/** Test that anonymous nodes are created with the correct labels */ public void testCreateBlankNode() { String idA = "_xxx", idB = "_yyy"; Node a = NodeCreateUtils.create( idA ), b = NodeCreateUtils.create( idB ); assertTrue( "both must be bnodes", a.isBlank() && b.isBlank() ); assertEquals( BlankNodeId.create( idA ), a.getBlankNodeId() ); assertEquals( BlankNodeId.create( idB ), b.getBlankNodeId() ); }
/** Test that anonymous nodes are created with the correct labels */ public void testCreateBlankNode() { String idA = "_xxx", idB = "_yyy"; Node a = NodeCreateUtils.create( idA ), b = NodeCreateUtils.create( idB ); assertTrue( "both must be bnodes", a.isBlank() && b.isBlank() ); assertEquals( BlankNodeId.create( idA ), a.getBlankNodeId() ); assertEquals( BlankNodeId.create( idB ), b.getBlankNodeId() ); }
return NodeFactory.createLiteral( x, XSDDatatype.XSDinteger ); if (first == '_') return NodeFactory.createBlankNode( BlankNodeId.create( x ) ); if (x.equals( "??" )) return Node.ANY;
public static Graph getGraph() { Graph g = Factory.createGraphMem(); g.add(new Triple(NodeFactory.createURI("http://example.com/subject"), NodeFactory.createURI("http://example.com/predicate"), NodeFactory.createURI("http://example.com/object"))); g.add(new Triple(NodeFactory.createBlankNode(BlankNodeId.create("a")), NodeFactory.createURI("http://example.com/p1"), NodeFactory .createBlankNode(BlankNodeId.create("b")))); g.add(new Triple(NodeFactory.createBlankNode(BlankNodeId.create("b")), NodeFactory.createURI("http://example.com/p2"), NodeFactory .createLiteral("foo"))); g.add(new Triple(NodeFactory.createURI("http://example.com/ns/e"), NodeFactory.createURI("http://example.com/ns/p5"), NodeFactory .createLiteral("verify base works"))); return g; }
public static Graph getGraph() { Graph g = Factory.createGraphMem(); g.add(new Triple(NodeFactory.createURI("http://example.com/subject"), NodeFactory.createURI("http://example.com/predicate"), NodeFactory.createURI("http://example.com/object"))); g.add(new Triple(NodeFactory.createBlankNode(BlankNodeId.create("a")), NodeFactory.createURI("http://example.com/p1"), NodeFactory .createBlankNode(BlankNodeId.create("b")))); g.add(new Triple(NodeFactory.createBlankNode(BlankNodeId.create("b")), NodeFactory.createURI("http://example.com/p2"), NodeFactory .createLiteral("foo"))); g.add(new Triple(NodeFactory.createURI("http://example.com/ns/e"), NodeFactory.createURI("http://example.com/ns/p5"), NodeFactory .createLiteral("verify base works"))); return g; }
/** test that the label of a Node can be retrieved from that Node in a way appropriate to that Node. */ public void testLabels() { BlankNodeId id = BlankNodeId.create(); assertEquals( "get URI value", U, NodeFactory.createURI( U ).getURI() ); assertEquals( "get blank value", id, NodeFactory.createBlankNode( id ).getBlankNodeId() ); assertEquals( "get literal value", L, NodeFactory.createLiteral( L ).getLiteral() ); assertEquals( "get variable name", N, NodeFactory.createVariable( N ).getName() ); }
/** test that the label of a Node can be retrieved from that Node in a way appropriate to that Node. */ public void testLabels() { BlankNodeId id = BlankNodeId.create(); assertEquals( "get URI value", U, NodeFactory.createURI( U ).getURI() ); assertEquals( "get blank value", id, NodeFactory.createBlankNode( id ).getBlankNodeId() ); assertEquals( "get literal value", L, NodeFactory.createLiteral( L ).getLiteral() ); assertEquals( "get variable name", N, NodeFactory.createVariable( N ).getName() ); }
BlankNodeId id = BlankNodeId.create(); LiteralLabel L2 = LiteralLabelFactory.create( id.toString(), "", false );