afs commented on issue #1615: URL: https://github.com/apache/jena/issues/1615#issuecomment-1316781838
Those two queries don't do the same thing :-) The only addition is the `?type` in `SELECT ?type (...` as you would need that if its a plain join. c.f. OxiGraph's `LATERAL(vars)`. The `GROUP BY` is orthogonal. The variable isn't called `?type` - it's called `?/type` - it will have been renamed to a safe global name to avoid it picking up the outer one. If inside another subquery it's `?//type`. c.f programming: Global variables vs function parameters. What happens if `?type` is bound in some rows of the LHS and not others? For users, copying in a standalone query fragment isn't necessary going to work for them because LATERAL can change the results. Lack of predictability limits other extensions. e.g. Named tables - results are calculated outside the LATERAL, so results are with-scoping, but put that query text inside the LATERAL (user intuition - named tables are a way to avoid repeated copies o query patterns ) and you can get different results. There isn't a perfect answer here. Making LATERAL change the deep scoping rules, and is not just the evaluation of new operator will get complicated, will affect transformations and optimizations and will have surprises. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
