Re: [Fwd: SPARQL variable names syntax]

On Thu, Aug 04, 2005 at 07:25:45 +0100, Andy Seaborne wrote:
> Steve Harris wrote:
> >On Thu, Aug 04, 2005 at 11:55:33 +0100, Andy Seaborne wrote:
> >
> >>
> >>http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2005Aug/0038
> >>
> >>
> >>Walid Maalej wrote:
> >>
> >>>Dear RDF Data Access Working Group Members,
> >>>
> >>>In the last working draft of the 21st. of July 2005, changes have been 
> >>
> >>done
> >>
> >>>concerning the definition of the variable names within a SPARQL query.
> >>>The syntax is specified under
> >>>http://www.w3.org/TR/rdf-sparql-query/#rVARNAME .
> >>>I'm wondering if there is any reason not to allow the underscore "_" at 
> >>
> >>the
> >>
> >>>Beginning of a variable name from the grammar point of view.
> >>>This could be very useful for application that build SPARQL queries
> >>>automatically and call the variables like the RDF:ID of the searched
> >>>resource.
> >>
> >>Allowing "_" as the first character of a VARNAME does not affect any 
> >>approved tests and does not break the grammar in any way.  I have added 
> >>it.
> >
> >
> >No, but it does break my code. I was using _ as a reserved prefix for
> >internal and temporary variables.
> 
> :-)
> 
> And, of course, it used to be legal until the last WD.
> 
> I use much the same trick: "=" for variables wot was bNodes and "#" for 
> system variables like #now.

Its actually tricker than I thought, becasue it has to be a legal SQL
variable, but not a legal SPARQL variable, _ was very convienient. The
alternative you be to prefix all the sparql variables, which will make
the contrustions harder to read.

As the comment was along the lines of "I was wondering why..." I would
prefer it if _ is not allowed at the start of variable names.

- Steve 

Received on Friday, 5 August 2005 08:36:37 UTC