- From: Dave Longley <dlongley@digitalbazaar.com>
- Date: Sun, 04 Dec 2011 22:40:38 -0500
- To: public-linked-json@w3.org
On 12/04/2011 10:02 PM, Markus Lanthaler wrote: >> I have also thought along the lines of Markus, of instead having a >> microsyntax like "@datatype": "@list[@iri]" (or perhaps "@list:@iri" >> or even just "@list @iri"). But at the end of the day I think a new >> key (e.g. @structure or @container) really is the simpler mechanism, >> since having to parse microsyntax is putting more burden on consumers >> than using a ready JSON structure with a new key. I agree that >> keywords shouldn't abound, but neither should we strain ourselves from >> avoiding them where the purpose and needs are clear and distinct. Or >> else I'd prefer {"@list":"@iri"} over "@list[@iri]", since it's only 3 >> chars more and using JSON instead of a microsyntax. >> >> -1 For microsyntaxes in JSON-LD. We rejected microsyntaxes before and I >> think it was the right decision. > Well, actually @iri, @list, and @set are microsyntaxes as well IMHO. But you don't have to do any special parsing inside of those strings; you deal with them whole. It is one thing to have keywords, it is another to have to parse strings for other special internal syntax ... which is what I think most people would consider "microsyntax". There's a difference between giving meaning to certain JSON strings and creating another syntax within a JSON string that has no meaning in itself, but rather imposes another structure that must be parsed in order to derive its meaning. > So it's > really a question of whether we see a list of IRIs (@list[@iri]) as another > datatype or not. I do.. and I think a lot of users of JSON-LD would say the > same. > Having to associate a "structure" to a datatype is not something you would, > as a developer, normally have to do. Maybe the problem is with the "structure" keyword option? Perhaps a different word (eg: "container") would be more amenable? The "@structure" discussion isn't necessarily about associating a structure with a datatype, btw, it's about associating a structure with a particular property, regardless of datatype. We're trying to say that when you access property X, the nature of the structure of its objects is Y. This is to tell you something about order-preservation or about how to access the objects (as an array or as a single object). Whether or not datatype coercion is also specified in the context seems to be another matter. > Another issue I could see arise is that it could be difficult to understand > where/if the @structure/@container was set if multiple contexts are merged. > So to make sure you would always end up with the same "data type" even when > an outer context changes you would have to add something like "@container": > "@none" as well. I didn't quite follow that, could you provide an example? -- Dave Longley CTO Digital Bazaar, Inc.
Received on Monday, 5 December 2011 03:41:03 UTC