You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jena.apache.org by "Aklakan (via GitHub)" <gi...@apache.org> on 2024/12/17 23:13:21 UTC
[I] LATERAL: Unexpectedly unbound variable. [jena]
Aklakan opened a new issue, #2896:
URL: https://github.com/apache/jena/issues/2896
### Version
5.3.0-SNAPSHOT
### What happened?
I am not sure whether this is according to [SEP7](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0007/sep-0007.md) or a bug in Jena:
I am trying to inject a value using lateral into a BIND in a subquery. The following works:
```sparql
SELECT * {
BIND('x' AS ?xIn)
LATERAL {
{ SELECT * { BIND(?xIn AS ?xOut) } }
}
}
```
The result is:
| ?xIn | ?xOut |
|------|-------|
| x | x |
However, if in the lateral block there is a Join, then it breaks:
```sparql
SELECT * {
BIND('x' AS ?xIn)
LATERAL {
BIND("foo" AS ?foo)
{ SELECT * { BIND(?xIn AS ?xOut) } }
}
}
```
In the result, `?xOut` is (for me) unexpectedly unbound.
| ?xIn | ?foo | ?xOut |
|------|------|-------|
| x | foo | |
I think this is a bug in Jena (but perhaps I am misunderstanding something about the scoping rules).
### Relevant output and stacktrace
_No response_
### Are you interested in making a pull request?
Maybe
--
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: issues-unsubscribe@jena.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
Re: [I] LATERAL: Unexpectedly unbound variable. [jena]
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #2896:
URL: https://github.com/apache/jena/issues/2896#issuecomment-2550734947
This could be related to a recent report about substitution interacting with `SELECT *` that I've been investigating in a non-`LATERAL` context.
--
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: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
Re: [I] LATERAL: Unexpectedly unbound variable. [jena]
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs closed issue #2896: LATERAL: Unexpectedly unbound variable.
URL: https://github.com/apache/jena/issues/2896
--
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: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
Re: [I] LATERAL: Unexpectedly unbound variable. [jena]
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on issue #2896:
URL: https://github.com/apache/jena/issues/2896#issuecomment-2552276985
This is a bug in the algorithm of SEP-0007. The algebra has a `(table unit)` inside a strict `join`.
The `(table unit)` needs the binding injected but the algorithm does not consider that. Actually any `(table)` i.e. `VALUES`.
```lisp
(lateral
(extend ((?xIn "x"))
(table unit))
(join
(extend ((?foo "foo"))
(table unit))
(project (?xIn ?xOut)
(extend ((?xOut ?xIn))
(table unit)))))
```
Elsewhere (the `SimpleEvcaluator` "reference" query evaluator) does exploit a #2799 related-execution to come up with the right answer for the wrong reasons.
Thank you for the report!
--
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: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org