Next: , Previous: , Up: Top   [Contents][Index]


11 Content negociation

There are a number of different available syntaxes for RDF, some being simple and human readable like turtle, and others more adapted to the JavaScript ecosystem like json-ld. To help clients both from and outside of the JS ecosystem, the server needs to perform content negociation, i.e. convert from one content-type to another.

function from (webid-oidc serve): convert client-accepts server-name path content-type content

Convert the resource representation under path on server-name, which has a given content-type and content, to a content-type that the client accepts.

Return 2 values:

  1. the accepted content-type;
  2. the content in the given content-type.

Currently, the only conversions are from and to Turtle and N-Quads.