W3C home > Mailing lists > Public > public-linked-json@w3.org > December 2014

Re: Compaciting @list with single element

From: <tomasz@t-code.pl>
Date: Sun, 07 Dec 2014 13:51:50 +0000
Message-ID: <d8553b31319ad4ae37df0c1dbba0a522@rainloop.t-code.pl>
To: "Niklas Lindström" <lindstream@gmail.com>
Cc: public-linked-json@w3.org
I see. It does make sense I admit. In this case I think that the last note in section could be improved so that people don't get the wrong idea.

Thanks,
Tom

December 7 2014 2:24 PM, "Niklas Lindström" <lindstream@gmail.com> wrote: 
> Hello! 
> 
> The playground is correct. In order for the term using @list container to match, the value to be
> compacted must be an ordered list (a.k.a. an RDF collection or rdf:List). In expanded form, this is
> expressed as {"@list": [...]}. So in your case, the input needs to be:
> 
> {
> 
> "@id": "http://example.com/Person",
> 
> "http://xmlns.com/foaf/0.1/topic_interest": {"@list": ["RDF"]}
> 
> }
> 
> (To see the explicit underlying difference, look at the N-Quads tab for your two cases.)
> 
> Cheers,
> Niklas
> On Sun, Dec 7, 2014 at 1:00 PM, <tomasz@t-code.pl> wrote:
> 
>> Hi
>> 
>> Sorry about the incomplete email.
>> 
>> The specs [1] say that when a property is defined in @context as @container @list or @set it will
>> always be represented as an array, even if there's only one value.
>> 
>> However in the playground it works for @set [2] but not for @list [3].
>> 
>> Is that a bug or did I misunderstand the specs?
>> 
>> [1]: http://www.w3.org/TR/json-ld/#sets-and-lists
>> [2]: http://tinyurl.com/o6nhftk
>> [3]: http://tinyurl.com/nd8rkkn
Received on Sunday, 7 December 2014 13:52:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:43 UTC