Examples of GNode


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

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

    {
        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

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

                                               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

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

    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

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

    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 = NodeFactoryExtra.intToNode(i) ;
            Node member = members.get(i) ;
View Full Code Here

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

    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 = NodeFactoryExtra.intToNode(x) ;
        return IterLib.oneResult(binding, varLength, n, execCxt) ;
    }
View Full Code Here

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 = NodeFactoryExtra.nodeToInt(length) ;
       
        if ( x == len )
            return IterLib.result(binding, execCxt) ;
        return IterLib.noResults(execCxt) ;
View Full Code Here

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

                                                         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

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

        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

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

    {
        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
TOP
Copyright © 2018 www.massapi.com. 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.