use of org.apache.jena.sparql.algebra.Transform in project jena by apache.
the class TestTransformTopN method test.
private void test(String input, String output) {
Transform transform = new TransformTopN();
testOp(input, transform, output);
}
use of org.apache.jena.sparql.algebra.Transform in project jena by apache.
the class QueryEngineRef method modifyOp.
@Override
protected Op modifyOp(Op op) {
// Just property functions
Transform t = new TransformPropertyFunction(context);
op = Transformer.transform(t, op);
return op;
}
use of org.apache.jena.sparql.algebra.Transform in project jena by apache.
the class TestTransformFilterPlacement method test$.
public static void test$(String input, String output, boolean includeBGPs) {
Transform t_placement = new TransformFilterPlacement(includeBGPs);
Op op1 = SSE.parseOp(input);
Op op2 = Transformer.transform(t_placement, op1);
if (output == null) {
// No transformation.
Assert.assertEquals(op1, op2);
return;
}
Op op3 = SSE.parseOp(output);
if (!Objects.equals(op2, op3)) {
System.out.println("Expected:");
System.out.println(op3);
System.out.println("Got:");
System.out.println(op2);
}
Assert.assertEquals(op3, op2);
}
use of org.apache.jena.sparql.algebra.Transform in project jena by apache.
the class TestTransformFilters method nested_02.
@Test
public void nested_02() {
Transform tableChanger = new TransformCopy() {
@Override
public Op transform(OpTable opTable) {
// Always a new object
return OpTable.create(opTable.getTable());
}
};
testOp("(filter (?A) (filter (?B) (table unit)))", tableChanger, "(filter (exprlist ?B ?A) (table unit))");
}
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);
}
Aggregations