Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recipe #0346 Support multiple languages in an Annotation body #472

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ff7ecc6
Added copy of template recipe ➕
triplingual Mar 22, 2024
ca4eba9
Added current recipe to links and TOC ➕
triplingual Apr 1, 2024
393719c
Took a first pass at creating the manifest ✏️
triplingual Apr 1, 2024
a1577e1
Shaped up metadata, links listing ✏️
triplingual Apr 30, 2024
cb8e823
Moved content toward actual values ✏️
triplingual Apr 30, 2024
1b4cd3b
Tightened up annotation boundaries
triplingual May 1, 2024
9551ca7
First pass at adding recipe narrative 📝
triplingual May 3, 2024
9c9d073
Changed motivation and conformed ID ✏️
triplingual May 3, 2024
b0f60be
Adjusted annotation boundaries slightly 📐
triplingual May 3, 2024
0469f0f
Removed two sentences that felt complicating 📝
triplingual May 3, 2024
451616a
Added credit metadata since as a courtesy to NICH 🧑‍⚖️
triplingual May 3, 2024
32f24e3
Removed inaccurate license 🚮
triplingual May 10, 2024
dd571fc
Merge branch 'master' into 0346-multilingual-annotation-body
triplingual May 10, 2024
1e84819
Replaced pointer to NICH version with pointer to IIIF version 🔄
triplingual May 10, 2024
a4a7ee4
Edited `metadata` section for accuracy and precision 📝
triplingual May 10, 2024
0f5e027
Made some of the editors' recommended changes so far 📝
triplingual May 17, 2024
68748aa
Removed credit info, replaced annotation translation 🚮🔄
triplingual May 17, 2024
b935697
Further edits from cookbook editors 📝
triplingual May 17, 2024
c3e11eb
Merge branch 'master' into 0346-multilingual-annotation-body
glenrobson Jun 12, 2024
2f1d162
Edited text based on cookbook editor comment 📝
triplingual Jun 12, 2024
7744157
Removed text per editor comment; added text to be parallel 🚮📝
triplingual Jun 12, 2024
93e7aac
Added text per editor comment 📝
triplingual Jun 12, 2024
3350113
Edited text both per editor comment and beyond 📝
triplingual Jun 12, 2024
252fe2c
Edited text for readability 📝
triplingual Jun 12, 2024
82763c6
Added #346 to related list per TRC ➕
triplingual Jul 22, 2024
58c5fba
Rewrote use case to be more generalizable and accurate per @zimeon 📝
triplingual Jul 22, 2024
4706df5
Merge branch 'master' into 0346-multilingual-annotation-body
triplingual Jul 22, 2024
cfb85b0
Added meaningless space to try to force a new build 📝
triplingual Jul 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _includes/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
[0326]: {{ site.cookbook_url | absolute_url }}/recipe/0326-annotating-image-layer/ "Annotate a specific images or layers"
[0306]: {{ site.cookbook_url | absolute_url }}/recipe/0306-linking-annotations-to-manifests/ "Linking external Annotations targeting a Canvas to a Manifest"

[0346]: {{ site.cookbook_url | absolute_url }}/recipe/0346-multilingual-annotation-body/ "Annotating in Multiple Languages"
[0377]: {{ site.cookbook_url | absolute_url }}/recipe/0377-image-in-annotation/ "Image in annotation"

[0466]: {{ site.cookbook_url | absolute_url }}/recipe/0466-link-for-loading-manifest/ "Loading a manifest with a viewer using a link"
Expand Down
1 change: 1 addition & 0 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ _(leading on to segmentation examples later)_
* [Embedded or Referenced Annotations][0269]
* [Linking external Annotations targeting a Canvas to a Manifest][0306]
* [Image in annotations][0377]
* [Annotating in Multiple Languages][0346]

## Internal structure

Expand Down
1 change: 1 addition & 0 deletions recipe/0118-multivalue/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ In this example, the work has multiple titles in both English and French. The Ma

* [Internationalization and Multi-language Values][0006]
* [Metadata][0029]
* [Annotating in Multiple Languages][0346]

{% include acronyms.md %}
{% include links.md %}
54 changes: 54 additions & 0 deletions recipe/0346-multilingual-annotation-body/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: Annotating in Multiple Languages
id: 346
layout: recipe
tags: annotation
summary: "tbc"
viewers:
- Annona
topic:
- annotation
---

## Use Case

You would like to make a text annotation in multiple languages on an image. Because the annotations are semantically equivalent, the expectation is that the user or client would choose which language to display for the annotation.

## Implementation Notes

To include language variation within any single annotation, combine the Choice structure, explained more fully in [Multiple Choice of Images][0033] and [Multiple Choice of Audio Formats][0434] with the appropriate annotation structure, for example the simple version shown in [Simple Annotation — Tagging][0021].

