Package com.hp.hpl.jena.sparql.util.graph

Examples of com.hp.hpl.jena.sparql.util.graph.GNode


        return IterLib.oneResult(binding, varLength, n, execCxt) ;
    }
   
    private QueryIterator verify(Binding binding, Graph graph, Node listNode, Node length, ExecutionContext execCxt)
    {
        int x = GraphList.length(new GNode(graph, listNode)) ;
        int len = NodeFactory.nodeToInt(length) ;
       
        if ( x == len )
            return IterLib.result(binding, execCxt) ;
        return IterLib.noResults(execCxt) ;
View Full Code Here


    @Override
    protected QueryIterator execObjectBound(Binding binding, Var listVar, Node predicate, Node object,
                                            ExecutionContext execCxt)
    {
        // Given a concrete node, find lists it's in
        GNode gnode = new GNode(execCxt.getActiveGraph(), object) ;
        List<Node> lists = GraphList.listFromMember(gnode) ;
        return new QueryIterExtendByVar(binding, listVar, lists.iterator(), execCxt) ;
    }
View Full Code Here



    private QueryIterator members(Binding binding, Node listNode, Var itemVar, ExecutionContext execCxt)
    {
        List<Node> members = GraphList.members(new GNode(execCxt.getActiveGraph(), listNode)) ;
        return new QueryIterExtendByVar(binding, itemVar, members.iterator(), execCxt) ;
    }
View Full Code Here

        return new QueryIterExtendByVar(binding, itemVar, members.iterator(), execCxt) ;
    }
   
    private QueryIterator verify(Binding binding, Node listNode, Node member, ExecutionContext execCxt)
    {
        int count = GraphList.occurs(new GNode(execCxt.getActiveGraph(), listNode), member) ;
        return new QueryIterYieldN(count, binding) ;
    }
View Full Code Here

        Node memberNode = objectArgs.get(1) ;
       
        final Collection<Node> x ;
        if ( ! Var.isVar(memberNode) )
            // If memberNode is defined, find lists containing it.
            x = GraphList.listFromMember(new GNode(execCxt.getActiveGraph(), memberNode)) ;
        else   
            // Hard. Subject unbound, no fixed member. Find every list and use BFI.
            x = GraphList.findAllLists(execCxt.getActiveGraph()) ;
        return super.allLists(binding, x, listVar, predicate, new PropFuncArg(objectArgs, null), execCxt) ;
    }
View Full Code Here

    {
        int i = NodeFactory.nodeToInt(indexNode) ;
        if ( i < 0 )
            return IterLib.noResults(execCxt) ;

        Node n = GraphList.get(new GNode(graph, listNode), i) ;
        if ( n == null )
            return IterLib.noResults(execCxt) ;
        return IterLib.oneResult(binding, varMember, n, execCxt) ;
    }
View Full Code Here

                                               ExecutionContext execCxt)
    {
        int i = NodeFactory.nodeToInt(indexNode) ;
        if ( i < 0 )
            return IterLib.noResults(execCxt) ;
        Node n = GraphList.get(new GNode(graph, listNode), i) ;
        if ( n == null )
            return IterLib.noResults(execCxt) ;
        if ( n.equals(memberNode) )
            return IterLib.result(binding, execCxt) ;
        else
View Full Code Here

    private static QueryIterator findIndex(Graph graph, Binding binding,
                                           Node listNode, Var var, Node member,
                                           ExecutionContext execCxt)
    {
        // Find index of member.
        int i = GraphList.index(new GNode(graph, listNode), member) ;
        if ( i < 0 )
            return IterLib.noResults(execCxt) ;
        Node idx = NodeFactory.intToNode(i) ;
        return IterLib.oneResult(binding, var, idx, execCxt) ;
    }
View Full Code Here

    private static QueryIterator findIndexMember(Graph graph, Binding binding,
                                                 Node listNode, Var varIndex, Var varMember,
                                                 ExecutionContext execCxt)
    {
        // Iterate over list
        List<Node> members = GraphList.members(new GNode(graph, listNode)) ;
        List<Binding> bindings = new ArrayList<Binding>() ;
        for ( int i = 0 ; i < members.size() ; i++ )
        {
            Node idx = NodeFactory.intToNode(i) ;
            Node member = members.get(i) ;
View Full Code Here

        assertEquals(node1, GraphList.get(list22, 2)) ;
        assertEquals(node2, GraphList.get(list22, 3)) ;
    }
// --------
   
    private static GNode gnode(Node n)  { return new GNode(Factory.createDefaultGraph(), n) ; }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.util.graph.GNode

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.