Open Annotation plugin for Fedora

Funded by the Andrew W. Mellon Foundation

This project is maintained by Brown-University-Library

Open Annotation plugin for Fedora

The Open Annotation plugin for Fedora is a content-agnostic web service that allows developers to create, query, retrieve, and serialize annotations using the Fedora Commons repository software to store annotations and their content. The plugin is designed to implement the Open Annotation Core Data Model:

The Open Annotation Core Data Model specifies an interoperable framework for creating associations between related resources, annotations, using a methodology which conforms to the Architecture of the World Wide Web. Open Annotations can easily be shared between platforms, with sufficient richness of expression to satisfy complex requirements while remaining simple enough to also allow for the most common use cases, such as attaching a piece of text to a single web resource.

An Annotation is considered to be a set of connected resources, including a body and target, and conveys that the body is somehow about the target. The full model supports additional functionality, enabling semantic tagging, embedding content, selecting segments of resources, choosing the appropriate representation of a resource and providing styling hints for consuming clients.

This application consists of several components:

A Jython web service that:

Fedora objects to support the use of the OA service:


Quick Start

Note: A full installation is recommended for a production system

Full Installation Notes

Persist local installation setting over updates

Keep in sync with Fedora

To keep the Open Annotations index to stay in sync with Fedora, only one of the following two options needs to be done.

1.) Messaging

Messaging will ensure that the Open Annotation index is always in sync with Fedora, but requires that your Fedora instance is sending update messages to a JMS broker.

2.) Web Service

There are two service endpoint available for syncing the internal triple store with Fedora.


There are four main services the Open Annotation plugin provides:


A POST method that creates an Annotation (A-1) object
based on a number of parameters.

Required Parameters:
  source_uri:             The URI for the whole target object
  dc_title:               Dublin Core title associated with the annotation, 
                          i.e. "dublin core title goes here"
  body_inline             Plain text string to store as the body
  body_uri:               URI pointing to the body of the annotation
  body_content:           Contents of the body (XML, text, json, etc.)
  body_mimetype:          Mimetype of the body_content

Optional Parameters:
  annotator:              A string representing a user ID (0 or more)
                          ie. 'Charly'
  generator:              A string representing what generated the annotation
                          ie. 'Web Client'
  oax_style_uri:          A URI for a XSLT stylesheet used to render the whole target object. (0 or 1)
  oa_selector:            A string with the selector value(0 or 1)
  oa_selector_type_uri:   Required if an oa_selector is passed in
                          ie. oa:Fragment
  fragment_type:          URI describing the oa_selector type  Optional and only used if
                          an oa_selector is passed in.
                          ie. ''
  body_content_model:     A string representing the body's content model
                          ie. 'tei-annotation'

Python examples:


A GET method that takes a comma seperated list of Annotation
(A-1) PIDs to serialize as the 'pid' parameter.

Required parameters:
  pid:      Comma seperated list of PIDs to serialize.

Optional parameters:
  format:   Format of the serialization output
              - rdf/xml or xml (default)
              - rdf/json or json
              - turtle or ttl
              - nt
              - n3
Python examples:


A POST or GET method to query the Open Annotations index with a SPARQL Query
This method has READ access to the Annotations index.

Required parameters:
  query:      The SPARQL query to execute

Python examples:


A GET method that will serialize (dump) all Annotation objects in Fedora.

An optional 'format' parameter to output the serialization
in different formats.

Format options are:
- nt (default)
- rdf/xml or xml
- rdf/json or json
- turtle or ttl
- n3

Python examples:


Authors and Contributors

Funded by a grant from the Andrew W. Mellon Foundation, via the Open Annotation Collaboration.