> I am still trying to narrow down what has changed

It may be JENA-1813 - being about optimziation, the details of the real case probably matter. Let us know what you discover.

JENA-1813 fixed a specific problem caused by the BIND inside the GRAPH ("AS ?dummy" - not the outer one). If the inside is a different pattern it seems optimize properly if I understand the details. Maybe some small rewrite will work in the real case.

There is a follow-up (open) JENA-1815 as well.

Question: was this change intentional and is this behavior going to stay in Jena? If it does stay, how can I switch it off?

The first algebra expression below is the translation of the query and what is executing now some optimization doesn't get applied. It is the right answers.

    Andy

On 29/01/2020 05:08, Holger Knublauch wrote:
Hi,

on a branch of our product we have upgraded to jena 3.14 (due to the Thrift issue). Since then various SPARQL queries have stopped working. Of particular concern appears to be the evaluation of GRAPH ?graph clauses where ?graph is determined by a BIND. I am still trying to narrow down what has changed but suspect it's due to

https://issues.apache.org/jira/browse/JENA-1813

Here is an example query - a simplified version derived from a query in the product:

SELECT *
WHERE {
     BIND(<http://topbraid.org/teamwork#teamGraph>($this) AS ?teamGraph)
     GRAPH ?teamGraph {
         BIND (42 AS ?dummy)
     }
}

which is executed with $this prebound to a graph resource (e.g. <urn:x-evn-master:geo>). In 3.14 this seems to produce the following algebra:

(join
   (extend ((?teamGraph (<http://topbraid.org/teamwork#teamGraph> ?this)))
     (table unit))
   (graph ?teamGraph
     (extend ((?dummy 42))
       (table unit))))

while in 3.13.1 it produces

(sequence
   (extend ((?teamGraph (teamwork:teamGraph ?this)))
     (table unit))
   (graph ?teamGraph
     (extend ((?dummy 42))
       (table unit))))

As a result, the new version enters the GRAPH ?teamGraph with unbound ?teamGraph and thus iterates over all graphs which is not working for our platform:

If my observations so far are correct then this change to Jena would have quite deep consequences and break not just our own queries but also those written by customers. We will likely have to roll back to a previous Jena version for the upcoming release of our product.

Question: was this change intentional and is this behavior going to stay in Jena? If it does stay, how can I switch it off?

Thanks
Holger


Reply via email to