Preliminaries

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14, RFC2119 and RFC8174 when, and only when, they appear in all capitals, as shown here.

This document is licensed under CC-BY-ND-4.0 (via SPDX).

The style of this documentation is adapted from OpenAPI 3.0.2 specification.

Status of this Document

The current version of this document is 1.0.0.

The version number will be applied according to Semantic Versioning 2.0.0.

Definitions

W3C Annotations

The AnnotationAPI is an implementation of the W3C Annotation Model. This means that we provide an Annotation Collection per resource and Annotation Pages for each Annotation Collection.

The W3C specs, however, don’t assume hierarchical/nested resources as we have in the IIIF derived TextAPI model, which states in the case of Ahiqar that we have a collection of texts (Collection Object), single manuscripts (Manifest Object) and pages within that manuscript (Item Object).

In order to bring these two approaches together, all Objects of the TextAPI (Collection/Manifest/Item) provide an endpoint for delivering an Annotation Collection. These list the next level items (Collection → Manifest, Manifest → Item, Item → Item) as Annotation Pages including all annotations on that level. Since Collection Objects are on the top of the hierarchy there aren’t any Annotation Pages provided for them.

Additions to the W3C model are marked with an x-.

Cardinalities

Cardinality Description REQUIRED
1 exactly one yes
+ one or more yes
? zero or one no
* zero or more no

Data Types

Type Description
[…] array
string a sequence of characters, MAY be empty
URI a valid URI, see URI Syntax
MIME type a valid MIME type according to IANA. See MDN
iso639-3 alpha-3 language code according to ISO 639-3. In cases of alternative codes the usage of bibliographic (B) is REQUIRED.
int a non-negative Integer value

URI Syntax

The URI Syntax is used according to the one described at IIIF.

Delivery Service / Available Endpoints

The AnnotationAPI delivery service is the description of endpoints. All endpoints use the https protocol.

Annotations for Collection Objects

https://ahikar.sub.uni-goettingen.de/api/textapi/ahikar/{$collection}/annotationCollection.json

Returns an Annotation Collection for the given collection.

Annotations for Manifest Objects

https://ahikar.sub.uni-goettingen.de/api/textapi/ahikar/{$collection}/{$manifest}/annotationCollection.json

Returns an Annotation Collection for the given manifest.


https://ahikar.sub.uni-goettingen.de/api/textapi/ahikar/{$collection}/{$manifest}/annotationPage.json

Returns an Annotation Page for the given manifest.

Annotations for Item Objects

https://ahikar.sub.uni-goettingen.de/api/textapi/ahikar/{$collection}/{$manifest}/{$page}/annotationCollection.json

Returns an Annotation Collection for the given item.


https://ahikar.sub.uni-goettingen.de/api/textapi/ahikar/{$collection}/{$manifest}/{$page}/annotationPage.json

Returns an Annotation Collection for the given item.

Schema

Annotation Collection

An Annotation Collection presents an overview of the Annotation Pages provided for a given resource.

In case of Ahiqar we deliver Annotation Collections for Collection, Manifest, and Item Objects at said endpoints.

Field Name Cardinality Type Description
@context 1 URI equals http://www.w3.org/ns/anno.jsonld in any case
id 1 URI a unique identifier for the Annotation Collection in the form of http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationCollection/{$collection-URI}
type 1 string equals “AnnotationCollection” in any case
label 1 string a descriptive title for the Annotation Collection
x-creator 1 [string] a string or sequence of strings stating the creator(s) of the resource to which the Annotation Collection belongs to. this information is taken from tei:editor in the TEI header of the resource
first 1 URI an URI pointing to the API endpoint of the first Annotation Page of this Collection
last 1 URI an URI pointing to the API endpoint of the last Annotation Page of this Collection. identical to first if the collection has only one Annotation Page

Annotation Page

An Annotation Page lists all annotations that occur on them while linking to the previous and next Annotation Pages within an Annotation Collection.

In case of Ahiqar we deliver Annotation Collections for Collection, Manifest, and Item Objects at said endpoints.

Field Name Cardinality Type Description
@context 1 URI equals http://www.w3.org/ns/anno.jsonld in any case
id 1 URI a unique identifier for the Annotation Collection in the form of http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationCollection/{$collection-URI}/{$manifest-URI}
type 1 string equals “AnnotationPage” in any case
partOf 1 [PartOf Object] information about the Annotation Collection the pPage is part of
next 1 URI an URI pointing to the API endpoint of the next Annotation Page of this Annotation Collection. MAY be null if there is no following Page
prev 1 URI an URI pointing to the API endpoint of the previous Annotation Page of this Annotation Collection. MAY be null if there is no previous Page
items 1 [Annotation Item Object] a sequence of annotations

PartOf Object

Represents a relation between an Annotation Page and an Annotation Collection. MUST be a field in an Annotation Page. Contains information about the Page’s parent Annotation Collection.

Field Name Cardinality Type Description
id 1 URI a unique identifier for the Annotation Collection in the form of http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationCollection/{$collection-URI}
label 1 string a descriptive title for the Annotation Collection

Annotation Item Object

A sequence of annotations belonging to an Annotation Page.

Field Name Cardinality Type Description
body 1 [Body Object] the content of the annotation
target 1 Target Object information about the target of the annotation
type 1 string MUST be Annotation
id 1 URI a unique identifier for the annotation in the form of http://ahikar.sub.uni-goettingen.de/ns/annotations/{$resource-URI}/{$node-ID}. {$node-ID} refers to the ID of the TEI node from which the annotation has been extracted

Body Object

The content of the annotation.

