Examples of AnonId


Examples of com.hp.hpl.jena.rdf.model.AnonId

    @Override
    public void reset() {}

    @Override
    public Node alloc(String label) {
        return NodeFactory.createAnon(new AnonId(NodeFmtLib.decodeBNodeLabel(label))) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

    }

    @Override
    public Node create() {
        String label = SysRIOT.BNodeGenIdPrefix + (counter.getAndIncrement()) ;
        return NodeFactory.createAnon(new AnonId(label)) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

                    {
                        String label = parser.getElementText() ;
                        Node node = null ;
                        //if ( inputGraphLabels.getValue() )
                        if ( inputGraphLabels )
                            node = NodeFactory.createAnon(new AnonId(label)) ;
                        else
                            node = bNodes.asNode(label) ;
                        addBinding(binding, Var.alloc(varName), node) ;
                        break ;
                    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

          return NodeFactory.createLiteral(value, lang, false);
        } else {
          return NodeFactory.createLiteral(value);
        }
      } else if (type.equals("bnode")) {
        return NodeFactory.createAnon(new AnonId(value));
      } else {
        exception(pos, "Encountered a Node object with an invalid type value '%s', expected one of uri, literal or bnode", type);
      }
    }
    else
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

  public void testCreateBlankFromNode()
  {
    final RDFNode S = model.getRDFNode(NodeCreateUtils.create("_Blank"));
    JenaTestBase.assertInstanceOf(Resource.class, S);
    Assert.assertEquals(new AnonId("_Blank"), ((Resource) S).getId());
  }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

  /**
   * Check that anonIDs are distinct whichever state the flag is in.
   */
  public void doTestAnonID()
  {
    final AnonId id1 = AnonId.create();
    final AnonId id2 = AnonId.create();
    final AnonId id3 = AnonId.create();
    final AnonId id4 = AnonId.create();

    JenaTestBase.assertDiffer(id1, id2);
    JenaTestBase.assertDiffer(id1, id3);
    JenaTestBase.assertDiffer(id1, id4);
    JenaTestBase.assertDiffer(id2, id3);
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

   * Test that creation of an AnonId from an AnonId string preserves that
   * string and is equal to the original AnonId.
   */
  public void testAnonIdPreserved()
  {
    final AnonId anon = AnonId.create();
    final String id = anon.toString();
    Assert.assertEquals(anon, AnonId.create(id));
    Assert.assertEquals(id, AnonId.create(id).toString());
  }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

   
    @Test public void nodec_uri_01()    { test ("<>") ; }
    @Test public void nodec_uri_02()    { test ("<http://example/>") ; }
   
    // Jena anon ids can have a string form including ":"
    @Test public void nodec_blank_01()  { test (com.hp.hpl.jena.graph.NodeFactory.createAnon(new AnonId("a"))) ; }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

    @Test public void nodec_uri_01()    { test ("<>") ; }
    @Test public void nodec_uri_02()    { test ("<http://example/>") ; }
   
    // Jena anon ids can have a string form including ":"
    @Test public void nodec_blank_01()  { test (com.hp.hpl.jena.graph.NodeFactory.createAnon(new AnonId("a"))) ; }
    @Test public void nodec_blank_02()  { test (com.hp.hpl.jena.graph.NodeFactory.createAnon(new AnonId("a:b:c-d"))) ; }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.AnonId

    private static final String N = "Alice";
    private static final LiteralLabel L = LiteralLabelFactory.create( "ashes are burning", "en", false );
       
    public void testTripleEquals() {
        // create some nodes to test
        AnonId id = AnonId.create();
        LiteralLabel L2 = LiteralLabelFactory.create(id.toString(), "", false);
        String U2 = id.toString();
        String N2 = id.toString();

        Node[] nodes = new Node[] {
            Node.ANY,
            NodeFactory.createAnon(id),    NodeFactory.createAnon(),
            NodeFactory.createLiteral(L),  NodeFactory.createLiteral(L2),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.