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.
https://www.w3.org/TR/sparql12-query/#variableScope