diff --git a/_includes/links.md b/_includes/links.md index 0f7620a31..793eb7bf6 100644 --- a/_includes/links.md +++ b/_includes/links.md @@ -66,6 +66,7 @@ [0283]: {{ site.cookbook_url | absolute_url }}/recipe/0283-missing-image/ "Missing Images in a Sequence" [0306]: {{ site.cookbook_url | absolute_url }}/recipe/0306-linking-annotations-to-manifests/ "Linking external Annotations targeting a Canvas to a Manifest" +[0309]: {{ site.cookbook_url | absolute_url }}/recipe/0309-annotation-collection/ "Using Annotation Collections" [0318]: {{ site.cookbook_url | absolute_url }}/recipe/0318-navPlace-navDate/ "Locating an Item in Place and Time" [0326]: {{ site.cookbook_url | absolute_url }}/recipe/0326-annotating-image-layer/ "Annotate a specific images or layers" diff --git a/index.md b/index.md index c868e6fb7..ec1168a44 100644 --- a/index.md +++ b/index.md @@ -92,6 +92,7 @@ _(leading on to segmentation examples later)_ * [Geographic coordinates][0139] * [Embedded or Referenced Annotations][0269] * [Linking external Annotations targeting a Canvas to a Manifest][0306] +* [Using Annotation collections][0309] * [Image in annotations][0377] * [Annotating in Multiple Languages][0346] diff --git a/recipe/0309-annotation-collection/anno_coll.json b/recipe/0309-annotation-collection/anno_coll.json new file mode 100644 index 000000000..2df69974a --- /dev/null +++ b/recipe/0309-annotation-collection/anno_coll.json @@ -0,0 +1,13 @@ +{ + "@context": "http://iiif.io/api/presentation/3/context.json", + "id": "{{ id.url }}", + "type": "AnnotationCollection", + "label": { + "en": [ + "Newspaper layout markup" + ] + }, + "total": 8, + "first": "{{ id.path }}/anno_p1.json", + "last": "{{ id.path }}/anno_p2.json" +} diff --git a/recipe/0309-annotation-collection/anno_p1.json b/recipe/0309-annotation-collection/anno_p1.json new file mode 100644 index 000000000..18f1ac0b3 --- /dev/null +++ b/recipe/0309-annotation-collection/anno_p1.json @@ -0,0 +1,116 @@ +{ + "@context": "http://iiif.io/api/presentation/3/context.json", + "id": "{{ id.url }}", + "type": "AnnotationPage", + "partOf": [{ + "id": "{{ id.path }}/anno_coll.json", + "type": "AnnotationCollection" + }], + "next": "{{ id.path }}/anno_p2.json", + "items": [ + { + "id": "{{ id.url }}-1", + "type": "Annotation", + "motivation": "tagging", + "body": { + "type": "TextualBody", + "format": "text/plain", + "value": "text-1-1" + }, + "target": { + "type": "SpecificResource", + "source": { + "id": "{{ id.path }}/canvas/p1", + "type": "Canvas", + "partOf": [{ + "id": "{{ id.path }}/manifest.json", + "type": "Manifest" + }] + }, + "selector": { + "type": "FragmentSelector", + "conformsTo": "http://www.w3.org/TR/media-frags/", + "value": "xywh=88,957,2768,248" + } + } + }, + { + "id": "{{ id.url }}-2", + "type": "Annotation", + "motivation": "tagging", + "body": { + "type": "TextualBody", + "format": "text/plain", + "value": "text-1-2" + }, + "target": { + "type": "SpecificResource", + "source": { + "id": "{{ id.path }}/canvas/p1", + "type": "Canvas", + "partOf": [{ + "id": "{{ id.path }}/manifest.json", + "type": "Manifest" + }] + }, + "selector": { + "type": "FragmentSelector", + "conformsTo": "http://www.w3.org/TR/media-frags/", + "value": "xywh=80,1181,928,3384" + } + } + }, + { + "id": "{{ id.url }}-3", + "type": "Annotation", + "motivation": "tagging", + "body": { + "type": "TextualBody", + "format": "text/plain", + "value": "text-1-3" + }, + "target": { + "type": "SpecificResource", + "source": { + "id": "{{ id.path }}/canvas/p1", + "type": "Canvas", + "partOf": [{ + "id": "{{ id.path }}/manifest.json", + "type": "Manifest" + }] + }, + "selector": { + "type": "FragmentSelector", + "conformsTo": "http://www.w3.org/TR/media-frags/", + "value": "xywh=1000,2693,1880,1824" + } + } + }, + { + "id": "{{ id.url }}-4", + "type": "Annotation", + "motivation": "tagging", + "body": { + "type": "TextualBody", + "format": "text/plain", + "value": "text-2" + }, + "target": { + "type": "SpecificResource", + "source": { + "id": "{{ id.path }}/canvas/p1", + "type": "Canvas", + "partOf": [{ + "id": "{{ id.path }}/manifest.json", + "type": "Manifest" + }] + }, + "selector": { + "type": "FragmentSelector", + "conformsTo": "http://www.w3.org/TR/media-frags/", + "value": "xywh=992,1213,1904,1472" + } + } + } + ] +} diff --git a/recipe/0309-annotation-collection/anno_p2.json b/recipe/0309-annotation-collection/anno_p2.json new file mode 100644 index 000000000..b34f4551e --- /dev/null +++ b/recipe/0309-annotation-collection/anno_p2.json @@ -0,0 +1,116 @@ +{ + "@context": "http://iiif.io/api/presentation/3/context.json", + "id": "{{ id.url }}", + "type": "AnnotationPage", + "partOf": [{ + "id": "{{ id.path }}/anno_coll.json", + "type": "AnnotationCollection" + }], + "prev": "{{ id.path }}/anno_p1.json", + "items": [ + { + "id": "{{ id.url }}-1", + "type": "Annotation", + "motivation": "tagging", + "body": { + "type": "TextualBody", + "format": "text/plain", + "value": "text-3-1" + }, + "target": { + "type": "SpecificResource", + "source": { + "id": "{{ id.path }}/canvas/p2", + "type": "Canvas", + "partOf": [{ + "id": "{{ id.path }}/manifest.json", + "type": "Manifest" + }] + }, + "selector": { + "type": "FragmentSelector", + "conformsTo": "http://www.w3.org/TR/media-frags/", + "value": "xywh=856,381,928,4200" + } + } + }, + { + "id": "{{ id.url }}-2", + "type": "Annotation", + "motivation": "tagging", + "body": { + "type": "TextualBody", + "format": "text/plain", + "value": "text-3-2" + }, + "target": { + "type": "SpecificResource", + "source": { + "id": "{{ id.path }}/canvas/p2", + "type": "Canvas", + "partOf": [{ + "id": "{{ id.path }}/manifest.json", + "type": "Manifest" + }] + }, + "selector": { + "type": "FragmentSelector", + "conformsTo": "http://www.w3.org/TR/media-frags/", + "value": "xywh=1784,2461,952,2064" + } + } + }, + { + "id": "{{ id.url }}-3", + "type": "Annotation", + "motivation": "tagging", + "body": { + "type": "TextualBody", + "format": "text/plain", + "value": "text-3-3" + }, + "target": { + "type": "SpecificResource", + "source": { + "id": "{{ id.path }}/canvas/p2", + "type": "Canvas", + "partOf": [{ + "id": "{{ id.path }}/manifest.json", + "type": "Manifest" + }] + }, + "selector": { + "type": "FragmentSelector", + "conformsTo": "http://www.w3.org/TR/media-frags/", + "value": "xywh=2736,2485,816,2064" + } + } + }, + { + "id": "{{ id.url }}-4", + "type": "Annotation", + "motivation": "tagging", + "body": { + "type": "TextualBody", + "format": "text/plain", + "value": "text-4" + }, + "target": { + "type": "SpecificResource", + "source": { + "id": "{{ id.path }}/canvas/p2", + "type": "Canvas", + "partOf": [{ + "id": "{{ id.path }}/manifest.json", + "type": "Manifest" + }] + }, + "selector": { + "type": "FragmentSelector", + "conformsTo": "http://www.w3.org/TR/media-frags/", + "value": "xywh=1792,373,1744,2064" + } + } + } + ] +} diff --git a/recipe/0309-annotation-collection/diagram-309.graffle b/recipe/0309-annotation-collection/diagram-309.graffle new file mode 100644 index 000000000..4e22f43a4 Binary files /dev/null and b/recipe/0309-annotation-collection/diagram-309.graffle differ diff --git a/recipe/0309-annotation-collection/diagram-309.png b/recipe/0309-annotation-collection/diagram-309.png new file mode 100644 index 000000000..c48d41db1 Binary files /dev/null and b/recipe/0309-annotation-collection/diagram-309.png differ diff --git a/recipe/0309-annotation-collection/index.md b/recipe/0309-annotation-collection/index.md new file mode 100644 index 000000000..f4669dab0 --- /dev/null +++ b/recipe/0309-annotation-collection/index.md @@ -0,0 +1,62 @@ +--- +title: Grouping Annotations into Collections +id: 309 +layout: recipe +tags: [tbc] +summary: "tbc" +viewers: +topic: + - basic +--- + +## 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. + +## Implementation Notes + +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 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 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 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. + +
+
+
Berliner Tageblatt - Staatsbibliothek zu Berlin - Preußischer Kulturbesitz. Public Domain Mark - http://creativecommons.org/publicdomain/mark/1.0/
" + ] + } + }, + "items": [ + { + "id": "{{ id.path }}/canvas/p1", + "type": "Canvas", + "label": { + "none": [ + "p. 1" + ] + }, + "height": 5000, + "width": 3602, + "items": [ + { + "id": "{{ id.path }}/annotation_page_painting/ap1", + "type": "AnnotationPage", + "items": [ + { + "id": "{{ id.path }}/annotation/p1", + "type": "Annotation", + "motivation": "painting", + "body": { + "id": "https://iiif.io/api/image/3.0/example/reference/4ce82cef49fb16798f4c2440307c3d6f-newspaper-p1/full/max/0/default.jpg", + "type": "Image", + "format": "image/jpeg", + "service": [ + { + "id": "https://iiif.io/api/image/3.0/example/reference/4ce82cef49fb16798f4c2440307c3d6f-newspaper-p1", + "type": "ImageService3", + "profile": "level1" + } + ] + }, + "target": "{{ id.path }}/canvas/p1" + } + ] + } + ], + "annotations": [ + { + "id": "{{ id.path }}/anno_p1.json", + "type": "AnnotationPage", + "partOf": [{ + "id": "{{ id.path }}/anno_coll.json", + "type": "AnnotationCollection", + "label": { + "en": [ + "Newspaper layout markup" + ] + }, + "total": 8, + "first": "{{ id.path }}/anno_p1.json", + "last": "{{ id.path }}/anno_p2.json" + }], + "next": "{{ id.path }}/anno_p2.json" + } + ] + }, + { + "id": "{{ id.path }}/canvas/p2", + "type": "Canvas", + "label": { + "none": [ + "p. 2" + ] + }, + "height": 5000, + "width": 3602, + "items": [ + { + "id": "{{ id.path }}/annotation_page_painting/ap2", + "type": "AnnotationPage", + "items": [ + { + "id": "{{ id.path }}/annotation/p2", + "type": "Annotation", + "motivation": "painting", + "body": { + "id": "https://iiif.io/api/image/3.0/example/reference/4ce82cef49fb16798f4c2440307c3d6f-newspaper-p2/full/max/0/default.jpg", + "type": "Image", + "format": "image/jpeg", + "service": [ + { + "id": "https://iiif.io/api/image/3.0/example/reference/4ce82cef49fb16798f4c2440307c3d6f-newspaper-p2", + "type": "ImageService3", + "profile": "level1" + } + ] + }, + "target": "{{ id.path }}/canvas/p2" + } + ] + } + ], + "annotations": [ + { + "id": "{{ id.path }}/anno_p2.json", + "type": "AnnotationPage", + "partOf": [{ + "id": "{{ id.path }}/anno_coll.json", + "type": "AnnotationCollection", + "label": { + "en": [ + "Newspaper layout markup" + ] + }, + "total": 8, + "first": "{{ id.path }}/anno_p1.json", + "last": "{{ id.path }}/anno_p2.json" + }], + "prev": "{{ id.path }}/anno_p1.json" + } + ] + } + ] +}