W3C home > Mailing lists > Public > public-rdf-comments@w3.org > February 2012

RDF Lists in Turtle

From: Henry Story <henry.story@bblfish.net>
Date: Sun, 26 Feb 2012 10:43:24 +0100
Message-Id: <8E24DB40-198B-4617-9270-746BF46351A9@bblfish.net>
To: public-rdf-comments@w3.org
In section 5.3 of the latest Turtle editors draft [1] I read

Beginning the collection production records the curSubject and curPredicate, sets curSubject to a novel blank node Bhead and sets curSubject and curPredicate to Bhead and rdf:first respectively. Each object O in collection allocates a novel blank node Bn, creates an additional triple curSubject rdf:rest Bn . and sets curSubject to Bn. Finishing the collection production creates an additional triple curSubject rdf:rest rdf:nil . and restores curSubject and curPredicate The node produced by matchingcollection is the blank node Bhead.

Is this correct? In most programming languages one thinks of Nil as itself a list (just the empty one).
So one thinks that 

  :tasks todo () .

as equivalent to 

  :tasks todo rdf:nil .

Things are a bit odd, as otherwise it is not clear what the rdf:first of () is .
This seems wrong:

  :tasks todo _:t1 .
  :t1 rdf:first ? .
  :t2 rdf:next rdf:nil .

I see that this is tricky to describe correctly. Lists are usually described recursively.


[1] http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#sec-parsing-triples

Social Web Architect
Received on Sunday, 26 February 2012 09:43:55 UTC

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