Re: Grammar for PREFIX definitions

Dear David,

This is in response to http://lists.w3.org/Archives/Public/public-rdf-dawg-comments/2011Sep/0004.html

Though an interesting proposal, the WG has after discussion come to the conclusion that the addition of an additional feature like that is too late in the process of our group and thus beyond our current charter. 

Please also note that such prefix handling is not foreseen in the current Turtle proposal worked on by the RDF1.1 working group [1]. 

Anyways, like other features that weren't selected in this current standardisation round of SPARQL1.1, if the feature experiences adoptions in implemented systems, it might be subject to future evolutions of the standard. The working group is capturing points as input for any future chartering process.

   http://www.w3.org/2009/sparql/wiki/Future_Work_Items 

We would be grateful if you would acknowledge that your comment has been answered by sending a reply to this mailing list.

best regards,
Axel, on behalf of the SPARQL Working group

1. http://www.w3.org/2010/01/Turtle/#sec-grammar-grammar


---- Original message ---
It would be helpful to allow a prefix to be defined in terms of a
previously defined prefix, so that one could write a query like this:

  PREFIX testingGraph: <http://example/non-intuitive-URI/g147x2>
  PREFIX productionGraph: <http://example/non-intuitive-URI/g42m11>
  PREFIX graphToUse: testingGraph:

  INSERT ... GRAPH graphToUse: { ... }
  WHERE ... GRAPH graphToUse: { ... }

This way, to change the query from test to production use, one only
needs to change one prefix definition, and it is still very mnemonic:

  PREFIX graphToUse: productionGraph:

Without this ability, one would instead have to write something like the
following, which is far less mnemonic (because URIs are often not very
intuitive):

  PREFIX graphToUse: <http://example/non-intuitive-URI/g42m11>


This ability would also enable groups of related graph names to be
managed a little easier.  For example, a query might use three input
graphs and produce one output graph:

  PREFIX testBase: <http://example/test-URI-base/>
  PREFIX productionBase: <http://example/production-URI-base/>
  PREFIX graphBase: testBase:


  INSERT ... GRAPH graphBase:output { ... }
  WHERE ... GRAPH graphBase:input1 { ... }
        ... GRAPH graphBase:input2 { ... }
        ... GRAPH graphBase:input3 { ... }


However, at present the grammar for PREFIX definitions does not permit a
prefix to be defined in terms of a previously defined prefix: 
http://www.w3.org/TR/sparql11-query/#rPrefixDecl 

  [6]  PrefixDecl  ::=  'PREFIX' PNAME_NS IRI_REF

I suggest changing grammar rule 6 to:

  [6]  PrefixDecl  ::=  'PREFIX' PNAME_NS IRIref

This would allow the prefix to be defined in terms of either an IRI_REF
or a PrefixedName, per rule 125:

  [125]  IRIref	  ::=  	IRI_REF | PrefixedName



If the working group decides not to include this ability in SPARQL 1.1
(especially given how late this comment is arriving) then please put it
on a wish list for a future version.

Thanks!


-- 
David Booth, Ph.D.
http://dbooth.org/

Opinions expressed herein are those of the author and do not necessarily
reflect those of his employer.

Received on Wednesday, 14 December 2011 17:47:48 UTC