Package com.hp.hpl.jena.graph

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


        for ( Node elt : list )
        {
            // Cell:
            Node consCell = NodeFactory.createAnon() ;
            // Last cell to this one.
            Triple t = new Triple(n, RDF.Nodes.rest, consCell) ;
            Triple t1 = new Triple(consCell, RDF.Nodes.first, elt) ;
            n = consCell ;
            bgp.add(t) ;
            bgp.add(t1) ;
        }
        // Finish list.
        Triple t = new Triple(n, RDF.Nodes.rest, RDF.Nodes.nil) ;
        bgp.add(t) ;
        return head ;
    }
View Full Code Here


    private static Node cdr(GNode gnode)     { return getNode(gnode, CDR) ; }
    private static Node getNode(GNode gnode, Node arc)
    {
        if ( listEnd(gnode) )
            return null ;
        Triple t = getTriple(gnode, arc) ;
        if ( t == null )
            return null ;
        return t.getObject() ;
    }
View Full Code Here

            return null ;
       
        Iterator<Triple> iter = gnode.findable.find(gnode.node, arc, Node.ANY) ;
        if ( ! iter.hasNext() )
            return null ;
        Triple t = iter.next() ;
        if ( iter.hasNext() )
            Log.warn(GraphList.class, "Unusual list: two arcs with same property ("+arc+")") ;
        NiceIterator.close(iter) ;
        return t ;        
    }
View Full Code Here

        SortedMap<Integer, Node> triples = new TreeMap<Integer, Node>(order) ;
        try {
            for ( ; iter.hasNext() ; )
            {
                Triple t = iter.next() ;
                int index = getIndex(t) ;
                if ( index == NOT_FOUND )
                    continue ;
                // Insert
                triples.put(new Integer(index), t.getObject()) ;
            }
        } finally { iter.close() ; }
        return triples.values() ;
    }
View Full Code Here

        int count = 0 ;
        ExtendedIterator<Triple> iter = graph.find(container, Node.ANY, member) ;
        try {
            for ( ; iter.hasNext() ; )
            {
                Triple t = iter.next() ;
                Node p = t.getPredicate() ;
                String u = p.getURI() ;
                
                if ( membershipPattern.matcher(u).matches() ) {
                    count ++ ;
                    if ( stopEarly )
View Full Code Here

       
        Node oNode = nodeTable.getNodeForNodeId(o) ;
        if ( oNode == null )
            throw new InternalErrorException("Invalid id node for object (null node): "+fmt(s,p,o)) ;
       
        return new Triple(sNode, pNode, oNode) ;
    }
View Full Code Here

            // Prefixes for result
            insertPrefixesInto(model);
           
            while (it.hasNext())
            {
                Triple t = it.next();
                Statement stmt = ModelUtils.tripleToStatement(model, t);
                if ( stmt != null )
                    model.add(stmt);
            }
        }
View Full Code Here

       
        ClosableIterator<Triple> it = find( t );
        try {
            for ( ; it.hasNext() ; )
            {
                Triple t2 = it.next() ;
                if ( tripleContained(t, t2) )
                    return true ;
            }
        } finally { it.close(); }
        return false ;
View Full Code Here

        this.transform = transform ;
    }

    @Override public Op transform(OpTriple opTriple)
    {
        Triple t2 = NodeTransformLib.transform(transform, opTriple.getTriple()) ;
        if ( t2 == opTriple.getTriple())
            return super.transform(opTriple) ;
        return new OpTriple(t2) ;
    }
View Full Code Here

        if ( path != null )
            tp2 = new TriplePath(s1, path, o1) ;
        else
        {
            Triple t = new Triple(s1, tp.getPredicate(), o1) ;
            tp2 = new TriplePath(t) ;
        }
        return new OpPath(tp2) ;
    }
View Full Code Here

TOP

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

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.