RDFization - linkedannotation/blah2015 GitHub Wiki

Open Annotation (OA)

Motivation

  • Open Annotation is a W3C recommendation for RDFization of annotation.

related links

presentations

RDF conversion (JSON-LD)

Restful Open Annotation server (Sampo, Pontus)

Store annotation in JSON-LD:

curl -X PUT -i -H 'Content-Type: application/json' -d '{'\
'"@id": "1", '\
'"hasBody": "http://example.org/foo",'\
'"hasTarget": "http://example.org/doc.txt#char=0,10"'\
'}' \
http://127.0.0.1:5000/annotations/1

Retrieve in JSON-LD:

curl -X GET -i -H 'Accept: application/ld+json' http://127.0.0.1:5000/annotations/1

or

curl http://127.0.0.1:5000/annotations/1?format=jsonld

Retrieve in RDF/XML:

curl -X GET -i -H 'Accept: application/rdf+xml' http://127.0.0.1:5000/annotations/1

or

curl http://127.0.0.1:5000/annotations/1?format=rdf

Restful Open Annotation tagtog client (Juan Miguel)

Building on the restful OA server by Sampo & Pontus, I implemented an OA proof-of-concept client in tagtog. The taken steps are:

  • Listen to document submission by the user via the interface
  • Call the restful OA server to get the document's text & annotations
GET http://127.0.0.1:5000/documents/${id}.txt
GET http://127.0.0.1:5000/annotations/
  • Convert the text & annotations formats to the internal tagtog's format

The OA response looks like this:

{
  "@context": "http://www.w3.org/ns/oa-context-20130208.json",
  "@graph": [
    {
      "@id": "http://127.0.0.1:5000/annotations/1",
      "hasBody": "http://example.org/foo",
      "hasTarget": "http://example.org/doc.txt#char=0,10"
    },
    {
      "@id": "http://127.0.0.1:5000/annotations/06899e0904",
      "@type": "oa:Annotation",
      "annotatedBy": "http://compbio.ucdenver.edu/Hunter_lab",
      "hasBody": "http://purl.obolibrary.org/obo/GO_0000806",
      "hasTarget": "/documents/11532192.txt#char=18625,18630"
    },
    //...
}
  • Display document & annotations via the tagtog interface

Text Annotation (TAO)