Examples of AnonId


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

      throw new RuntimeException(e);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      throw new RuntimeException(e);
    }
        return new AnonId(result.toString());
  }
View Full Code Here

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

                    Node n ;
                    // One case; VARS line then *
                    if ( token.hasType(TokenType.STAR ) || ( token.isCtlCode() && token.getCntrlCode() == -1 ) )
                        n = lastLine.get(v) ;
                    else if ( token.hasType(TokenType.BNODE) )
                        n = Node.createAnon(new AnonId(NodeFmtLib.decodeBNodeLabel(token.getImage()))) ;
                    else
                        n = profile.create(null, token) ;
                    binding.add(v, n) ;
                }
                i++ ;
View Full Code Here

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

    public Node asNode(PrefixMap pmap)
    {
        switch(tokenType)
        {
            // Assumes that bnode labels have been sorted out already.
            case BNODE : return Node.createAnon(new AnonId(tokenImage)) ;
            case IRI :   return Node.createURI(tokenImage) ;
            case PREFIXED_NAME :
                if ( pmap == null )
                    return Node.createURI("urn:prefixed-name:"+tokenImage+":"+tokenImage2) ;
                String x = pmap.expand(tokenImage, tokenImage2) ;
View Full Code Here

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

      try {
        if (subj.toString().contains(metadataPlaceholderURIPrefix)){
          subj = (Resource) parsePlaceholder(subj, controller, currentTime, currentDocRepr);
          if (subj == null) {
            // create a unique blank node with a fixed id.
            subj = getModel().createResource(new AnonId(String.valueOf(stmt.getSubject().hashCode())));
          }
        }
       
        if (obj.toString().contains(metadataPlaceholderURIPrefix)){
          obj = parsePlaceholder(obj, controller, currentTime, currentDocRepr);
View Full Code Here

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

      Resource globalConfig = ptrStmt.getSubject();
      if (globalConfig.hasProperty(p))
        return globalConfig.getProperty(p).getObject();
    }

    return getModel().createResource(new AnonId(String.valueOf(phRes.hashCode())));
  }
View Full Code Here

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

    public void testTripleEquals() {
        try {
            Node.cache(false);
           
            // 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,
              Node.createAnon(id),    Node.createAnon(),
              Node.createLiteral(L),  Node.createLiteral(L2),
View Full Code Here

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

    private Object [][] eqTestCases()
        {
        try
            {
            Node.cache( false );          
            AnonId id = AnonId.create();
            LiteralLabel L2 = LiteralLabelFactory.create( id.toString(), "", false );
           
            LiteralLabel LLang1 = LiteralLabelFactory.create( "xyz", "en", null) ;
            LiteralLabel LLang2 = LiteralLabelFactory.create( "xyz", "EN", null) ;
           
            String U2 = id.toString();
            String N2 = id.toString();
            return new Object [][]
                {
                    { Node.ANY, "0" },
                    { Node.createAnon( id ), "1" },
                    { Node.createAnon(), "2" },
View Full Code Here

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

        test that the label of a Node can be retrieved from that Node in
        a way appropriate to that Node.
    */
    public void testLabels()
        {
        AnonId id = AnonId.create();
        assertEquals( "get URI value", U, Node.createURI( U ).getURI() );
        assertEquals( "get blank value", id, Node.createAnon( id ).getBlankNodeId() );
        assertEquals( "get literal value", L, Node.createLiteral( L ).getLiteral() );
        assertEquals( "get variable name", N, Node.createVariable( N ).getName() );
        }
View Full Code Here

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

    public void testCreateAnon()
        {
        String idA = "_xxx", idB = "_yyy";
        Node a = NodeCreateUtils.create( idA ), b = NodeCreateUtils.create( idB );
        assertTrue( "both must be bnodes", a.isBlank() && b.isBlank() );
        assertEquals( new AnonId( idA ), a.getBlankNodeId() );
        assertEquals( new AnonId( idB ), b.getBlankNodeId() );
        }
View Full Code Here

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

 
  @Override
  public BlankNode createBlankNode(String id) {
    // this.modificationCount++;
    // should be unique across models
    AnonId anonid = AnonId.create(id);
    return new JenaBlankNode(com.hp.hpl.jena.graph.NodeFactory.createAnon(anonid));
  }
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.