Field Name Cardinality Type Description
type 1 string MUST be TextualBody
value 1 string the content of the annotation
format 1 MIME type MUST be text/plain since we only provide a string as the annotation content
x-content-type 1 string the semantic type of the annotation. MUST be one of the following: Person, Place, Motif, Editorial Comment, Reference, Variant.

Target Object

Provides information about the target node or text the annotation refers to.

Field Name Cardinality Type Description
id 1 URI a unique identifier for the target node or text in the form of http://ahikar.sub.uni-goettingen.de/ns/annotations/{$resource-URI}/{$node-ID}. {$node-ID} refers to the ID of the target’s TEI node
format 1 MIME type equals text/xml in any case since the annotations always refer to TEI documents
language 1 iso639-3 the language of the target node’s text or the target text

Revision History / Changelog

Version Date Description
1.0.0 2020-07-16 initial version
2.0.0 2020-11-13 update REST path for items
3.0.0 2021-06-08 remove total and startIndex

Appendix

Class Diagram

UML class diagram

// Ahiqar AnnotationAPI
// ------------------

// classes
[Annotation Collection|entrypoint|- id 1; -type 1; -label 1; -creator 1; -first 1; -last 1 {bg:yellow}]

[Annotation Page|entrypoint| -@context 1; -id 1; -partOf 1; -next 1; -prev 1; -items 1 {bg:yellow}]

// objects
[PartOf|-id 1; -label 1]

[Annotation Item| -body 1; -@context 1; -target 1; -type 1; -id 1]

[Target| -format 1; -language 1; -id 1]

[Body| -type 1; -value 1; -format 1; -x-content-type 1]

// imports
[Annotation Page]-[PartOf]
[Annotation Page]-[Annotation Item]

[Annotation Item]-[Target]
[Annotation Item]-[Body]

Examples

Annotation Collection: Example for Collection

http://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/annotationCollection.json

{
  "annotationCollection" : {
    "@context" : "http://www.w3.org/ns/anno.jsonld",
    "first" : "https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7nv/annotationPage.json",
    "label" : "Ahikar annotations for textgrid:arabic-karshuni: The Arabic and Karshuni Collections",
    "last" : "https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r17d/annotationPage.json",
    "x-creator" : "Simon Birol, Aly Elrefaei, Salhani, Anton",
    "type" : "AnnotationCollection",
    "id" : "http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationCollection/arabic-karshuni"
  }
}

Annotation Collection: Example for Manifest

https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7nv/annotationCollection.json

{
  "annotationCollection" : {
    "@context" : "http://www.w3.org/ns/anno.jsonld",
    "first" : "https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7nv/264v/annotationPage.json",
    "label" : "Ahikar annotations for textgrid:3r7nv: Vat. Syriac 199",
    "last" : "https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7nv/283v/annotationPage.json",
    "x-creator" : "Simon Birol, Aly Elrefaei",
    "type" : "AnnotationCollection",
    "id" : "http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationCollection/3r7nv"
  }
}

Annotation Collection: Example for Item

https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7nv/264v/annotationCollection.json

{
  "annotationCollection" : {
    "@context" : "http://www.w3.org/ns/anno.jsonld",
    "first" : "https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7nv/264v/annotationPage.json",
    "label" : "Ahikar annotations for textgrid:3r7nv: Vat. Syriac 199, page 264v",
    "x-creator" : "Simon Birol, Aly Elrefaei",
    "type" : "AnnotationCollection",
    "id" : "http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationCollection/3r7nv/264v"
  }
}

Annotation Page: Example for Manifest

https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7nv/annotationPage.json

{
  "annotationPage": {
    "items": [
      {
        "body": {
          "type": "TextualBody",
          "value": "A person's name.",
          "format": "text/plain",
          "x-content-type": "Person"
        },
        "target": {
          "format": "text/xml",
          "language": "ara",
          "id": "http://ahikar.sub.uni-goettingen.de/ns/annotations/3r7nt/N4.4.2.6.4.12.2"
        },
        "type": "Annotation",
        "id": "http://ahikar.sub.uni-goettingen.de/ns/annotations/3r7nt/annotation-N4.4.2.6.4.12.2"
      }
    ],
    "partOf": {
      "label": "Ahikar annotations for arabic-karshuni",
      "id": "http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationCollection/3r9ps"
    },
    "@context" : "http://www.w3.org/ns/anno.jsonld",
    "prev" : null,
    "next" : "https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7p9/annotationPage.json",
    "id" : "http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationPage/arabic-karshuni/3r7nt"
  }
}

Annotation Page: Example for Item

https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7nv/264v/annotationPage.json

{
  "annotationPage": {
    "items": [
      {
        "body": {
          "type": "TextualBody",
          "value": "A person's name.",
          "format": "text/plain",
          "x-content-type": "Person"
        },
        "target": {
          "format": "text/xml",
          "language": "ara",
          "id": "http://ahikar.sub.uni-goettingen.de/ns/annotations/3r7nt/N4.4.2.6.4.18.2"
        },
        "type": "Annotation",
        "id": "http://ahikar.sub.uni-goettingen.de/ns/annotations/3r7nt/annotation-N4.4.2.6.4.18.2"
      }
    ],
    "partOf": {
      "label": "Ahikar annotations for textgrid:3r7nv: Vat. Syriac 199",
      "id": "http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationCollection/3r7nv"
    },
    "@context" : "http://www.w3.org/ns/anno.jsonld",
    "prev" : null,
    "next" : "https://ahikar-dev.sub.uni-goettingen.de/api/annotations/ahikar/arabic-karshuni/3r7nv/264r/annotationPage.json",
    "type" : "AnnotationPage",
    "id" : "http://ahikar.sub.uni-goettingen.de/ns/annotations/annotationPage/arabic-karshuni/3r7nv-264v"
  }
}