Re: RDF-ISSUE-175 (TriG and N-Quads): TriG compatibility with N-Quads

On 18/11/13 10:32, RDF Working Group Issue Tracker wrote:
> RDF-ISSUE-175 (TriG and N-Quads): TriG compatibility with N-Quads
>
> http://www.w3.org/2011/rdf-wg/track/issues/175
>
> Raised by: Andy Seaborne
> On product:
>
> http://lists.w3.org/Archives/Public/public-rdf-comments/2013Nov/0044.html
>
>
>

The comment is a request to allow NQuads in TriG.

The core of the suggestion is to allow a fourth field in the rule that 
covers URI / single blank node starting some triples or a named graph 
without GRAPH:

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

suggested change is to add labelOrSubject? after predicateObjectList 
before the '.'

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


But this opens up a lot more than just N-Quads - any block of Turtle-ish 
triples (exception: starting with a collection) can have a named graph 
label added. This includes syntax abbreviations ';' and ','

: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 ]
}

As a visual syntax, it looks confusing to me.  NQuads is not primarily 
for people to read; TriG is, Turtle is.

Before Turtle-in-TriG I suggested including NQ but with Turtle in TriG, 
I think it's confusing with little value.  Efficient N-Quads parsing for 
database dumps would not happen in a general purpose parser so N-Quads 
role is for dumps, not to mix with humane readable formats.

It should be technically possible to only add NQ where here is S P O G 
but it is a more widespread rewrite because you have to look passed the 
O to see there is no ';' and ',' before allowing G.  That means 
additional graph rules to capture that possibility, replacing rules [7] 
and [8] and maybe needing more rules earlier on in the grammar.

This would be a divergence from the grammar of Turtle.

At the same time, NQuads is deployed and used syntax so changing N-Quads to

G { S P O }

which is already legal (skipping worrying about line breaks) is not 
practical.

I suggest we politely decline the suggestion.

 Andy

Proposed response:

-------------------------------------------

Richard,

Thank you for your comment regarding aligning TriG with N-Quads.

The Working Group sees Turtle and TriG as being the more readable 
syntaxes, and N-Triples and N-Quads as focused on dump formats.

The group has had lengthy discussions on the syntax for TriG, which 
included integrating in N-Quads.  Now that TriG allows plain Turtle, 
putting in support for N-Quads, without also allowing a graph label for 
any block of Turtle-syntax triples, is a significant change.

The Working Group has decided that the alignment with Turtle (both 
Turtle and TriG being more oriented to human readability) was more 
important.  The incorporation of N-Quads, a less read-oriented format, 
as well makes the overall syntax confusing and divergent from the idea 
of "Turtle in TriG" that motivated not requiring {} on the default graph.

If this addresses your comment, albeit not to accept the proposal, 
please reply with the subject prefixed by "[RESOLVED]".

     Andy
     on behalf of the RDF Working Group

Received on Tuesday, 19 November 2013 14:00:21 UTC