Search in sources :

Example 1 with OpExtend

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

the class TransformExtendCombine method transform.

@Override
public Op transform(OpExtend opExtend, Op subOp) {
    if (subOp instanceof OpExtend) {
        // The case of (extend (?x e1) (extend (?x e2) ...op...))
        // is actually illegal in SPARQL.  ?x must be a fresh variable.
        OpExtend x = (OpExtend) subOp;
        VarExprList outerVarExprList = opExtend.getVarExprList();
        // Copy
        VarExprList innerVarExprList = new VarExprList(x.getVarExprList());
        Op r = OpExtend.extend(x.getSubOp(), innerVarExprList);
        // This contains an "if already (extend)" test.
        r = OpExtend.extend(r, outerVarExprList);
        return r;
    }
    return super.transform(opExtend, subOp);
}
Also used : Op(org.apache.jena.sparql.algebra.Op) OpExtend(org.apache.jena.sparql.algebra.op.OpExtend) VarExprList(org.apache.jena.sparql.core.VarExprList)

Aggregations

Op (org.apache.jena.sparql.algebra.Op)1 OpExtend (org.apache.jena.sparql.algebra.op.OpExtend)1 VarExprList (org.apache.jena.sparql.core.VarExprList)1