Search in sources :

Example 1 with OpSlice

use of org.apache.jena.sparql.algebra.op.OpSlice in project jena by apache.

the class TransformSliceProject method transform.

@Override
public Op transform(OpSlice opSlice, Op subOp) {
    // (slice (project...)) ==> (project (slice ...))
    if (subOp instanceof OpProject) {
        OpProject p = (OpProject) subOp;
        Op sub = p.getSubOp();
        Op x = new OpSlice(sub, opSlice.getStart(), opSlice.getLength());
        x = new OpProject(x, p.getVars());
        return x;
    }
    return super.transform(opSlice, subOp);
}
Also used : Op(org.apache.jena.sparql.algebra.Op) OpProject(org.apache.jena.sparql.algebra.op.OpProject) OpSlice(org.apache.jena.sparql.algebra.op.OpSlice)

Aggregations

Op (org.apache.jena.sparql.algebra.Op)1 OpProject (org.apache.jena.sparql.algebra.op.OpProject)1 OpSlice (org.apache.jena.sparql.algebra.op.OpSlice)1