We're updating the issue view to help you get more done. 

Incorrect variable bindings with subqueries

Description

Hi Jeen,

I could reproduce the behaviour for https://openrdf.atlassian.net/browse/SES-2099 with a much simpler query; you'll see that each result binds ct01 with a different bnode.

1 2 3 4 5 6 7 8 SELECT * WHERE { BIND (bnode() as ?ct01) { SELECT ?s WHERE { ?s ?p ?o . } LIMIT 10 } }

If I'm not mistaken, the query should be equivalent with this one which actually works as expected :

1 2 3 4 5 SELECT * WHERE { BIND (bnode() as ?ct01) ?s ?p ?o . } LIMIT 10

meaning the algebra should first create a SingetonSet then extend it with the BIND and only then do the join so the variable ct01 should be bound to the same bnode for each result of the subquery.

So it seems that evaluating the subquery first (which is indeed required by the recommendation) does not respect the evaluation or join orders of the preceding graph patterns.

Environment

None

Status

Assignee

JeenB

Reporter

Max

Labels

Components

Affects versions

2.8.3

Priority

Critical