Package com.hp.hpl.jena.graph

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


    private QueryIterator execEvaluatedConcrete(Binding binding, Node containerNode, Node predicate, Node member,
                                                ExecutionContext execCxt)
    {
        QueryIterator input = QueryIterSingleton.create(binding, execCxt) ;
        Graph graph = execCxt.getActiveGraph() ;
        QueryIterator qIter = new QueryIterTriplePattern(input, new Triple(containerNode, predicate, member), execCxt) ;
        return qIter ;
    }
View Full Code Here


    static private void findContainers(Collection<Node> acc, Graph graph, Node typeNode)
    {
        ExtendedIterator<Triple> iter = graph.find(Node.ANY, RDF.type.asNode(), typeNode) ;
        while(iter.hasNext())
        {
            Triple t = iter.next();
            Node containerNode = t.getSubject() ;
            acc.add(containerNode) ;
        }
    }
View Full Code Here

        Collection<Node> acc = new HashSet<Node>() ;
        // Index off the object
        ExtendedIterator<Triple> iter = graph.find(Node.ANY, Node.ANY, member) ;
        while(iter.hasNext())
        {
            Triple t = iter.next();
            Node containerNode = t.getSubject() ;   // Candidate
            if ( GraphContainerUtils.isContainer(graph, containerNode, typeNode) )
                acc.add(containerNode) ;
        }
        return acc ;
    }
View Full Code Here

        BasicPattern bp = new BasicPattern() ;
        Var var_x = Var.alloc("x") ;
        Var var_z = Var.alloc("z") ;
       
        // ---- Build expression
        bp.add(new Triple(var_x, NodeFactory.createURI(BASE+"p"), var_z)) ;
        Op op = new OpBGP(bp) ;
        //Expr expr = ExprUtils.parse("?z < 2 ") ;
        Expr expr = new E_LessThan(new ExprVar(var_z), NodeValue.makeNodeInteger(2)) ;
        op = OpFilter.filter(expr, op) ;
View Full Code Here

        for ( ; idx < numReorder ; idx++ )
        {
            int j = chooseNext(components) ;
            if ( j < 0 )
                break ;
            Triple triple = triples.get(j) ;
            indexes[idx] = j ;
            update(triple, components) ;
            components.set(j, null) ;
        }
       
View Full Code Here

        Set<GNode> x = new HashSet<GNode>() ;
       
        Iterator<Triple> iter = gnode.findable.find(Node.ANY, CAR, gnode.node) ;
        for ( ; iter.hasNext() ; )
        {
            Triple t = iter.next() ;
            x.add(new GNode(gnode, t.getSubject())) ;
        }
        NiceIterator.close(iter) ;
        return x ;        
    }
View Full Code Here

    }


    private static Node getNodeReverse(GNode gnode, Node arc)
    {
        Triple t = getTripleReverse(gnode, arc) ;
        if ( t == null )
            return null ;
        return t.getSubject() ;
    }
View Full Code Here

    private static Triple getTripleReverse(GNode gnode, Node arc)
    {
        Iterator<Triple> iter = gnode.findable.find(Node.ANY, arc, gnode.node) ;
        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

    public static void triples(GNode gnode, Collection<Triple> acc)
    {
        if ( listEnd(gnode) )
            return ;
       
        Triple t = null ;
        t = getTriple(gnode, CAR) ;
        if ( t != null )
            acc.add(t) ;
        t = getTriple(gnode, CDR) ;
        if ( t != null )
View Full Code Here

        // A list head is a node with a rdf:rest from it, not but rdf:rest to it.
        Iterator<Triple> iter = graph.find(Node.ANY, CDR, Node.ANY) ;
        try {
            for ( ; iter.hasNext() ; )
            {
                Triple t = iter.next();
                Node node = t.getSubject() ;
                if ( ! graph.contains(Node.ANY, CDR, node) )
                    acc.add(node) ;
            }
        } finally { NiceIterator.close(iter) ; }
       
       
        // Find any rdf:nil lists (which are not pure tails)
        iter = graph.find(Node.ANY, Node.ANY, NIL) ;
        try {
            for ( ; iter.hasNext() ; )
            {
                Triple t = iter.next();
                if ( ! t.getPredicate().equals(CDR) )
                {
                    acc.add(NIL) ;
                    break ;
                }
            }
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.