翻译者:宋杰

原文链接:https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/

译文:

用例

你想使用大量的注释,但要分别存储它们,以确保清单不会变得太大。

实现说明

画布的注释以注释页对象的形式存储在画布的注释属性中,其中包含符合 W3C 网络注释数据模型的注释对象列表。
注释页和注释既可以嵌入到清单中(如最简单的注释示例),也可以通过将注释页存储在一个单独的文档中并将该文档的 URI 放到清单中来引用(如下面的示例)。
将清单和注解分开的好处是,清单可以是一个较小的文件,加载速度更快,这样查看器就可以更快地开始显示其内容,另外还可以根据用户的互动和当前视图决定是否以及何时加载Canvas的注解。
另一方面,嵌入式注解的优点是,查看器不必进行额外的HTTPS请求,因此可以更快地显示注解。查看器应该同样对待嵌入式注释和引用的注释,但是IIIF Presentation API 3提到查看器应该按照Manifest中给出的顺序来处理注释,发布者可以将嵌入式注释页排在引用页之前,以加快其处理速度。
外部注释页在 Canvas 的注释 annotations 属性中被一个引用对象引用,该对象的 id 属性包含外部文档的 URI,type 属性包含 “AnnotationPage”。该引用对象不能包含一个项目 items 属性。
外部的注释页文档必须有:

注释页中的每个注释必须有一个带有唯一标识符的 id 属性、一个 “注释 “类型 type、一个目标 target 和一个正文 body 。所有注释的目标 target 应该是Canvas的URI,它包含对注释页的引用(见IIIF Presentation API 3)。这意味着,你想注释的每个 Canvas 都应该有一个(或多个)注释页文件。
注释的目标 target 可以是画布的URI,如果你想注释整个画布(如最简单的注释),或者是URI,如果你想注释画布的一个区域(如简单注释—标签),在最后加上一个媒体片段,或者是更复杂的选择器(如用非矩形多边形注释)。
主体 body 可以是一个URI,也可以是一个遵循W3C网络注释规范的更复杂的对象。一个常用的模型是嵌入式文本主体,如下面的例子。

示例

这个例子的Manifest包含一个被引用的注释 commenting ,其中包含 “Göttinger Marktplatz mit Gänseliesel Brunnen “的文字,其动机是针对整个Canvas的注释。注释是包含在额外的注释页文件中的注释页的单一项目,该文件在 Canvas 的注释 annotations 属性中被引用。

注释的主体 body 是一个类型为 “TextualBody “的对象,它在值 value 属性中包含文本,在格式 format 属性中指定文本字符串的格式(”text/plain”),在语言 language 属性中指定语言(德语为 “de”)。

注释的目标 target 只是Canvas的URI,所以注释指的是整个Canvas。

这个引用的注释的渲染应该与最简单的注释中的嵌入式注释几乎没有区别。请注意,当你把鼠标放在侧边栏中的注释上时,Mirador不会在图像上加亮,因为注释是以整个画布为目标的。

清单文件

JSON-LD | 在Mirador中查看

  1. {
  2. "@context": "http://iiif.io/api/presentation/3/context.json",
  3. "id": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/manifest.json",
  4. "type": "Manifest",
  5. "label": {
  6. "en": [
  7. "Picture of Göttingen taken during the 2019 IIIF Conference"
  8. ]
  9. },
  10. "items": [
  11. {
  12. "id": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/canvas-1",
  13. "type": "Canvas",
  14. "height": 3024,
  15. "width": 4032,
  16. "items": [
  17. {
  18. "id": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/canvas-1/annopage-1",
  19. "type": "AnnotationPage",
  20. "items": [
  21. {
  22. "id": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/canvas-1/annopage-1/anno-1",
  23. "type": "Annotation",
  24. "motivation": "painting",
  25. "body": {
  26. "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/full/max/0/default.jpg",
  27. "type": "Image",
  28. "format": "image/jpeg",
  29. "height": 3024,
  30. "width": 4032,
  31. "service": [
  32. {
  33. "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen",
  34. "profile": "level1",
  35. "type": "ImageService3"
  36. }
  37. ]
  38. },
  39. "target": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/canvas-1"
  40. }
  41. ]
  42. }
  43. ],
  44. "annotations": [
  45. {
  46. "id": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/annotationpage.json",
  47. "type": "AnnotationPage"
  48. }
  49. ]
  50. }
  51. ]
  52. }

标注页文件

JSON-LD

  1. {
  2. "@context": "http://iiif.io/api/presentation/3/context.json",
  3. "id": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/annotationpage.json",
  4. "type": "AnnotationPage",
  5. "items": [
  6. {
  7. "id": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/canvas-1/annopage-2/anno-1",
  8. "type": "Annotation",
  9. "motivation": "commenting",
  10. "body": {
  11. "type": "TextualBody",
  12. "language": "de",
  13. "format": "text/plain",
  14. "value": "Göttinger Marktplatz mit Gänseliesel Brunnen"
  15. },
  16. "target": "https://iiif.io/api/cookbook/recipe/0269-embedded-or-referenced-annotations/canvas-1"
  17. }
  18. ]
  19. }

相关专题

  • 最简单的注解—简单的嵌入式注解,对整个Canvas进行注解
  • 简单的注释 - 标记注释一个矩形的Canvas区域
  • 使用非矩形多边形的注释,注释画布上的不规则形状