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

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


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

   
    @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 (Node.createAnon(new AnonId("a"))) ; }
View Full Code Here

    @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 (Node.createAnon(new AnonId("a"))) ; }
    @Test public void nodec_blank_02()  { test (Node.createAnon(new AnonId("a:b:c-d"))) ; }
View Full Code Here

        {
            // Must be done this way.
            // In particular, bnode labels can contain ":" from Jena
            // TokenizerText does not recognize these.
            str = str.substring(2) ;
            return Node.createAnon(new AnonId(str)) ;
        }

        if ( str.startsWith("<") )
        {
            // Do directly.
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

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

        {
            // Must be done this way.
            // In particular, bnode labels can contain ":" from Jena
            // TokenizerText does not recognize these.
            str = str.substring(2) ;
            return Node.createAnon(new AnonId(str)) ;
        }

        if ( str.startsWith("<") )
        {
            // Do directly.
View Full Code Here

    {
        // 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) ;
    }
View Full Code Here

           anonymous in the model, then when they're reserialized they'll get different
           /blank/ URIs and you'll never be able to match them up.
         */

        if (makeAnonymousNodes && uri.startsWith("http://marklogic.com/semantics/blank/")) {
            AnonId id = null;
            if (anonids.containsKey(uri)) {
                id = anonids.get(uri);
            } else {
                id = new AnonId();
                anonids.put(uri, id);
            }

            return model.createResource(id);
        } else {
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.