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

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


        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 = NodeFactoryExtra.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 = NodeFactoryExtra.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 = NodeFactoryExtra.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<>() ;
        for ( int i = 0 ; i < members.size() ; i++ )
        {
            Node idx = NodeFactoryExtra.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

    {
        Model m = ModelFactory.createDefaultModel() ;
        m.read(new StringReader(str), null, "TTL") ;
        Graph graph = m.getGraph() ;
        Triple t = graph.find(r, p, Node.ANY).next() ;
        return new GNode(graph, t.getObject()) ;
    }
View Full Code Here

                                                         Triple pfTriple,
                                                         BasicPattern triples)
    {
        List<Triple> listTriples = new ArrayList<>() ;

        GNode sGNode = new GNode(triples, pfTriple.getSubject()) ;
        GNode oGNode = new GNode(triples, pfTriple.getObject()) ;
        List<Node> sList = null ;
        List<Node> oList = null ;
       
        if ( GraphList.isListNode(sGNode) )
        {
View Full Code Here

                                                         Triple pfTriple,
                                                         BasicPattern triples)
    {
        List<Triple> listTriples = new ArrayList<Triple>() ;

        GNode sGNode = new GNode(triples, pfTriple.getSubject()) ;
        GNode oGNode = new GNode(triples, pfTriple.getObject()) ;
        List<Node> sList = null ;
        List<Node> oList = null ;
       
        if ( GraphList.isListNode(sGNode) )
        {
View Full Code Here

    private QueryIterator length(Binding binding, Graph graph,
                                 Node listNode, Var varLength,
                                 ExecutionContext execCxt)
    {
        int x = GraphList.length(new GNode(graph, listNode)) ;
        if ( x < 0 )
            return IterLib.noResults(execCxt) ;
        Node n = NodeFactory.intToNode(x) ;
        return IterLib.oneResult(binding, varLength, n, execCxt) ;
    }
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.