Introduction
The purpose of AERO is to embed a (generic) annotation editor within a service NLP/TDM infrastructure. The protocol focuses on actions triggered by the infrastructure. No dependencies of the annotation editor on the infrastructure are introduced. This ensures that the annotation editor can be embedded in various different infrastructures that support AERO.
An infrastructure often offers multiple services, e.g. a registry/catalog and a storage system. If an annotation editor needs to be aware of these services, it creates a strong coupling of the editor with the surrounding platform and actions such as opening a document or searching for a document can easily require replicating a significant part of the functionality of these other services. Hence, it is more sensible to design a protocol that allows embedding arbitrary annotation editors in a platform without introducing dependencies on the surrounding platform.
Many annotation editors - even web-based ones - do not offer any remote API at all. They cannot be embedded in an infrastructure. Transferring data between the infrastructure and the editor always requires the user importing/exporting the data. AERO provides a set of calls and data structures that enable a basic set of interactions related to managing project, documents, annotations, and curated annotations. As such, it is suitable for annotation editors that support these concepts, e.g. WebAnno, AlvisAE, brat, etc.
API
This section explains the data structures and API calls defined by AERO.
Data Structures
AERO JSON response
The response provides an envelop for a returned data structure. In addition to the actual response in the "body", the envelope contains a field for “messages”. Example:
{
"messages": [
{ "level": "WARN", "text": "Internal error while accessing document 10.",
],
"body": [
{
"id": "32",
"name": "sample.txt",
"state": "CURATION_FINISHED"
},
{
"id": "33",
"name": "essay001.xmi",
"state": "NEW"
}
]
}
A message always contains a "level" and a "text" field. The text must be a string. Acceptable values for the "level" field are the strings:
-
ERROR
- if there is an error, then typically the body is empty. -
WARN
- if there is a warning, then the body might be incomplete. -
INFO
- an informative message, typically a confirmation message that the action requested by the client has been performed. -
DEBUG
- an AERO server should never generate debug messages unless specifically configured to do so by its administrator
Calls
This section explains the API calls defined by AERO. All the calls are relative to a base URL which depends on the URL where the annotation tool is hosted. It is recommended but not mandatory that the URL includes aero
and v1
, e.g. http://annotool.myorg.com/api/aero/v1/
.
Projects
List Projects
Produce a list of all projects accessible by the current user.
Title |
List projects |
||
URL |
|
||
Method |
GET |
||
Consumes |
none |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
none |
||
Data params |
none |
||
Success response |
|
||
Error response |
|
Create Project
Creates a new project. By default, the user that invokes this action receives permissions on the project equivalent to those of a project manager, e.g. the user should be able to add/remove documents to/from the project. If the "creator" parameter is set, then these permissions are granted to the specified user instead of the current user. This is important such that the PLATFORM can invoke this action using an administrative user account on behalf of a real user. The "creator" should in this case be the real user, not the administrative user used by the PLATFORM.
Title |
Create project |
||
URL |
|
||
Method |
POST |
||
Consumes |
multipart/form-data |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
none |
||
Data params |
|
||
Success response |
|
||
Error response |
|
Delete Project
Deletes the specified project. This also entails the deletion of all documents and annotations in the project.
Title |
Delete project |
||||
URL |
|
||||
Method |
DELETE |
||||
Consumes |
none |
||||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||||
URL params |
|
||||
Data params |
none |
||||
Success response |
|
||||
Error response |
|
Import Project
Imports a ZIP archive containing a previously exported project. If a project with the name as indicated by the metadata in the ZIP archive already exists, the imported project is created under a different name. E.g. if the name of the project is "My project" and a project by this name already exists, then the system can create the project under the name "My project 1". The name of the created project and its ID are returned as part of the result.
Title |
Import project |
||
URL |
|
||
Method |
POST |
||
Consumes |
none |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
|
||
Data params |
none |
||
Success response |
|
||
Error response |
|
Export Project
Exports the whole project as a ZIP archive. This archive can be imported again using the "Import project" action.
Title |
Export project |
||
URL |
|
||
Method |
GET |
||
Consumes |
none |
||
Produces |
|
||
URL params |
none |
||
Data params |
none |
||
Success response |
|
||
Error response |
|
Documents
List Documents
List all documents in a project.
Title |
List documents |
||
URL |
|
||
Method |
GET |
||
Consumes |
none |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
|
||
Data params |
none |
||
Success response |
|
||
Error response |
|
Create Document
Create/import a new document in the project.
Title |
Create document |
||
URL |
|
||
Method |
POST |
||
Consumes |
application/octet-stream |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
|
||
Data params |
|
||
Success response |
|
||
Error response |
|
Read Document
Exports the specified document. Unless specified otherwise, the format in which the documents is exported corresponds to the format in which the document was imported or to the default format of the application. The application may choose to indicate the produced format by setting a media type other than application/octet-stream for the response.
It was considered to use content-negotiation instead of the "format" parameter. However, content-negotiation typically uses common mime-types and for many of the formats usually used by annotation editors, there are no suitable mime-types. E.g. one could use "text/tab-separated-values" for CoNLL formats, but that would not convey sufficient information about the semantics of the columns to enable the import/export of the document / which specific CoNLL year to use. |
Title |
Export document |
||
URL |
|
||
Method |
GET |
||
Consumes |
none |
||
Produces |
|
||
URL params |
|
||
Data params |
|
||
Success response |
|
||
Error response |
|
Delete Document
Delete a document from the project. Deleting the document also deletes all annotations on the document.
Title |
Delete document |
||
URL |
|
||
Method |
DELETE |
||
Consumes |
none |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
|
||
Data params |
none |
||
Success response |
|
||
Error response |
|
Annotations
List Annotations
List annotations in the project.
Title |
List annotations |
||
URL |
|
||
Method |
GET |
||
Consumes |
none |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
|
||
Data params |
none |
||
Success response |
|
||
Error response |
|
Create Annotations
Create/import annotations on top of an already existing document. We consider here only the simple case which is that if there are already any existing annotations for the designated user, they will be replaced with the annotations that are uploaded - they will not be merged.
Title |
Create annotations |
||||
URL |
|
||||
Method |
POST |
||||
Consumes |
application/octet-stream |
||||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||||
URL params |
|
||||
Data params |
|
||||
Success response |
|
||||
Error response |
|
Read Annotations
Read/export annotations for a document.
Title |
Read annotations |
||
URL |
|
||
Method |
GET |
||
Consumes |
none |
||
Produces |
|
||
URL params |
|
||
Data params |
none |
||
Success response |
|
||
Error response |
|
Delete Annotations
Delete the annotations of a user on a given document from a project.
Title |
Delete annotations |
||
URL |
|
||
Method |
DELETE |
||
Consumes |
none |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
|
||
Data params |
none |
||
Success response |
|
||
Error response |
|
Curations
List Curations
There is no dedicated call to list curations. The status of the curation process is tracked at the document level and is available via the "list documents" call.
Create Curations
Create/import curated annotations for a document.
Title |
Create curations |
||
URL |
|
||
Method |
POST |
||
Consumes |
application/octet-stream |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
|
||
Data params |
|
||
Success response |
|
||
Error response |
|
Read Curations
Read/export curated annotations for a document.
Title |
Read curations |
||
URL |
|
||
Method |
GET |
||
Consumes |
none |
||
Produces |
|
||
URL params |
|
||
Data params |
none |
||
Success response |
|
||
Error response |
|
Delete Curations
Delete curated annotations for a document.
Title |
Delete curations |
||
URL |
|
||
Method |
DELETE |
||
Consumes |
application/octet-stream |
||
Produces |
application/json;charset=UTF-8 (AERO JSON response) |
||
URL params |
|
||
Data params |
none |
||
Success response |
|
||
Error response |
|