use of org.apache.jena.sparql.syntax.syntaxtransform.ElementTransformCleanGroupsOfOne in project jena by apache.
the class TestFlattenSyntax method test.
private static void test(String input, String expected) {
if (expected == null)
expected = input;
String qs = gen(PRE, input);
String qsExpected = gen(PRE, expected);
Query query = QueryFactory.create(qs, Syntax.syntaxARQ);
Query query2 = QueryTransformOps.transform(query, new ElementTransformCleanGroupsOfOne());
Query queryExpected = QueryFactory.create(qsExpected, Syntax.syntaxARQ);
Op op1 = Algebra.compile(query);
Op op2 = Algebra.compile(query2);
assertEquals("Algebra different", op1, op2);
boolean modified = !query.equals(query2);
boolean expectModification = !queryExpected.equals(query);
assertEquals("Expect query modifed?", expectModification, modified);
}
Aggregations