RDFization - linkedannotation/blah2015 GitHub Wiki
Open Annotation (OA)
Motivation
- Open Annotation is a W3C recommendation for RDFization of annotation.
related links
- Open Annotation specification http://www.openannotation.org/spec/core/
- JSON-LD: http://json-ld.org/
presentations
- Sampo: sharing annotations better (Tuesday)
RDF conversion (JSON-LD)
- PubAnnotation: https://github.com/spyysalo/pubannotation.py
- Brat-flavored standoff: https://github.com/spyysalo/standoff2pa (EVEX DB, LAW-ID, etc.)
- Knowtator XML: https://github.com/spyysalo/knowtator2oa
- Penn Treebank: https://github.com/spyysalo/ptb2oa
Restful Open Annotation server (Sampo, Pontus)
- https://github.com/spyysalo/restful-oa
- Implemented: RESTful access to in-memory storage of JSON-LD annotations
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