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

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


        long yieldCount = 0 ;
        boolean resetDone = false ;
        @Override
        protected Binding moveToNextBinding()
        {
            Binding b = super.moveToNextBinding() ;
            yieldCount++ ;
           
            if ( ! resetDone )
            {
                // Sync on calls of .abort.
View Full Code Here


        List<Var> vars = Var.varList(results.getResultVars()) ;
       
        BindingOutputStream bout = new BindingOutputStream(out, vars) ;
        for ( ; results.hasNext() ; )
        {
            Binding b = BindingUtils.asBinding(results.next()) ;
            bout.write(b) ;
        }
        bout.flush() ;
    }
View Full Code Here

    public Binding nextBinding()
    {
        if (queryExecutionIter == null) throw new NoSuchElementException(this.getClass() + ".next") ;

        try {
            Binding binding = queryExecutionIter.next() ;
            if (binding != null) rowNumber++ ;
            return binding ;
        } catch (NoSuchElementException ex) {
            close() ;
            throw ex ;
View Full Code Here

        if ( queryExecutionIter == null )
//            || 
//             ( queryExecution != null && ! queryExecution.isActive() ) )
            throw new NoSuchElementException(this.getClass()+".next") ;
       
        Binding binding = nextBinding() ;
        currentQuerySolution = new ResultBinding(model, binding) ;
        return currentQuerySolution ;
    }
View Full Code Here

        this.value = value ;
    }

    @Override
    public Iterator<Binding> rows() {
        Binding b = BindingFactory.binding(var, value) ;
        return Iter.singleton(b) ;
    }
View Full Code Here

    }

    @Override
    public QueryIterator iterator(ExecutionContext execCxt) {
        // Root binding?
        Binding binding = BindingFactory.binding(var, value) ;
        QueryIterator qIter = QueryIterSingleton.create(binding, var, value, execCxt) ;
        return qIter ;
    }
View Full Code Here

        Node other = bindingLeft.get(var) ;

        if ( other == null ) {
            // Not present - return the merge = the other binding + this
            // (var/value)
            Binding mergedBinding = BindingFactory.binding(bindingLeft, var, value) ;
            return QueryIterSingleton.create(mergedBinding, execContext) ;
        }

        if ( !other.equals(value) )
            matches = false ;
View Full Code Here

            String lc = NodeUtils.stringLiteral(localnameNode) ;
            if ( lc == null || ! lc.equals(localname) )
                return IterLib.noResults(execCxt) ;
        }
       
        Binding b2 = ( b == null ) ? binding : b ;
        return IterLib.result(b, execCxt) ;
    }
View Full Code Here

        //List<Triple> triples = new ArrayList<Triple>() ;
        List<Triple> triples = new ArrayList<Triple>() ;
       
        for (; qIter.hasNext() ; )
        {
            Binding b = qIter.nextBinding() ;
            Node sResult = s ;
            Node pResult = p ;
            Node oResult = o ;
            if ( sVar != null )
                sResult = b.get(sVar) ;
            if ( pVar != null )
                pResult = b.get(pVar) ;
            if ( oVar != null )
                oResult = b.get(oVar) ;
            Triple resultTriple = new Triple(sResult, pResult, oResult) ;
            if ( log.isDebugEnabled() )
                log.debug("  "+resultTriple) ;
            triples.add(resultTriple) ;
        }
View Full Code Here

    public static void outputPlain(IndentedWriter out, Table table, SerializationContext sCxt)
    {
        QueryIterator qIter = table.iterator(null) ;
        for ( ; qIter.hasNext(); )
        {
            Binding b = qIter.nextBinding() ;
            output(out, b, sCxt) ;
            out.println() ;
        }
        qIter.close() ;
    }
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.