Should this be valid SPARQL?
SELECT ("text" AS ?aString)
WHERE {}
ORDER BY ?aString
I have tried two different engines. One returns "text" for ?aString, the other errors, saying that ?aString is not defined in the ORDER BY. Does the SPARQL spec cover this case? Or is this just an implementation detail, where it happens to work in some engines, but is not strictly portable?
Sparql.org's query validator says it's legal. This is actually a pretty important case, since we want to be able to do things like: