Re: HTML as a format for REST APIs

Sure. Here's how I see it (also see the comments and links to that original
article you posted).

1)

the underlying model is the important thing, not the serialization

2)

Machine to machine communications should use formats that are mostly
written for that ... but still allow human readability. I.e. JSON.

3)

HTML is a difficult to author correctly and a pig _to parse_ in practice,
especially in constrained environments. I've got a ton of hands-on
practical experience in my day job on this one (dealing with data transfer
in the tourism industry) and it's difficult to get quality data in JSON and
XML; when the source is HTML it's always a nightmare.

4)

JSON won. API writers are using JSON, whether standards committees like it
or not.

4a)

JSON-LD has traction (e.g. Google), is relatively easy to overlay on ad-hoc
JSON, is extensible almost by definitions and has an excellent reusable
vocabulary (schema.org) specifically useful in the context of the IoT.

5)

Data is HTML is a trick, mainly useful when the _primary_ consumer is
humans and the _secondary_ consumer is a machine (rather than the other way
around). I say this with 3 years of active participation in the
Microformats community and being the lead author of the hAtom spec. That is
entirely IMO but my feeling is that if data-in-HTML was the way to go, it
would have been spontaneously widespread adopted by now.

Regards,
David




On Mon, Sep 16, 2013 at 8:04 AM, Dominique Hazael-Massieux <dom@w3.org>wrote:

> Hi David,
>
> Le lundi 16 septembre 2013 à 07:16 -0400, David Janes a écrit :
> > May I suggest that JSON-LD / Semantic Web definitions is probably a
> > stronger route to go.
>
> I agree that JSON-LD is likely a strong contender, but it's not that
> obvious to me that it necessarily is a stronger route to follow.
>
> Could you elaborate what you think are the strengths of JSON-LD compared
> to HTML+RDFa?
>
> The main strength I can see is that JSON is simpler to parse than HTML;
> but otherwise, HTML seems pretty strong on many points, including on
> service description and human-consumption on which JSON and JSON-LD seem
> weaker.
>
> > I've been thinking and writing for the last few months about how these
> > could be used in a Semantic Web context, with REST & HATEOAS. Here's
> > two slideshows:
> > [...]
>
> Thanks for the links!
>
> Dom
>
>
>

Received on Monday, 16 September 2013 14:36:11 UTC