RE: Context Negotiation

Hi Robert,

On Friday, January 24, 2014 9:16 PM, Robert Sanderson wrote:
> Dear all,
> A quick question driven by discussions in the Open Annotation
> Community Group.
> If two communities decide that they want to use different context
> descriptions for the same basic ontologies, is there a recommended way
> to allow a system to serve both formulations?
> The two methods that immediately come to mind are:
> 1.  Content Negotiation Use a header on the HTTP request to ask for a
> particular context by its full URI. For example:   X-JSONLD-Context:

A variation of that would be my preferred approach. JSON-LD's media type [1]
features a profile parameter that you can use for such purposes. Just define
a profile and give it a unique URL identifying it. Then you simply use

  Accept: application/ld+json;

You should consider registering that profile. There's an IETF Internet Draft
of mine [2] establishing a registry for such profiles. I expect it to become
an RFC shortly.

> 2.  URI patterns. Have patterns in the URIs (somehow) that reflect
> which context is desired.  This isn't as extensible, but doesn't
> require minting new HTTP headers. For example:
> vs:

I would discourage you to do something like that. It's very brittle and not
without good reason considered an anti pattern.

> Or as a query param with the full URI:
> s/annotation1.json?context=
> text.json

A bit better but also difficult to standardize.



Markus Lanthaler

Received on Friday, 24 January 2014 20:31:40 UTC