Skip to content

Commit

Permalink
updated with feedback from editors.
Browse files Browse the repository at this point in the history
  • Loading branch information
robcast committed Oct 25, 2024
1 parent e6e65f1 commit 37b664f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
26 changes: 13 additions & 13 deletions recipe/0309-annotation-collection/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Using Annotation Collections
title: Grouping Annotations into Collections
id: 309
layout: recipe
tags: [tbc]
Expand All @@ -11,21 +11,21 @@ topic:

## Use Case

You have a large number of Annotations covering multiple Canvases in a Manifest, for example crowd-sourced transcriptions or the output from a layout analysis algorithm and you want the Annotations to be displayed in a viewer as a recognizable group over the document with a label and a common color.
You have a large number of Annotations covering multiple Canvases in a Manifest, for example crowd-sourced transcriptions or the output from a layout analysis algorithm, and you want the Annotations to be displayed in a viewer as a recognizable group over the document with a label and a common color.

## Implementation Notes

The [IIIF Presentation API 3](https://iiif.io/api/presentation/3.0/#58-annotation-collection) defines the AnnotationCollection as a mechanism to represent groupings of AnnotationPages that should be managed as a single whole, regardless of which Canvas or resource they target. The AnnotationCollection is a separate document that references a chain of one or more separate AnnotationPages containing the Annotations. The AnnotationPages contain a reference to the parent AnnotationCollection and a reference to the next page in the chain.
The [IIIF Presentation API 3](https://iiif.io/api/presentation/3.0/#58-annotation-collection) defines Annotation Collections as a mechanism to represent groupings of Annotation Pages that should be managed as a single whole, regardless of which Canvas or resource they target. The Annotation Collection is a separate document that references a chain of one or more separate Annotation Pages which contain the Annotations. The Annotation Pages contain a reference to the parent Annotation Collection and a reference to the next page in the chain.

The AnnotationCollection should have a `label` property that can be shown to the user and it can optionally contain additional properties as specified in the [IIIF Presentation API 3](https://iiif.io/api/presentation/3.0/#a-summary-of-property-requirements).
The Annotation Collection must have a `type` of "AnnotationCollection" and should have a `label` property that can be shown to the user and it can optionally contain additional properties as specified in the [IIIF Presentation API 3](https://iiif.io/api/presentation/3.0/#a-summary-of-property-requirements).

The AnnotationCollection has a `first` property that contains the URI of the first AnnotationPage in the sequence, a `last` property that contains the URI of the last AnnotationPage and it should have a `total` property that contains the total number of Annotations in the collection.
The Annotation Collection has a `first` property that contains the URI of the first Annotation Page in the sequence, a `last` property that contains the URI of the last Annotation Page and it should have a `total` property that contains the total number of Annotations in the collection.

The IIIF Manifest requires that Annotations that should be shown on a Canvas are contained in AnnotationPages referenced in the `annotations` property of that Canvas. This means that all Annotations need to be grouped by Canvas and put into one or more AnnotationPages per Canvas. An AnnotationPage can not contain Annotations for more than one Canvas.
The IIIF Manifest requires that Annotations that are intended to be shown on a Canvas are contained in Annotation Pages referenced in the `annotations` property of that Canvas. This means that all Annotations need to be grouped by Canvas and put into one or more Annotation Pages per Canvas. An Annotation Page can not contain Annotations for more than one Canvas.

The AnnotationPages have an `items` property containing the list of Annotations, a `partOf` property that contains the URI of the parent AnnotationCollection, and `next` and `prev` properties that contain the URIs of the next and previous AnnotationPages in the sequence. AnnotationPages are often separate documents that are [referenced][0269] in the manifest using a reference object that can additionally provide some properties for access inside the manifest.
The Annotation Pages must have a `type` of "AnnotationPage" and have an `items` property containing the list of Annotations, a `partOf` property that contains the URI of the parent Annotation Collection, and `next` and `prev` properties that contain the URIs of the next and previous Annotation Pages in the sequence. Annotation Pages are often separate documents that are [referenced][0269] in the manifest using a reference object that can additionally provide some properties for access inside the manifest.

A IIIF viewer that displays Annotations on a Canvas follows the URIs in the `annotations` property of the Canvas and loads the Annotations in the referenced AnnotationPages. If the viewer wants to indicate that these Annotations belong to one or more AnnotationCollections it has to follow the URI in the `partOf` property of the AnnotationPages to identify the AnnotationCollection and display its label and choose a common color for the Annotations. The indirect connection from the Manifest to the AnnotationCollection means that a viewer would have to load all AnnotationPages from all Canvases if it wants to present a complete list of all AnnotationCollections in the Manifest to the user. This potentially slow process can be avoided if the `partOf`, `next`, and `prev` properties of the AnnotationPages are provided in the reference object inside the Manifest like in the example below.
A IIIF viewer that displays Annotations on a Canvas follows the URIs in the `annotations` property of the Canvas and loads the Annotations in the referenced Annotation Pages. If the viewer wants to indicate that these Annotations belong to one or more Annotation Collections it has to follow the URI in the `partOf` property of the Annotation Pages to identify the Annotation Collection and display its label and choose a common color for the Annotations. The indirect connection from the Manifest to the Annotation Collection means that a viewer would have to load all Annotation Pages from all Canvases if it wants to present a complete list of all Annotation Collections in the Manifest to the user. This potentially slow process can be avoided if the `partOf`, `next`, `prev` properties of the Annotation Pages are provided in the reference object inside the Manifest and also the relevant properties of the Annotation Collection and provided in the `partOf` reference object like in the example below.

## Example

Expand All @@ -39,15 +39,15 @@ The AnnotationCollection referencing the AnnotationPages:

{% include jsonviewer.html src="anno_coll.json" %}

The Manifest containing the two Canvases and referencing the AnnotationPages:
The first AnnotationPage with Annotations on the first Canvas: [anno_p1.json](anno_p1.json)

{% include manifest_links.html viewers="" manifest="manifest.json" %}
The second AnnotationPage with Annotations on the second Canvas: [anno_p2.json](anno_p2.json)

{% include jsonviewer.html src="manifest.json" %}
The Manifest containing the two Canvases and referencing the AnnotationPages:

The first AnnotationPage with Annotations on the first Canvas: [anno_p1.json](anno_p1.json)
{% include manifest_links.html viewers="" manifest="manifest.json" config='data-line="66-77,121-131"' %}

The second AnnotationPage with Annotations on the second Canvas: [anno_p2.json](anno_p2.json)
{% include jsonviewer.html src="manifest.json" %}

## Related Recipes

Expand Down
16 changes: 14 additions & 2 deletions recipe/0309-annotation-collection/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@
"type": "AnnotationPage",
"partOf": [{
"id": "{{ id.path }}/anno_coll.json",
"type": "AnnotationCollection"
"type": "AnnotationCollection",
"label": {
"en": [
"Newspaper layout markup"
]
},
"total": 8
}],
"next": "{{ id.path }}/anno_p2.json"
}
Expand Down Expand Up @@ -113,7 +119,13 @@
"type": "AnnotationPage",
"partOf": [{
"id": "{{ id.path }}/anno_coll.json",
"type": "AnnotationCollection"
"type": "AnnotationCollection",
"label": {
"en": [
"Newspaper layout markup"
]
},
"total": 8
}],
"prev": "{{ id.path }}/anno_p1.json"
}
Expand Down

0 comments on commit 37b664f

Please sign in to comment.