When there are multiple equivalent annotations from which a user or client should select one, we use the Choice structure. While much of the IIIF specification uses language maps to distinguish between languages, Annotations use a language property with a value. Clients may process this mechanisim for multiple languages differently to language maps and the web annotation specification gives the following guidance:

> "Clients MAY use any algorithm to determine which resource to choose, and SHOULD make use of the information present to do so automatically, but MAY present a list and require the user to make the decision." *— from [Choice Between Bodies](https://www.w3.org/TR/annotation-model/#choice-between-bodies)*

The `body` of an Annotation uses the Choice structure, with each of its items differing only in the `language` and `value` properties. Note that an annotation's `value` and `language` in a Choice are represented as separate properties, unlike Manifest properties that use language maps.

Somewhat as with the [Multiple Choice of Audio Formats][0434] recipe, the nature of the choice in this recipe is shared among the manifest creator, the visitor, and the client. The manifest creator defines the preferred order of languages by the top-to-bottom order of each `item` in the Choice structure. The visitor uses a client's interface elements to know what manifest data is available in multiple languages and which languages, as well as to make an active choice of which to display. A client may be programmed to take actions based on the W3C Web Annotation Data Model section on "Choice Between Bodies" cited above. If the client chooses to display a choice, the [W3C Web Annotation Data Model](https://www.w3.org/TR/annotation-model/) says it should only display one. By the same token, user experience with a client will be improved if a client indicates different language versions of an annotation even if it shows only one initially.

## Restrictions

None known.

## Example

In this example, the image is from one of a pair of six-fold screens depicting four noble accomplishments in Azuchi-Momoyama period Japan (16th/17th century CE). At its [original online home](https://emuseum.nich.go.jp/detail?langId=en&webView=&content_base_id=100320&content_part_id=0&content_pict_id=0) item text exists in four languages. To simplify things here, only Japanese and English are used.

There's one annotation, which focuses on the koto of the item's title (albeit enclosed in a cover and thus implied rather than shown). The text of the annotation takes that implication into account and describes this portion of the screen as representing a koto wrapped in a cloth.

Terms of use for this image from the e-Museum of the National Institutes for Cultural Heritage in Japan / e国宝に 独立行政法人国立文化財機構 can be found in <a href="https://emuseum.nich.go.jp/about?langId=ja">Japanese</a>, <a href="https://emuseum.nich.go.jp/about?langId=en">English</a>, <a href="https://emuseum.nich.go.jp/about?langId=zh">Chinese</a>, and <a href="https://emuseum.nich.go.jp/about?langId=ko">Korean</a>.

{% include manifest_links.html manifest="manifest.json" %}

{% include jsonviewer.html src="manifest.json" config='data-line="58-72"' %}

## Related Recipes

* [Multiple Choice of Images in a Single View (Canvas)][0033] to see the Choice structure in an image context
* [Multiple Choice of Audio Formats in a Single View (Canvas)][0033] to see the Choice structure in an A/V context
* [Simple Annotation — Tagging][0021] for an Annotation using the tagging `motivation`
* [Displaying Multiple Values with Language Maps][0118] to see a different way of casting a property value to a language.

{% include acronyms.md %}
{% include links.md %}

82 changes: 82 additions & 0 deletions recipe/0346-multilingual-annotation-body/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "{{ id.url }}",
"type": "Manifest",
"label": {
"en": [
"Koto, chess, calligraphy, and painting"
],
"ja": [
"琴棋書画図屏風"
]
},
"items": [
{
"id": "{{ id.path }}/canvas/p1",
"type": "Canvas",
"height": 31722,
"width": 70399,
"items": [
{
"id": "{{ id.path }}/page/p1/1",
"type": "AnnotationPage",
"items": [
{
"id": "{{ id.path }}/annotation/p0001-image",
"type": "Annotation",
"motivation": "painting",
"body": {
"id": "https://iiif.io/api/image/3.0/example/reference/36ca0a3370db128ec984b33d71a1543d-100320001004/full/full/0/default.jpg",
"type": "Image",
"format": "image/jpeg",
"height": 31722,
"width": 70399,
"service": [
{
"id": "https://iiif.io/api/image/3.0/example/reference/36ca0a3370db128ec984b33d71a1543d-100320001004",
"profile": "level1",
"type": "ImageService3"
}
]
},
"target": "{{ id.path }}/canvas/p1"
}
]
}
],
"annotations": [
{
"id": "{{ id.path }}/page/p2/1",
"type": "AnnotationPage",
"items": [
{
"id": "{{ id.path }}/annotation/p0001-comment",
"type": "Annotation",
"motivation": "commenting",
"body": [
{
"type": "Choice",
"items": [
{
"type": "TextualBody",
"value": "Koto with a cover being carried",
"language": "en",
"format": "text/plain"
},
{
"type": "TextualBody",
"value": "袋に収められた琴",
"language": "ja",
"format": "text/plain"
}
]
}
],
"target": "{{ id.path }}/canvas/p1#xywh=1650,1200,925,1250"
}
]
}
]
}
]
}
Loading