[
https://issues.apache.org/jira/browse/JENA-1877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17074679#comment-17074679
]
Andy Seaborne commented on JENA-1877:
-------------------------------------
The intuition that the optimized version (same label) cause the same BNODE is,
unfortunately, not what the spec says. I agree it should do that - but it
doesn't.
A workaround is to test for s1 equal to 2 and act appropriately.
{noformat}
SELECT ?s1 ?s2 (BNODE(?s1) AS ?b1) (IF(?s1 = ?s2, ?b1, BNODE(?s2)) AS
?b2)
{noformat}
which should give the same answers either way round.
(Out of curiosity, how did you discover this?)
> 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)