-
Notifications
You must be signed in to change notification settings - Fork 21
Description
https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0006/sep-0006.md#scope
A sub-select may have variables of the same name that are not lateral-joined to a variable of that name from the LHS.
The inner?s
in theSELECT ?label
is not the outer?s
, because theSELECT ?label
does not pass out?s
.
This is very confusing for me because here's how I think:
- the RHS is a "subroutine" that's executed in a loop
- Its inputs are the variables bound in the LHS
- Its outputs are the variables projected out in
SELECT
So it's confusing for me that to use a var as an input, I need to mention it in the "output" clause.
This comment by @frensjan #100 (comment) is in a similar vein.
I understand that by SPARQL algebra, it's not possible to equate the inner-but-not-exported ?s
to the outer ?s
.
However, is it possible to return an error or warning, because it's virtually certain that the user didn't mean to use the same var name for two different variables? SEP-0006 goes on:
There needs to be a new syntax restriction: there can be no variable ...
So I'm asking: can a similar syntax restriction be enforced for the case in question?