RESTful Open Annotation API specification
The following features may optionally be supported by implementations of the API.
For large collections, the server may respond with only part of the
collection in response to a GET
collection request. If it does so,
the server must provide URLs for other parts as part of the
collection, using standard link
relations
in the top level of the response.
Example request:
curl -i http://example.org/annotations/
Example response:
HTTP/1.0 200 OK
Content-Type: application/ld+json
{
"@context": ...
"@id": "/annotations/",
"generatedAt": "2012-04-09",
"@graph":
[
...
],
"start": "/annotations",
"next": "/annotations?page=2"
"last": "/annotations?page=49402",
}
All conformant implementations must support JSON-LD with the MIME type application/ld+json
. RESTful Open Annotation stores may also support other formats through standard content negotiation. Namely, if the client specifies preference for one of the following in an Accept
header, the store may respond with:
text/html
: human-readable representationapplication/rdf+xml
: RDF/XML serializationapplication/n-triples
: N-triples serialization (TODO: quads?)(Conversion from JSON-LD to other RDF serializations is supported by the many libraries available e.g. from http://json-ld.org/)
The following extensions have been suggested but no specification has yet been provided.
PATCH
support using JSON PatchPOST
and @graph
instead of individual annotationDELETE
for collection resourcePUT
(upsert)