The variables a GROUP BY clause keeps in scope (18.2.4.1): its variable keys and the variables of its (expr AS ?var) keys. Other keys, like expressions or (SPARQL 1.2) triple terms, keep no variable in scope.
The variables a GROUP BY clause keeps in scope (18.2.4.1): its variable keys and the variables of its (expr AS ?var) keys. Other keys, like expressions or (SPARQL 1.2) triple terms, keep no variable in scope.