Re: [whatwg] Was is considered to use JSON-LD instead of creating application/microdata+json?

On Thursday, August 09, 2012 1:18 AM, Ian Hickson wrote.
>
> On Wed, 8 Aug 2012, Markus Lanthaler wrote:
> >
> > I was wondering whether it was considered to use JSON-LD [2] instead
> of
> > creating application/microdata+json. The resulting output would be
> more
> > or less the same.
> 
> It wasn't. What would be the purpose of doing so?
>
> The only reason there's a MIME type at all (rather than just using
> JSON's
> directly) was to enable filtering of copy-and-paste and drag-and-drop
> payloads; would JSON-LD enable that also?

Sure, I see no reason why not.


> That seems like it is strictly more complicated (trivially so, but
> still).
> What is the advantage?

Well, I would say there are several advantages. First of all, JSON-LD is
more flexible and expressive. It has support for string
internationalization, data typing, lists etc. It also allows to distinguish
between IRIs and literals (which isn't the case for
application/microdata+json) which is important for Linked Data application.
Secondly, there is an API for JSON-LD to reframe [1] a document into a shape
that might be easier to work with in a web app (I think that's the whole
point of microdata+json or am I wrong?). Other API calls allow e.g. to
convert to and from RDF [2]. If you are interested, there is an online
JSON-LD playground [3] where you can play with the various API calls. Last
but not least it would also make web developers life easier if there are
fewer formats to support/learn.


[1] http://json-ld.org/spec/latest/json-ld-framing/
[2] http://json-ld.org/spec/latest/json-ld-api/
[3] http://json-ld.org/playground/


--
Markus Lanthaler
@markuslanthaler

Received on Thursday, 9 August 2012 14:44:51 UTC