Package com.hp.hpl.jena.rdf.model

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


//                return Node_RuleVariable.WILD;
            } else if (token.startsWith("<") && token.endsWith(">")) {
                String uri = token.substring(1, token.length()-1);
                return NodeFactory.createURI(uri);
            } else if (token.startsWith( "_" )) { // TODO rationalise [this is for the RIF code]
                return NodeFactory.createAnon( new AnonId( token.substring( 1 ) ) );
            } else if (token.indexOf(':') != -1) {
                String exp = prefixMapping.expandPrefix(token); // Local map first
                exp = PrintUtil.expandQname(exp)// Retain global map for backward compatibility
                if (exp == token) {
                    // No expansion was possible
View Full Code Here


      if (node.getType().equals( SecNode.Type.URI)) {
        Resource r = model.createResource( node.getValue() );
        return evaluate( r );
      }
      else if (node.getType().equals( SecNode.Type.Anonymous)) {
        Resource r = model.getRDFNode( NodeFactory.createAnon( new AnonId( node.getValue()) ) ).asResource();
        return evaluate( r );
      }
      else
      {
        return true;
View Full Code Here

    if (node.getType().equals( SecNode.Type.URI)) {
      Resource r = model.createResource( node.getValue() );
      return evaluate( r );
    }
    else if (node.getType().equals( SecNode.Type.Anonymous)) {
      Resource r = model.getRDFNode( NodeFactory.createAnon( new AnonId( node.getValue()) ) ).asResource();
      return evaluate( r );
    }
    else
    {
      return true;
View Full Code Here

    {
        // Is it a bNode label? i.e. <_:xyz>
        if ( isBNodeIRI(iri) )
        {
            String s = iri.substring(bNodeLabelStart.length()) ;
            Node n = NodeFactory.createAnon(new AnonId(s)) ;
            return n ;
        }
        return NodeFactory.createURI(iri) ;
    }
View Full Code Here

                        if ( isTag(tag, XMLResults.dfBNode) ) {
                            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

          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

    public Node asNode(PrefixMap pmap)
    {
        switch(tokenType)
        {
            // Assumes that bnode labels have been sorted out already.
            case BNODE : return NodeFactory.createAnon(new AnonId(tokenImage)) ;
            case IRI :
                // RiotLib.createIRIorBNode(tokenImage) includes processing <_:label>
                return NodeFactory.createURI(tokenImage) ;
            case PREFIXED_NAME :
                if ( pmap == null )
View Full Code Here

   
    @Test
    public void bindingStream_61()
    {
        BindingMap b = BindingFactory.create() ;
        Node bn = NodeFactory.createAnon(new AnonId("unusual")) ;
        b.add(Var.alloc("v"), bn) ;
        testWriteRead(b) ;
    }
View Full Code Here

    {
        // Is it a bNode label? i.e. <_:xyz>
        if ( isBNodeIRI(iri) )
        {
            String s = iri.substring(bNodeLabelStart.length()) ;
            Node n = NodeFactory.createAnon(new AnonId(s)) ;
            return n ;
        }
        return NodeFactory.createURI(iri) ;
    }
View Full Code Here

                    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 = NodeFactory.createAnon(new AnonId(NodeFmtLib.decodeBNodeLabel(token.getImage()))) ;
                    else
                        n = profile.create(null, token) ;
                    binding.add(v, n) ;
                }
                i++ ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.AnonId

Copyright © 2018 www.massapicom. 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.