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

On Jul 6, 2013, at 5:17 AM, "Markus Lanthaler" <markus.lanthaler@gmx.net> wrote:

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

Yes, that would be a list-of-lists. We may want to (post 1.0) consider relaxing this. The only reason for allowing lists of lists (AFAIKR) is because the the problems with @list coercion. However, if there is no @list coercion, then there shouldn't really be a problem. Even if there is, it may be possible to detect that we're already in a list, and simply require that subsequent lists be in expanded form. Not worth addressing for 1.0, IMO.

Gregg

>> 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 23:27:35 UTC