W3C home > Mailing lists > Public > public-rdf-wg@w3.org > March 2011

Re: [JSON] RDF collections and JSON arrays

From: Steve Harris <steve.harris@garlik.com>
Date: Fri, 25 Mar 2011 10:58:24 +0000
Cc: RDF Working Group <public-rdf-wg@w3.org>, Ivan Herman <ivan@w3.org>, Pat Hayes <phayes@ihmc.us>, Manu Sporny <msporny@digitalbazaar.com>
Message-Id: <FB5868E3-8125-45A3-AD5E-04D264891CD3@garlik.com>
To: nathan@webr3.org
On 2011-03-25, at 09:12, Nathan wrote:

> Steve Harris wrote:
>> I'm also not keen on [[ ]] for RDF collections, but don't see a sensible alternative.
> 
> The main alternatives are to simply not include support for either multiple values or RDF Collections.

Good point.

> [[ ]] is unexpected for JSON users, and I fear that in reality people will simply think we are mad, after all the context under which I proposed the [[ ]] syntax was for a machine optimized RDF+N3 in JSON, and not what we appear to be looking at creating now (what I'd refer to loosely as Data Objects).

I'm not sure there's any real clarity on what use cases we're trying address.

> Looking at this practically, most of our target market do not have the concept of multiple values, nor do they have support for multiple values in their stacks. They do however work with arrays and collections intensively.
> 
> I'd actually propose that we drop multiple value support and keep the [] notation for RDF collections.
> 
> To illustrate, if somebody has a property with multiple values for the label, they will typically write:
> 
>  "labels": ["Foo", "Bar"],
> 
> Notice that's plural "labels" not singular "label", my way of language they are saying "this is a collection of labels", and that is the most common usage - indeed it's practically about the only option many developers have in their non-RDF tech stacks.

Sure, but I think that the variable cardinality is one of the most important features of RDF / graph stores in general.

> This approach of only supporting RDF Collections (producing JS Arrays) makes sense to people. [[ ]] syntax and "multiple values" do not.
> 
> On the RDF side, surely we can create some properties if we need to? rdf:labels -> a collection of rdf:label relating to the subject.

I don't really see how that helps idiomatic usage myself, you still have a code difference for cardinality 1, v's > 1.

- Steve

-- 
Steve Harris, CTO, Garlik Limited
1-3 Halford Road, Richmond, TW10 6AW, UK
+44 20 8439 8203  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD
Received on Friday, 25 March 2011 10:58:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:04:04 UTC