Search in sources :

Example 6 with Binding

use of org.apache.jena.sparql.engine.binding.Binding in project jena by apache.

the class AbstractIterHashJoin method moveToNextBinding.

@Override
protected Binding moveToNextBinding() {
    Binding r = slot;
    slot = null;
    return r;
}
Also used : Binding(org.apache.jena.sparql.engine.binding.Binding)

Example 7 with Binding

use of org.apache.jena.sparql.engine.binding.Binding in project jena by apache.

the class QueryIterNestedLoopLeftJoin method moveToNextBinding.

@Override
protected Binding moveToNextBinding() {
    Binding r = slot;
    slot = null;
    return r;
}
Also used : Binding(org.apache.jena.sparql.engine.binding.Binding)

Example 8 with Binding

use of org.apache.jena.sparql.engine.binding.Binding in project jena by apache.

the class QueryIterNestedLoopLeftJoin method moveToNextBindingOrNull.

protected Binding moveToNextBindingOrNull() {
    if (isFinished())
        return null;
    for (; ; ) {
        // For rows from the left
        if (rowLeft == null) {
            if (left.hasNext()) {
                rowLeft = left.next();
                foundMatch = false;
                s_countLHS++;
                right = rightRows.iterator();
            } else
                return null;
        }
        while (right.hasNext()) {
            Binding rowRight = right.next();
            Binding r = Algebra.merge(rowLeft, rowRight);
            if (r != null && applyConditions(r)) {
                s_countResults++;
                foundMatch = true;
                return r;
            }
        }
        if (!foundMatch) {
            s_countResults++;
            Binding r = rowLeft;
            rowLeft = null;
            return r;
        }
        rowLeft = null;
    }
}
Also used : Binding(org.apache.jena.sparql.engine.binding.Binding)

Example 9 with Binding

use of org.apache.jena.sparql.engine.binding.Binding in project jena by apache.

the class ListBase method allLists.

protected QueryIterator allLists(Binding binding, Collection<Node> x, Var listVar, Node predicate, PropFuncArg argObject, ExecutionContext execCxt) {
    // BFI: Find all lists; work hard.
    QueryIterConcat qIter = new QueryIterConcat(execCxt);
    for (Node n : x) {
        Binding b = BindingFactory.binding(binding, listVar, n);
        QueryIterator q = execOneList(b, n, predicate, argObject, execCxt);
        qIter.add(q);
    }
    return qIter;
}
Also used : QueryIterConcat(org.apache.jena.sparql.engine.iterator.QueryIterConcat) Binding(org.apache.jena.sparql.engine.binding.Binding) QueryIterator(org.apache.jena.sparql.engine.QueryIterator) Node(org.apache.jena.graph.Node)

Example 10 with Binding

use of org.apache.jena.sparql.engine.binding.Binding in project jena by apache.

the class CSVInputIterator method moveToNextBinding.

@Override
protected Binding moveToNextBinding() {
    if (!hasNext())
        throw new NoSuchElementException();
    Binding b = this.binding;
    this.binding = null;
    return b;
}
Also used : Binding(org.apache.jena.sparql.engine.binding.Binding) NoSuchElementException(java.util.NoSuchElementException)

Aggregations

Binding (org.apache.jena.sparql.engine.binding.Binding)132 Node (org.apache.jena.graph.Node)39 ArrayList (java.util.ArrayList)36 Var (org.apache.jena.sparql.core.Var)33 QueryIterator (org.apache.jena.sparql.engine.QueryIterator)27 Test (org.junit.Test)21 QueryIterPlainWrapper (org.apache.jena.sparql.engine.iterator.QueryIterPlainWrapper)16 BindingMap (org.apache.jena.sparql.engine.binding.BindingMap)10 BindingComparator (org.apache.jena.sparql.engine.binding.BindingComparator)8 BuilderBinding (org.apache.jena.sparql.sse.builders.BuilderBinding)8 NoSuchElementException (java.util.NoSuchElementException)7 Triple (org.apache.jena.graph.Triple)7 ResultSetStream (org.apache.jena.sparql.engine.ResultSetStream)7 ARQInternalErrorException (org.apache.jena.sparql.ARQInternalErrorException)5 Op (org.apache.jena.sparql.algebra.Op)5 BasicPattern (org.apache.jena.sparql.core.BasicPattern)5 ResultSet (org.apache.jena.query.ResultSet)4 SortCondition (org.apache.jena.query.SortCondition)4 TableN (org.apache.jena.sparql.algebra.table.TableN)4 File (java.io.File)3