W3C home > Mailing lists > Public > public-rdf-comments@w3.org > November 2013

TriG compatibility with N-Quads

From: Richard Smith <richard@ex-parrot.com>
Date: Sun, 17 Nov 2013 19:32:22 +0000 (GMT)
To: public-rdf-comments Comments <public-rdf-comments@w3.org>
Message-ID: <alpine.LRH.2.02.1311171910330.23626@sphinx.mythic-beasts.com>

Has any consideration been given to making N-Quads a subset 
of TriG?  Given the effort that seems to have been gone to 
to make TriG compatible with Turtle and SPARQL, it seems a 
little surprising that it is not also compatible with 

Making TriG compatible with the current N-Quads isn't 
complicated.  Just allow another labelOrSubject after the 
predicateOnjectList in production [3g] triplesOrGraph. 
I.e. change it to read:

   [3g]  triplesOrGraph  ::=  labelOrSubject (wrappedGraph
                | predicateObjectList labelOrSubject? '.')

And for symmetry, something similar should perhaps be done 
in [4g] triples2, though it is not required for N-Quads 
compatibility and involves a disambiguation between a verb 
and a label:

   [ a foaf:Person ] <graph1> .
   [ a foaf:Person ] dc:name "John" .

That's entirely do-able while remaining LALR(1) and LL(1): 
it's the same problem as disambiguating labelOrSubject.

Changing N-Quads would have been cleaner, but I assume is 
not feasible as N-Quads has been in use five years since the 
publication of <http://sw.deri.org/2008/07/n-quads/>.  With 
a free reign, I would have suggested moving the graph label 
to the start of the quad and wrapping the triple in braces, 
per TriG.  Or alternatively, use some symbol like ':=' to 
separate the label from the subject.  But I accept that 
isn't possible.

Received on Sunday, 17 November 2013 19:32:45 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:29:58 UTC