Description
Hi all, again great work.
Today I implemented the version announcement of SPARQL 1.2.
I wonder whether we need/ want the versionSpecifier rule.
I see why you would want to limit the version not to be multi-line. The problem is that this rule does not restrict the usage of multi-line string. One could still use the suggested single-line strings ' '
and " "
but make them multi-line using the escape sequences in strings like VERSION "SPARQL \n 1.1
. As such, I do not think it makes sense to arbitrarily limit the structure of the string definitions. It makes the implementation of the grammar larger (since we need the VersionSpecifier rule instead of reusing the String rule, without effectively tackling an issue you would have (multi-line strings). From a user perspective I think this also does not make sense, throughout all of the SPARQL grammar we use the string rule (so 4 ways to declare it) but in this arbitrary scope of VERSION, we cannot. Imo, that's not consistent.
I would also like to get back at an issue previously raised on the PR: #210 (comment)
I think a limited semantics of re-declarations is already in order?
The spec provides rules on re-declarations of PREFIX
and BASE
through section 19.5
A prefix declared with the PREFIX keyword may not be re-declared in the same query. See section 4.1.1, Syntax of IRI Terms, for a description of BASE and PREFIX.
I think a similar approach could be taken here (so you could only have 1 definition of VERSION
).
So, what about future proofness? I think when the problem would arise where you want to declare multiple versions, this could be done by extending the grammar to:
[7] VersionDecl ::= 'VERSION' VersionSpecifier +
To summarize:
- I think the versionSpecifier rule introduces inconsistency in the language
- I think we need to restrict that the version is not allowed to be redefined. - And specifically declare what happens when it is redeclared in the context of SPARQL update queries (where the prologue can be repeated between updates)