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

Re: TriG compatibility with N-Quads

From: Andy Seaborne <andy@apache.org>
Date: Mon, 18 Nov 2013 10:41:52 +0000
Message-ID: <5289EEF0.3090400@apache.org>
To: public-rdf-comments@w3.org
Richard,

Thank you for your comment. I've recorded this as

https://www.w3.org/2011/rdf-wg/track/issues/175


Changing rule [3g] in the way you suggest would create something that is 
much more than N-Quads because predicateObjectList includes the 
abbreviation forms for ";", "," and also the [] and () constructs, not 
just enable 4-tuple N-Quads style lines.

:s :p 123 ;
    :q "foo" , "bar"  , (7 8 9) ;
    :r [ :z 18 ]
    :graph .

that is:

:graph {
    :s :p 123 ;
       :q "foo" , "bar" , (7 8 9) ;
    :r [ :z 18 ]
}

There has been discussion of a form of TriG that is :

:graph { triple }

as a canonical form. This is already legal TriG so applications are free 
to generate it.  Note that in addition N-Quads and N-Triples are also 
line based.

	Andy

On 17/11/13 19:32, Richard Smith wrote:
>
> 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 N-Quads.
>
> 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.
>
>
> Richard
>
>
Received on Monday, 18 November 2013 10:42:22 UTC

This archive was generated by hypermail 2.3.1 : Monday, 18 November 2013 10:42:22 UTC