Aklakan commented on issue #3463:
URL: https://github.com/apache/jena/issues/3463#issuecomment-3346021186
I recall that there were databases that would incorrectly inject bindings
into unions. You can check with this query:
```sparql
SELECT * {
BIND("foo" AS ?foo)
{ BIND(?foo AS ?bar) } UNION { BIND(?foo AS ?baz) }
}
```
The expected result is this:
```
---------------------
| foo | bar | baz |
=====================
| "foo" | | |
| "foo" | | |
---------------------
```
Note: With Jena and Oxigraph (perhaps some more stores by now?), you can use
the `LATERAL` keyword to inject bindings from from the left-hand side (lhs) to
the right-hand one before the rhs gets evaluated. Unfortunately, this is not
yet standard/portable.
```sparql
SELECT * {
BIND("foo" AS ?foo)
LATERAL {
{ BIND(?foo AS ?bar) } UNION { BIND(?foo AS ?baz) }
}
}
```
```
-------------------------
| foo | bar | baz |
=========================
| "foo" | "foo" | |
| "foo" | | "foo" |
-------------------------
```
--
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]