Package com.hp.hpl.jena.sparql.engine

Examples of com.hp.hpl.jena.sparql.engine.QueryIterator


        System.out.println("--------------") ;
        System.out.print(op) ;
        System.out.println("--------------") ;

        // ---- Execute expression
        QueryIterator qIter = Algebra.exec(op, m.getGraph()) ;
       
        // -------- Either read the query iterator directly ...
        if ( false )
        {
            for ( ; qIter.hasNext() ; )
            {
                Binding b = qIter.nextBinding() ;
                Node n = b.get(var_x) ;
                System.out.println(FmtUtils.stringForNode(n)) ;
                System.out.println(b) ;
            }
            qIter.close() ;
        }
        else
        {
            // -------- Or make ResultSet from it (but not both - reading an
            //          iterator consumes the current solution)
            List<String> varNames = new ArrayList<String>() ;
            varNames.add("x") ;
            varNames.add("z") ;
            ResultSet rs = new ResultSetStream(varNames, m, qIter);
            ResultSetFormatter.out(rs) ;
            qIter.close() ;
        }
        System.exit(0) ;
    }
View Full Code Here


        Op op = Algebra.compile(query) ;
        op = Algebra.optimize(op) ;
        System.out.println(op) ;
       
        // Execute it.
        QueryIterator qIter = Algebra.exec(op, Ex1.createModel()) ;
       
        // Results
        for ( ; qIter.hasNext() ; )
        {
            Binding b = qIter.nextBinding() ;
            System.out.println(b) ;
        }
        qIter.close() ;
    }
View Full Code Here

            return other.execute(pattern, input, execCxt) ;
       
        System.err.println("MyStageGenerator.compile:: triple patterns = "+pattern.size()) ;

        // Stream the triple matches together, one triple matcher at a time.
        QueryIterator qIter = input ;
        for (Triple triple : pattern.getList())
            qIter = new QueryIterTriplePattern(qIter, triple, execCxt) ;
        return qIter ;
    }
View Full Code Here

            // Put in a VALUES
            // This may be related to the grpup of the overall query.
           
            ElementData el = new ElementData() ;
            el.getVars().addAll(opTable.getTable().getVars()) ;
            QueryIterator qIter = opTable.getTable().iterator(null) ;
            while(qIter.hasNext())
                el.getRows().add(qIter.next()) ;
            qIter.close() ;
            currentGroup().addElement(el) ;
        }
View Full Code Here

       
//        List<Node> x = Iter.toList(graphNameNodes) ;
//        graphNameNodes = x.iterator() ;
//        System.out.println(x) ;
       
        QueryIterator current = new QueryIterGraphInner(
                                               outerBinding, graphNameNodes,
                                               opGraph, getExecContext()) ;
        return current ;
    }
View Full Code Here

        {
            if ( ! graphNames.hasNext() )
                return null ;
            Node gn = graphNames.next() ;

            QueryIterator qIter = buildIterator(parentBinding, gn, opGraph, getExecContext()) ;
            if ( qIter == null )
                // Know to be nothing (e.g. graph does not exist).
                return null ;
           
            if ( Var.isVar(opGraph.getNode()) )
View Full Code Here

            if ( g == null )
                return null ;
                //throw new ARQInternalErrorException(".containsGraph was true but .getGraph is null") ;
           
            ExecutionContext cxt2 = new ExecutionContext(outerCxt, g) ;
            QueryIterator subInput = QueryIterSingleton.create(binding, cxt2) ;
            return QC.execute(op, subInput, cxt2) ;
        }
View Full Code Here

            Iterator<QueryIterator> iterAll = execContext.listAllIterators() ;

            if ( iterAll != null )
                while(iterAll.hasNext())
                {
                    QueryIterator qIter = iterAll.next() ;
                    warn(qIter, "Iterator: ") ;
                }
        }

        Iterator<QueryIterator> iterOpen = execContext.listOpenIterators() ;
        while(iterOpen.hasNext())
        {
            QueryIterator qIterOpen = iterOpen.next() ;
            warn(qIterOpen, "Open iterator: ") ;
            iterOpen.remove() ;
        }
    
    }
View Full Code Here

   
    // Public interface is via QC.execute.
    static QueryIterator execute(Op op, QueryIterator qIter, ExecutionContext execCxt)
    {
        OpExecutor exec = createOpExecutor(execCxt) ;
        QueryIterator q = exec.executeOp(op, qIter) ;
        return q ;
    }
View Full Code Here

    // ---- The recursive step.
   
    public QueryIterator executeOp(Op op, QueryIterator input)
    {
        level++ ;
        QueryIterator qIter = dispatcher.exec(op, input) ;
        // Intentionally not try/finally so exceptions leave some evidence around.
        level-- ;
        return qIter ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.engine.QueryIterator

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.