Re: Updated JSON-LD spec to more closely align w/ RDF data model

>> As the tail of a list is a list in its own right, the discussion about
>> addition triples on the first element "just" means the first element
>> needs encoding differently - the rest of the list is a @list isn't it
>> (I have not checked the algorithm does this).
>
> The algorithm currently doesn't support this as it would make it
> considerably more complex to find *the* head of the list.

The set of all heads of well-formed lists can be found quite easily.

All lists have a common tail (rdf:nil).  Just walk back up the list 
checking nodes have exactly one rdf:first and one rdf:next triple.  This 
generates the list head.

So in initialization of processing a graph is to run this finder and get 
the set of all list heads.

This can be used to determine which nodes to process as @list and which 
to process as plain triples.

(Actually it's probably easier to run the algorithm, collecting all 
triples in well-formed lists, then run conversion on the set of triples 
which is the graph minus list triples)

	Andy

Received on Thursday, 4 July 2013 20:21:30 UTC