Re: Deprecate most "native" RDF serializations

On Sun, 2012-05-06 at 10:46 +0100, Andy Seaborne wrote:
> 
> On 06/05/12 01:54, Sandro Hawke wrote:
> > On Fri, 2012-05-04 at 11:22 -0400, Manu Sporny wrote:
> >>
> >> """
> >> TURTLE Lite would effectively be a subset of TURTLE - N-Quads, or
> >> something that would be N-Quads-like (allowing for either "s p o" or
> >> "s
> >> p o c" statements).
> >> """
> >>
> >> Gavin has asserted that TURTLE already supports N-Triples... now all
> >> we
> >> need to do is to make N-Quads a subset of TURTLE and we're good for
> >> TURTLE Lite.
> >
> > Since a subset can't include things not in its superset, I guess you're
> > saying that Turtle should include the dataset/quad stuff?  Do you have a
> > proposed syntax for that?   I don't think adding the label after the
> > triple, as in N-Quads, works well in Turtle...
> >
> >    s p o1 g, o2 g; p2 o3 g.
> >
> > Nah.   Maybe just like trig, where you have a triple you could have
> > label + { graph }.   Or maybe a GRAPH keyword like in SPARQL.  I kind of
> > like that.
> >
> > Steve has argued very strongly, and Andy just mentioned again, that
> > people want to know from the mime type whether they'll be getting
> > triples or quads.   Steve sees it as a big security issue -- you don't
> > want to load quads in from the Web and have them over-write your
> > crawler's internal state metadata or data that was supposedly fetched
> > from other address. I'm not convinced, myself, not at all, because I
> > think one needs to have an "untrusted" mode of loading quads that
> > renames all the graphs.
> 
> That's not the point I was making: graphs contains triples, datasets 
> contain quads.

Sorry, my mistake.

> If code is asked to read into a graph, and at the 100 millionth input 
> line gets a quads, what is it to do?  Declaring the media type is 
> nominating the contract up-front.

How about saying every new-turtle document parses to a dataset?  So the
parser would be called like an quads parser not a triples parser.

For API simplicity / backward compatibility, there could be a
triples-parser wrapper, which calls the quads parser but throws an error
if a quad is encountered.   (Maybe it could have a flag to ignore any
quads instead of throwing the error.)       The trivial implementation
of this would just call the quads parser then look at the dataset when
it's done, making sure no named graphs were created and returning the
default graph.   In some languages, I'd implement it with a special
subclass of Dataset which immediately throws an error when any named
graphs are created.

   -- Sandro

Received on Sunday, 6 May 2012 11:40:13 UTC