Re: Sets and Lists

Gregg Kellogg wrote:
> On May 30, 2012, at 11:07 AM, Nathan wrote:
> 
>> Hi All,
>>
>> Just a quick question about sets and lists, after reading the 
>> specification I see that a set is an unordered set, and a list is an 
>> ordered set - however I don't see anything which mentions how distinct 
>> values should be handled?
>>
>> Is list to act like an ordered sequence of elements, and set like a.. 
>> well unordered set where each member is distinct?
> 
> Yes, that's basically it. In a set, each value shares the same subject and property, and there are no duplicates (just like RDF). In a list, each value is in a sequence, and there can be repeats; basically, it's an RDF Collection.
> 
> Set:
> 
> {"@id": "s", "p": ["o1", "o2"]} => :s :p :o1, :o2 .
> 
> List:
> 
> {"@id": "s", "p": {"@list": ["o1", "o2"]}} => :s :p (:o1 :o2) .

Ahh, gotcha - for some reason I'd thought you were introducing "real" 
sets into to json-ld/rdf, not just a condensed way of structuring object 
values which share subject and property.

:( - been wanting sets for ages!

Best,

Nathan

Received on Wednesday, 30 May 2012 20:07:28 UTC