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

Examples of com.hp.hpl.jena.sparql.engine.binding.Binding


    {
        if ( finished )
            throw new NoSuchElementException("End of XML Results") ;
        if ( ! hasNext() )
            throw new NoSuchElementException("End of XML Results") ;
        Binding r = binding ;
        row++ ;
        binding = null ;
        return r ;
    }
View Full Code Here


    }
   
    @Override
    public QuerySolution nextSolution()
    {
        Binding r = nextBinding() ;
        ResultBinding currentEnv = new ResultBinding(model, r) ;
        return currentEnv ;
    }
View Full Code Here

    private ResultSetRewindable convertToStrings(ResultSetRewindable resultsActual)
    {
        List<Binding> bindings = new ArrayList<Binding>()  ;
        while(resultsActual.hasNext())
        {
            Binding b = resultsActual.nextBinding() ;
            BindingMap b2 = BindingFactory.create() ;
           
            for ( String vn : resultsActual.getResultVars() )
            {
                Var v = Var.alloc(vn) ;
                Node n = b.get(v) ;
                String s ;
                if ( n == null )
                    s = "" ;
                else if ( n.isBlank() )
                    s = "_:"+n.getBlankNodeLabel() ;
View Full Code Here

        List<Binding> x = new ArrayList<Binding>() ;
        Set<Binding> seen = new HashSet<Binding>() ;
       
        for ( ; results.hasNext() ; )
        {
            Binding b = results.nextBinding() ;
            if ( seen.contains(b) )
                continue ;
            seen.add(b) ;
            x.add(b) ;
        }
View Full Code Here

        ResultSet inner = new ResultSetMem(make("x", first), make("x", second));
        ResultSetPeekable rs = ResultSetFactory.makePeekable(inner);
        assertTrue(rs.hasNext());
       
        // Peek and check row is as expected
        Binding peeked = rs.peekBinding();
        assertNotNull(peeked);
        assertTrue(first.equals(peeked.get(x)));
       
        // Check first row is as expected
        Binding next = rs.nextBinding();
        assertNotNull(next);
        assertTrue(first.equals(next.get(x)));
       
        // Repeat for second row
        peeked = rs.peekBinding();
        assertNotNull(peeked);
        assertTrue(second.equals(peeked.get(x)));
        next = rs.nextBinding();
        assertNotNull(next);
        assertTrue(second.equals(next.get(x)));
    }
View Full Code Here

        Query q = QueryFactory.create(query);
       
        QueryExecution qe = QueryExecutionFactory.create(q, ModelFactory.createDefaultModel());
        ResultSet rset = qe.execSelect();
        Assert.assertTrue(rset.hasNext());
        Binding b = rset.nextBinding();
        Assert.assertFalse(rset.hasNext());
        qe.close();
       
        //Validate returned value
        Node actual = b.get(Var.alloc("square"));
        Assert.assertEquals(NodeFactoryExtra.intToNode(4), actual);
    }
View Full Code Here

            qExec.setTimeout(timeout1, timeout2) ;
            // No rewrite optimizations.
            // qExec.getContext().set(ARQConstants.sysOptimizerFactory, Optimize.noOptimizationFactory) ;
            ResultSet rs = qExec.execSelect() ;
            // ... wait for first binding.
            Binding b1 = rs.nextBinding() ;
            //System.err.println(b1) ;
            // ... then a possible timeout.
            sleep(delay) ;
            if ( exceptionExpected )
                exceptionExpected(rs) ;
View Full Code Here

        QueryIterConcat qIterCat = new QueryIterConcat(execCxt) ;
       
        for ( ; iter.hasNext() ; )
        {
            Node n = iter.next() ;
            Binding b2 = BindingFactory.binding(binding, sVar, n) ;
            Iterator<Node> pathIter = PathEval.eval(graph, n, path) ;
            QueryIterator qIter = _execTriplePath(b2, pathIter, oVar, execCxt) ;
            qIterCat.add(qIter) ;
        }
        return qIterCat ;
View Full Code Here

    public void materialize(QueryIterator qIter)
    {
        while ( qIter.hasNext() )
        {
            Binding binding = qIter.nextBinding() ;
            addBinding(binding) ;
        }
        qIter.close() ;
    }
View Full Code Here

                                        ExecutionContext execContext)
    {
        List<Binding> out = new ArrayList<Binding>() ;
        for ( Iterator<Binding> iter = rows.iterator() ; iter.hasNext() ; )
        {
            Binding bindingRight = iter.next() ;
            Binding r =  Algebra.merge(bindingLeft, bindingRight) ;
            if ( r == null )
                continue ;
            // This does the conditional part. Theta-join.
            if ( conditions == null || conditions.isSatisfied(r, execContext) )
                out.add(r) ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.sparql.engine.binding.Binding

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.