Re: RDF Lists in Turtle

On Sun, 2012-02-26 at 10:43 +0100, Henry Story wrote:
> 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?

It is incorrect for empty lists as you have noticed.

>  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 .

Yes, that is actually what you do.

The spec should probably just describe this base case explicitly.

-dr

Received on Wednesday, 29 February 2012 20:29:39 UTC