https://www.w3.org/TR/sparql12-query/#variableScope
In SELECT, the variable v must not be in-scope in the graph pattern of the SELECT clause, nor used in another select expression earlier in the clause.
The query whose select expressions to check.
The variables and select expressions of the query.
The transformer to traverse the select expressions with.
https://www.w3.org/TR/sparql12-query/#variableScope