Search in sources :

Example 11 with Table

use of org.apache.jena.sparql.algebra.Table in project jena by apache.

the class QueryEngineRef method eval.

@Override
public QueryIterator eval(Op op, DatasetGraph dsg, Binding binding, Context context) {
    if (binding.vars().hasNext())
        op = Substitute.substitute(op, binding);
    ExecutionContext execCxt = new ExecutionContext(context, dsg.getDefaultGraph(), dsg, QC.getFactory(context));
    Evaluator eval = EvaluatorFactory.create(execCxt);
    Table table = Eval.eval(eval, op);
    QueryIterator qIter = table.iterator(execCxt);
    return QueryIteratorCheck.check(qIter, execCxt);
}
Also used : Table(org.apache.jena.sparql.algebra.Table)

Example 12 with Table

use of org.apache.jena.sparql.algebra.Table in project jena by apache.

the class EvaluatorDispatch method visit.

@Override
public void visit(OpDisjunction opDisjunction) {
    // Evaluation is as a concatentation of alternatives 
    Table table = TableFactory.createEmpty();
    for (Iterator<Op> iter = opDisjunction.iterator(); iter.hasNext(); ) {
        Op op = iter.next();
        Table eltTable = eval(op);
        table = evaluator.union(table, eltTable);
    }
    push(table);
}
Also used : Op(org.apache.jena.sparql.algebra.Op) Table(org.apache.jena.sparql.algebra.Table)

Example 13 with Table

use of org.apache.jena.sparql.algebra.Table in project jena by apache.

the class EvaluatorDispatch method visit.

@Override
public void visit(OpDistinct opDistinct) {
    Table table = eval(opDistinct.getSubOp());
    table = evaluator.distinct(table);
    push(table);
}
Also used : Table(org.apache.jena.sparql.algebra.Table)

Example 14 with Table

use of org.apache.jena.sparql.algebra.Table in project jena by apache.

the class EvaluatorDispatch method visit.

@Override
public void visit(OpMinus opMinus) {
    Table left = eval(opMinus.getLeft());
    Table right = eval(opMinus.getRight());
    Table table = evaluator.minus(left, right);
    push(table);
}
Also used : Table(org.apache.jena.sparql.algebra.Table)

Example 15 with Table

use of org.apache.jena.sparql.algebra.Table in project jena by apache.

the class EvaluatorDispatch method visit.

@Override
public void visit(OpPath opPath) {
    Table table = evaluator.pathPattern(opPath.getTriplePath());
    push(table);
}
Also used : Table(org.apache.jena.sparql.algebra.Table)

Aggregations

Table (org.apache.jena.sparql.algebra.Table)37 Var (org.apache.jena.sparql.core.Var)4 QueryIterator (org.apache.jena.sparql.engine.QueryIterator)4 Binding (org.apache.jena.sparql.engine.binding.Binding)4 Node (org.apache.jena.graph.Node)3 Op (org.apache.jena.sparql.algebra.Op)3 Graph (org.apache.jena.graph.Graph)2 ARQInternalErrorException (org.apache.jena.sparql.ARQInternalErrorException)2 OpGraph (org.apache.jena.sparql.algebra.op.OpGraph)2 TableEmpty (org.apache.jena.sparql.algebra.table.TableEmpty)2 BasicPattern (org.apache.jena.sparql.core.BasicPattern)2 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)2 ExecutionContext (org.apache.jena.sparql.engine.ExecutionContext)2 Test (org.junit.Test)2 InternalErrorException (org.apache.jena.atlas.lib.InternalErrorException)1 Triple (org.apache.jena.graph.Triple)1 OpBGP (org.apache.jena.sparql.algebra.op.OpBGP)1 OpTable (org.apache.jena.sparql.algebra.op.OpTable)1 TableN (org.apache.jena.sparql.algebra.table.TableN)1 QueryIterConcat (org.apache.jena.sparql.engine.iterator.QueryIterConcat)1