- From: Evan Prodromou <evan@e14n.com>
- Date: Thu, 25 Jun 2015 07:40:51 -0400
- To: "public-socialweb@w3.org" <public-socialweb@w3.org>
- Message-ID: <558BE8C3.2030207@e14n.com>
I've been looking over the API brainstorming documents and I wanted to highlight a trick that I've seen used before for mapping structured names in JSON to flatter namespaces. MongoDB uses it for querying document bases: http://docs.mongodb.org/manual/core/document/#dot-notation . There are a few JavaScript tools that do something similar for big JSON objects. The trick is to name a field of a field using dot notation. So, an object like: { "@context":"http://www.w3.org/ns/activitystreams", "@type":"Create", "object": { "@type":"Note", "content":"Hello world!" } } ...could be coded as: @context=http://www.w3.org/ns/activitystreams& @type=Create& object.@type=Note& object.content=Hello world! There are other such syntaxes -- JSON Pointer <https://tools.ietf.org/html/rfc6901>, for example -- but I like that the dot notation reflects the way a number of programming languages (JavaScript, Python, Ruby) do object attribute access. If we can agree on something similar, it makes one of the big differences between micropub and the other two candidates a little easier to deal with. -Evan
Received on Thursday, 25 June 2015 11:41:24 UTC