Search in sources :

Example 6 with Transform

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

the class TestTransformTopN method testQuery.

// ---- From query to transfomed algebra.
private void testQuery(String input, String output) {
    Transform transform = new TransformTopN();
    testQuery(input, transform, output);
}
Also used : AbstractTestTransform(org.apache.jena.sparql.algebra.optimize.AbstractTestTransform) Transform(org.apache.jena.sparql.algebra.Transform) TransformTopN(org.apache.jena.sparql.algebra.optimize.TransformTopN)

Example 7 with Transform

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

the class NodeTransformLib method transform.

/** Do a node->node conversion of an Op - return original BGP for "no change" */
public static Op transform(NodeTransform nodeTransform, Op op) {
    Transform opTransform = new NodeTransformOp(nodeTransform);
    ExprTransform exprTransform = new NodeTransformExpr(nodeTransform);
    return Transformer.transform(opTransform, exprTransform, op);
}
Also used : Transform(org.apache.jena.sparql.algebra.Transform) ExprTransform(org.apache.jena.sparql.expr.ExprTransform) ExprTransform(org.apache.jena.sparql.expr.ExprTransform)

Example 8 with Transform

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

the class MyQueryEngine method eval.

@Override
public QueryIterator eval(Op op, DatasetGraph dsg, Binding initial, Context context) {
    // Extension point: access possible to all the parameters for execution.
    // Be careful to deal with initial bindings.
    Transform transform = new MyTransform();
    op = Transformer.transform(transform, op);
    return super.eval(op, dsg, initial, context);
}
Also used : Transform(org.apache.jena.sparql.algebra.Transform)

Aggregations

Transform (org.apache.jena.sparql.algebra.Transform)8 AbstractTestTransform (org.apache.jena.sparql.algebra.optimize.AbstractTestTransform)2 TransformTopN (org.apache.jena.sparql.algebra.optimize.TransformTopN)2 Op (org.apache.jena.sparql.algebra.Op)1 TransformCopy (org.apache.jena.sparql.algebra.TransformCopy)1 OpTable (org.apache.jena.sparql.algebra.op.OpTable)1 TransformPropertyFunction (org.apache.jena.sparql.algebra.optimize.TransformPropertyFunction)1 ExprTransform (org.apache.jena.sparql.expr.ExprTransform)1 Test (org.junit.Test)1