Package com.hp.hpl.jena.graph

Examples of com.hp.hpl.jena.graph.Node


      log.debug("instanceof BlankNode");
      assert o instanceof AbstractBlankNodeImpl : "expected a BlankNodeImpl and found a "
              + o.getClass();
      AnonId anonId = new AnonId(((AbstractBlankNodeImpl)o).getUnderlyingBlankNode()
              .toString());
      Node jenaNode = NodeFactory.createAnon(anonId);
      return jenaNode;
    }
   
    if(o instanceof Variable) {
      // variable
View Full Code Here


      log.debug("instanceof BlankNode");
      assert o instanceof AbstractBlankNodeImpl : "expected a BlankNodeImpl and found a "
              + o.getClass();
      AnonId anonId = new AnonId(((AbstractBlankNodeImpl)o).getUnderlyingBlankNode()
              .toString());
      Node jenaNode = NodeFactory.createAnon(anonId);
      return jenaNode;
    }
   
    if(o instanceof Variable) {
      // variable
View Full Code Here

       
        // Turtle: TriplesSameSubject -> TriplesNode PropertyList?
        // TriG:   (blankNodePropertyList | collection) predicateObjectList? '.'
        //         labelOrSubject (wrappedGraph | predicateObjectList '.')
        if ( peekTriplesNodeCompound() ) {
            Node n = triplesNodeCompound() ;

            // May be followed by:
            // A predicateObject list
            // A DOT or EOF.
            // But if a DOT or EOF, then it can't have been () or [].
View Full Code Here

    }

    // Must be at least one triple.
    protected final void triples() {
        // Looking at a node.
        Node subject = node() ;
        if ( subject == null )
            exception(peekToken(), "Not recognized: expected node: %s", peekToken().text()) ;

        nextToken() ;
        predicateObjectList(subject) ;
View Full Code Here

            predicateObjectItem(subject) ;
        }
    }

    protected final void predicateObjectItem(Node subject) {
        Node predicate = predicate() ;
        nextToken() ;
        objectList(subject, predicate) ;
    }
View Full Code Here

            if ( !strict && image.equals(KW_LOG_IMPLIES) )
                return NodeConst.nodeRDFType ;
            exception(tErr, "Unrecognized: " + image) ;
        }

        Node n = node() ;
        if ( n == null || !n.isURI() )
            exception(t, "Expected IRI for predicate: got: %s", t) ;
        return n ;
    }
View Full Code Here

    }

    /** Maybe "null" for not-a-node. */
    protected final Node node() {
        // Token to Node
        Node n = tokenAsNode(peekToken()) ;
        if ( n == null )
            return null ;
        return n ;
    }
View Full Code Here

        return n ;
    }

    protected final void objectList(Node subject, Node predicate) {
        for (;;) {
            Node object = triplesNode() ;
            emitTriple(subject, predicate, object) ;

            if ( !moreTokens() )
                break ;
            if ( !lookingAt(COMMA) )
View Full Code Here

    // A structure of triples that itself generates a node.
    // Special checks for [] and ().

    protected final Node triplesNode() {
        if ( lookingAt(NODE) ) {
            Node n = node() ;
            nextToken() ;
            return n ;
        }

        // Special words.
View Full Code Here

        return null ;
    }

    protected final Node triplesBlankNode() {
        Token t = nextToken() ; // Skip [
        Node subject = profile.createBlankNode(currentGraph, t.getLine(), t.getColumn()) ;
        triplesBlankNode(subject) ;
        return subject ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.Node

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.