Re: [web-annotation] Make Turtle support optional?

Yeah...this is where having "levels" might help out.

If my API client is in the browser, then my code is written in 
JavaScript and therefore the JSON(-LD) representation is what I'd be 
using. Even if I wanted the "smarter" graph semantics, I'd still be 
trafficking in JSON-LD.

The Turtle format makes sense for server-to-server or 
non-browser-based clients, and I'm certainly not suggesting we remove 
it's use altogether, just that we lower it to a SHOULD from a MUST.

If we do that, then it makes sense to also make the JSON-LD format the
 default and require responding to `application/json` (when asked)--as
 that too is a typical default that brings in auto-parsing, etc.

So...revising the LDP spec's [4.3.2 HTTP 
GET](http://www.w3.org/TR/ldp/#h-ldprs-http_get) would read in our 
spec something like (removing the non-normative bit):

> 4.3.2.1 LDP servers MUST respond with a JSON-LD representation of 
the requested LDP-RS when the request includes an `Accept` header 
specifying `application/ld+json`, unless HTTP content negotiation 
requires a different outcome.

> 4.3.2.2 LDP servers SHOULD respond with a `application/ld+json` 
representation of the requested LDP-RS whenever the `Accept` request 
header is absent.

> 4.3.2.3 LDP servers MUST respond with a `application/json` 
representation of the requested LDP-RS when the request includes an 
`Accept` header, unless content negotiation requires a different 
outcome. 

> **new bit** 4.3.2.4 LDP servers SHOULD respond with a Turtle 
representation of the requested LDP-RS when the request includes an 
`Accept` header specifying `text/turtle`, unless HTTP content 
negotiation requires a different outcome.

(keeping the numbers from the LDP spec for reference *only*)

4.3.2.1 (redundant here as in the LDP spec) if you're asked for 
JSON-LD, send it
4.3.2.2 makes `application/ld+json` the default media type
4.3.2.3 makes `application/json` a required response option--when 
asked for it
4.3.2.4 (new) makes `text/turtle` optional, but recommended

That seems to fit the worlds of Web annotation and (typical) HTTP APIs
 as found "in the wild" and hopefully without being overly restrictive
 while still recommending support for Turtle and an understanding of 
the graphy goodness contained therein. :smiley: That's the hope 
anyway.

-- 
GitHub Notif of comment by BigBlueHat
See 
https://github.com/w3c/web-annotation/issues/34#issuecomment-139036631

Received on Wednesday, 9 September 2015 20:28:08 UTC