RE: Convert also "partial" lists from RDF to JSON-LD

On Friday, July 05, 2013 6:50 PM Gregg Kellogg, wrote:
> It also makes sense that @list can be the value of rdf:rest (and
> perhaps rdf:first, as well). The algorithm would find the list head at

I haven't thought much about it yet but wouldn't allowing it in rdf:first
mean that (without additional checks) you would end up creating list of
lists? We currently keep a reference to the bnode-object that is then
replaced with a @list-object. Doing that for rdf:first would mean that you
could replace a bnode-reference in a list with a list.


> the first node having rdf:first/rest with only single well-formed
> values, as it does now; this should include those for which the subject
> is a non-well-formed value of an rdf:rest.
> 
> An example @afs and I were working on offline is more like the
> following:
> 
> Turtle:
> 
> @prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @prefix : <http://example/> .
> 
> :x :list _:a .
> 
> _:a rdf:first 1 .
> _:a :additional "foo" .
> _:a rdf:rest  _:b .
> 
> _:b rdf:first 2 .
> _:b rdf:rest  _:c .
> 
> _:c rdf:first 3 .
> _:c rdf:rest  rdf:nil .
> 
> JSON-LD:
> 
> {
>   "@context": {...},
>   "@id": "_:x",
>   "list": {
>     "additional": "foo",
>     "rdf:first": 1,
>     "rdf:rest: {"@list": [2, 3]}
>   }
> }

Yes, that's a consequence of allowing @list as value of rdf:rest and is what
I meant when I referred to OpenAnnotation.


--
Markus Lanthaler
@markuslanthaler

Received on Saturday, 6 July 2013 11:18:09 UTC