use of org.apache.jena.sparql.algebra.op.OpLeftJoin in project jena by apache.
the class TestClassify method classifyLJ.
/**
* Test left join classification
* @param pattern WHERE clause for the query as a string
* @param expected Whether the join should be classified as linear
*/
private void classifyLJ(String pattern, boolean expected) {
String qs1 = "PREFIX : <http://example/>\n";
String qs = qs1 + "SELECT * " + pattern;
Query query = QueryFactory.create(qs, Syntax.syntaxARQ);
Op op = Algebra.compile(query.getQueryPattern());
if (!(op instanceof OpLeftJoin))
fail("Not a leftjoin: " + pattern);
boolean nonLinear = LeftJoinClassifier.isLinear((OpLeftJoin) op);
assertEquals("LeftJoin: " + pattern, expected, nonLinear);
}
Aggregations