[
https://issues.apache.org/jira/browse/JENA-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17076224#comment-17076224
]
Andy Seaborne commented on JENA-1877:
-------------------------------------
The spec says:
18.2.4.4 SELECT Expressions
[https://www.w3.org/TR/sparql11-query/#sparqlSelectExpressions]
{noformat}
For each pair (var, expr) in E
X := Extend(X, var, expr)
End
{noformat}
which causes the nesting of the {{(extend)}}:
{noformat}
(extend ((?b2 (bnode ?s2)))
(extend ((?b1 (bnode ?s1)))
...
{noformat}
and each {{(extend)}} produces a new one solution mapping, and it is that that
is the root problem here - it is not the row that is the final solution (that
was the intended design but WG time pressure etc etc):
[https://www.w3.org/TR/sparql11-query/#defn_extend]
{noformat}
Extend(μ, var, expr) = μ ∪ { (var,value) | var not in dom(μ) and value =
expr(μ) }
{noformat}
Solution mappings (the "μ") are not modified in-place in the definitions of
evaluation.
The fact the tests are wrong is because they were produced using Jena. The
error should have been caught but the end of the WG is when there is a hard
deadline, much to do and few people.
> Wrong results for non-optimized query
> -------------------------------------
>
> Key: JENA-1877
> URL: https://issues.apache.org/jira/browse/JENA-1877
> Project: Apache Jena
> Issue Type: Bug
> Components: ARQ
> Affects Versions: Jena 3.14.0
> Reporter: Jeremy Coulon
> Priority: Major
> Attachments: bnode01.rq, data.ttl
>
>
> I noticed that the attached query gives correct results with:
> {noformat}
> ./bin/arq --data=data.ttl --query=bnode01.rq --explain --optimize=on
> {noformat}
> while it gives wrong results with:
> {noformat}
> ./bin/arq --data=data.ttl --query=bnode01.rq --explain
> --optimize=off{noformat}
> Without optimization, ARQ algebra has 2 different 'extend' op with
> 'bnode(?s)' expression.
> With optimization, ARQ algebra merges these ops into a single op 'extend'.
>
> I tried debugging and I think that 'E_BNode.evalSpecial()' takes the same
> 'binding' object for each call in optimized mode but different 'binding'
> objects for non-optimized mode. This function relies on reference-equality.
>
> [^data.ttl]
> [^bnode01.rq]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)