Search in sources :

Example 1 with OpLeftJoin

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);
}
Also used : Query(org.apache.jena.query.Query) OpLeftJoin(org.apache.jena.sparql.algebra.op.OpLeftJoin)

Aggregations

Query (org.apache.jena.query.Query)1 OpLeftJoin (org.apache.jena.sparql.algebra.op.OpLeftJoin)1