Skip to content

Instantly share code, notes, and snippets.

@regisrob
Last active December 13, 2023 06:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save regisrob/6aad48d622b50c11b7d0b8f01397e80f to your computer and use it in GitHub Desktop.
Save regisrob/6aad48d622b50c11b7d0b8f01397e80f to your computer and use it in GitHub Desktop.
Notes support pour la création d'un Manifest d'exemple

Manifest vide

  • id = à la fois identifiant URI et URL du Manifest
  • label = "titre" du manifest
  • items = séquence de canevas

Canvas 1 (sans api image)

  • id = identifiant du canvas (toujours la cible d'une annotation, au moins une : celle permettant de lui associer un contenu, ici une image)
  • width/height = ratio d'aspect (dimensions égales à l'image dans la plupart des cas)
  • AnnotationPage = liste d'annotations
  • Annotation = annotation de type "painting"
  • body de l'annotation = l'image elle-même (avec son format et ses dimensions en px)
  • target = cible de l'annotation (canvas)
{
  "id": "https://example.org/object1/canvas/1",
  "type": "Canvas",
  "height": 15862,
  "width": 6453,
  "items": [
    {
      "id": "https://example.org/object1/anno-page/1",
      "type": "AnnotationPage",
      "items": [
        {
          "id": "https://example.org/object1/anno-page/1/anno/1",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f4/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15862,
            "width": 6453
          },
          "target": "https://example.org/object1/canvas/1"
        }
      ]
    }
  ]
}

Service api image sur canvas 1

  • pointer vers le service api image de gallica pour activer le zoom (cf. URL de base vue tout à l'heure avec l'API Image)
"service": [
  {
    "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f4",
    "type": "ImageService1",
    "profile": "level2"
  }
]

Canvas 2

  • ajouter un 2e canvas, identique au premier (seuls les URIs et les dimensions changent)
{
  "id": "https://example.org/object1/canvas/2",
  "type": "Canvas",
  "height": 15725,
  "width": 6458,
  "items": [
    {
      "id": "https://example.org/object1/anno-page/2",
      "type": "AnnotationPage",
      "items": [
        {
          "id": "https://example.org/object1/anno-page/2/anno/1",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f5/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15725,
            "width": 6458,
            "service": [
              {
                "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f5",
                "type": "ImageService1",
                "profile": "level2"
              }
            ]
          },
          "target": "https://example.org/object1/canvas/2"
        }
      ]
    }
  ]
}

Canvas labels

  • problème du libellé NaN : avoir des libellés signifiants au niveau des Canvas est important pour faciliter la consultation et le repérage au sein du document (pour un livre : pagination ou foliotation, ou autres types de pages tels que contreplats, pages de garde, page de titre, frontispices etc.)
"label": {
  "none": [
    "vue 4"
  ]
},
"label": {
  "none": [
    "vue 5"
  ]
},

Manifest provider

  • importance des informations d'attribution et de licence :
    • nom et logo du fournisseur du document
    • site d'origine où l'on peut consulter le document numérisé et le cas échéant sa notice descriptive
    • informations relatives aux droits d'utilisation
    • licence
"provider": [
  {
    "id": "https://data.bnf.fr/ark:/12148/cb12381002j",
    "type": "Agent",
    "label": {
      "fr": [
        "Bibliothèque nationale de France"
      ]
    },
    "logo": [
      {
        "id": "https://gallica.bnf.fr/mbImage/logos/logo-bnf.png",
        "type": "Image",
        "format": "image/png"
      }
    ]
  }
],

Manifest requiredStatement

  • texte obligatoirement affiché par les visualiseurs ou tout autre client
"requiredStatement": {
  "label": {
    "fr": [
      "Attribution"
    ]
  },
  "value": {
    "fr": [
      "Bibliothèque nationale de France"
    ]
  }
},

Manifest metadata (date)

  • ajout de métadonnées libres (sans sémantique, juste des pairs de label/value), par ex. la date du document
"metadata": [
  {
    "label": {
      "fr": [
        "Date"
      ]
    },
    "value": {
      "none": [
        "1370-1380"
      ]
    }
  }
],

Manifest metadata (cote)

  • idem pour la cote
{
  "label": {
    "fr": [
      "Cote"
    ]
  },
  "value": {
    "fr": [
      "Bibliothèque nationale de France. Département des Manuscrits. Espagnol 30"
    ]
  }
}

Canvas metadata

  • on peut ajouter des "metadata" à tous les niveaux (Collection, Manifest, Canvas, Range...), par ex. au niveau du Canvas (ici une description sommaire du bi-folio), en français et en anglais (clés "fr" et "en")
"metadata": [
  {
    "label": {
      "fr": [
        "Description"
      ]
    },
    "value": {
      "fr": [
        "Calendrier astronomique circulaire entouré par plusieurs textes ; quatre figures dans les angles tenant des banderoles. Fonds quadrillés rouges et bleus à motifs de fleurs de lys. La date de 1375 y apparaît à plusieurs reprises."
      ],
      "en": [
        "Circular astronomical calendar surrounded by several texts; four figures in the corners holding streamers. Red and blue squared backgrounds with fleur-de-lis motifs. The date 1375 appears several times."
      ]
    }
  }
],

Canvas 1-2 assemblés

  • illustrer le principe du canvas en associant les 2 images de la carte à un seul canvas (2 annotations d'image, l'une ciblant la moitié gauche du canvas, et l'autre la moitié droite)
{
  "id": "https://example.org/object1/canvas/1-2",
  "type": "Canvas",
  "label": {
    "none": [
      "vues 4-5"
    ]
  },
  "height": 15862,
  "width": 12911,
  "items": [
    {
      "id": "https://example.org/object1/anno-page/1-2",
      "type": "AnnotationPage",
      "items": [
        {
          "id": "https://example.org/object1/anno-page/1-2/anno/1",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f4/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15862,
            "width": 6453,
            "service": [
              {
                "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f4",
                "type": "ImageService1",
                "profile": "level2"
              }
            ]
          },
          "target": "https://example.org/object1/canvas/1-2#xywh=0,0,6453,15862"
        },
        {
          "id": "https://example.org/object1/anno-page/1-2/anno/2",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f5/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15725,
            "width": 6458,
            "service": [
              {
                "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f5",
                "type": "ImageService1",
                "profile": "level2"
              }
            ]
          },
          "target": "https://example.org/object1/canvas/1-2#xywh=6453,0,6458,15725"
        }
      ]
    }
  ],
  "metadata": [
    {
      "label": {
        "fr": [
          "Description"
        ]
      },
      "value": {
        "fr": [
          "Calendrier astronomique circulaire entouré par plusieurs textes ; quatre figures dans les angles tenant des banderoles. Fonds quadrillés rouges et bleus à motifs de fleurs de lys. La date de 1375 y apparaît à plusieurs reprises."
        ]
      }
    }
  ]
}

Manifest behavior continuous

"behavior": [
  "continuous"
],

Canvas supplémentaires

{
  "id": "https://example.org/object1/canvas/3",
  "type": "Canvas",
  "label": {
    "none": [
      "vue 6"
    ]
  },
  "height": 15862,
  "width": 6454,
  "items": [
    {
      "id": "https://example.org/object1/anno-page/3",
      "type": "AnnotationPage",
      "items": [
        {
          "id": "https://example.org/object1/anno-page/3/anno/1",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f6/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15862,
            "width": 6454,
            "service": [
              {
                "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f6",
                "type": "ImageService1",
                "profile": "level2"
              }
            ]
          },
          "target": "https://example.org/object1/canvas/3"
        }
      ]
    }
  ]
},
{
  "id": "https://example.org/object1/canvas/4",
  "type": "Canvas",
  "label": {
    "none": [
      "vue 7"
    ]
  },
  "height": 15770,
  "width": 6451,
  "items": [
    {
      "id": "https://example.org/object1/anno-page/4",
      "type": "AnnotationPage",
      "items": [
        {
          "id": "https://example.org/object1/anno-page/4/anno/1",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f7/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15770,
            "width": 6451,
            "service": [
              {
                "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f7",
                "type": "ImageService1",
                "profile": "level2"
              }
            ]
          },
          "target": "https://example.org/object1/canvas/4"
        }
      ]
    }
  ]
},
{
  "id": "https://example.org/object1/canvas/5",
  "type": "Canvas",
  "label": {
    "none": [
      "vue 8"
    ]
  },
  "height": 15778,
  "width": 6457,
  "items": [
    {
      "id": "https://example.org/object1/anno-page/5",
      "type": "AnnotationPage",
      "items": [
        {
          "id": "https://example.org/object1/anno-page/5/anno/1",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f8/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15778,
            "width": 6457,
            "service": [
              {
                "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f8",
                "type": "ImageService1",
                "profile": "level2"
              }
            ]
          },
          "target": "https://example.org/object1/canvas/5"
        }
      ]
    }
  ]
},
{
  "id": "https://example.org/object1/canvas/6",
  "type": "Canvas",
  "label": {
    "none": [
      "vue 9"
    ]
  },
  "height": 15827,
  "width": 6547,
  "items": [
    {
      "id": "https://example.org/object1/anno-page/6",
      "type": "AnnotationPage",
      "items": [
        {
          "id": "https://example.org/object1/anno-page/6/anno/1",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f9/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15827,
            "width": 6547,
            "service": [
              {
                "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f9",
                "type": "ImageService1",
                "profile": "level2"
              }
            ]
          },
          "target": "https://example.org/object1/canvas/6"
        }
      ]
    }
  ]
},
{
  "id": "https://example.org/object1/canvas/7",
  "type": "Canvas",
  "label": {
    "none": [
      "vue 10"
    ]
  },
  "height": 15870,
  "width": 6474,
  "items": [
    {
      "id": "https://example.org/object1/anno-page/7",
      "type": "AnnotationPage",
      "items": [
        {
          "id": "https://example.org/object1/anno-page/7/anno/1",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f10/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15870,
            "width": 6474,
            "service": [
              {
                "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f10",
                "type": "ImageService1",
                "profile": "level2"
              }
            ]
          },
          "target": "https://example.org/object1/canvas/7"
        }
      ]
    }
  ]
},
{
  "id": "https://example.org/object1/canvas/8",
  "type": "Canvas",
  "label": {
    "none": [
      "vue 11"
    ]
  },
  "height": 15755,
  "width": 6403,
  "items": [
    {
      "id": "https://example.org/object1/anno-page/8",
      "type": "AnnotationPage",
      "items": [
        {
          "id": "https://example.org/object1/anno-page/8/anno/1",
          "type": "Annotation",
          "motivation": "painting",
          "body": {
            "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f11/full/full/0/default.jpg",
            "type": "Image",
            "format": "image/png",
            "height": 15755,
            "width": 6403,
            "service": [
              {
                "id": "https://gallica.bnf.fr/iiif/ark:/12148/btv1b55002481n/f11",
                "type": "ImageService1",
                "profile": "level2"
              }
            ]
          },
          "target": "https://example.org/object1/canvas/8"
        }
      ]
    }
  ]
}

Ranges

  • inclure un sommaire pour faciliter la navigation au sein de l'atlas grâce aux ranges
"structures": [
  {
    "id": "https://example.org/object1/range/1",
    "type": "Range",
    "label": {
      "en": [
        "Table des matières"
      ]
    },
    "items": [
      {
        "id": "https://example.org/object1/range/r1",
        "type": "Range",
        "label": {
          "fr": [
            "Calendrier astronomique"
          ]
        },
        "items": [
          {
            "id": "https://example.org/object1/canvas/1",
            "type": "Canvas"
          },
          {
            "id": "https://example.org/object1/canvas/2",
            "type": "Canvas"
          }
        ]
      },
      {
        "id": "https://example.org/object1/range/r2",
        "type": "Range",
        "label": {
          "fr": [
            "Atlas de cartes marines"
          ]
        },
        "items": [
          {
            "id": "https://example.org/object1/range/r2/1",
            "type": "Range",
            "label": {
              "fr": [
                "Méditerranée occidentale et côte Atlantique. Scandinavie, monts de Bohême. Corse et Sardaigne. Iles Britanniques, Tulé, îles de l’Atlantique (Canaries)"
              ]
            },
            "items": [
              {
                "id": "https://example.org/object1/canvas/3",
                "type": "Canvas"
              },
              {
                "id": "https://example.org/object1/canvas/4",
                "type": "Canvas"
              }
            ]
          },
          {
            "id": "https://example.org/object1/range/r2/2",
            "type": "Range",
            "label": {
              "fr": [
                "Proche-Orient et Méditerranée orientale, depuis la mer Noire, la Palestine, la mer Rouge, jusqu’à la Corse et la Sardaigne"
              ]
            },
            "items": [
              {
                "id": "https://example.org/object1/canvas/5",
                "type": "Canvas"
              },
              {
                "id": "https://example.org/object1/canvas/6",
                "type": "Canvas"
              }
            ]
          },
          {
            "id": "https://example.org/object1/range/r2/3",
            "type": "Range",
            "label": {
              "fr": [
                "Asie depuis l’Inde jusqu’à la mer Caspienne, le golfe Persique, l’Arabie et la Mecque"
              ]
            },
            "items": [
              {
                "id": "https://example.org/object1/canvas/7",
                "type": "Canvas"
              }
            ]
          },
          {
            "id": "https://example.org/object1/range/r2/4",
            "type": "Range",
            "label": {
              "fr": [
                "Asie orientale depuis l’océan jusqu’à l’Inde. Figure du Jugement Dernier et du prince de Gog et Magog. Montagnes Caspiennes gardées par Alexandre le Grand. Chine : Catayo. Ile de Taprobane et Illa Jana, Inde."
              ]
            },
            "items": [
              {
                "id": "https://example.org/object1/canvas/8",
                "type": "Canvas"
              }
            ]
          }
        ]
      }
    ]
  }
]

Manifest homepage

  • pointer vers la page web de l'objet sur le site d'origine
"homepage": [
  {
    "id": "https://gallica.bnf.fr/ark:/12148/btv1b55002481n",
    "type": "Text",
    "label": {
      "fr": [
        "Consulter le document sur Gallica (BnF)"
      ]
    },
    "format": "text/html",
    "language": [
      "fr"
    ]
  }
],

Manifest rendering

  • pointer vers un format alternatif de l'objet, c-a-d une représentation non-IIIF (par ex. un PDF, ePub, un modèle 3D)
"rendering": [
  {
    "id": "https://gallica.bnf.fr/ark:/12148/btv1b55002481n/f1n18.pdf",
    "type": "Image",
    "label": {
      "fr": [
        "Exporter en PDF couleur"
      ]
    },
    "format": "application/pdf"
  }
],

Manifest seeAlso

  • pointer sur l'URI d'une ressource lisible par une machine, c-a-d un fichier de données structurées à propos de l'objet (par ex. en XML ou RDF).
  • dans cet exemple il s'agit d'un record OAI-PMH, mais on pourrait avoir aussi un fichier METS/MODS, RDF, XML-TEI, XML-EAD, XML-LIDO etc.)
  • utilité ? = permettre à un client de récupérer des métadonnées structurées pour les afficher ou, surtout, pour les indexer et proposer une recherche au sein d'un ensemble de manifests (cf. IIIF Collections)
"seeAlso": [
  {
    "id": "http://oai.bnf.fr/oai2/OAIHandler?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai:bnf.fr:gallica/ark:/12148/btv1b55002481n",
    "type": "Dataset",
    "profile": "http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd",
    "label": {
      "fr": [
        "Entrepôt OAI"
      ]
    },
    "format": "text/xml"
  }
],

Canvas annotation

  • ajouter une annotation sur une zone d'intérêt d'une image
  • nouvelle propriété "annotations" au niveau du canvas concerné (vue 6)
  • même construction que pour les annotations d'image vues précédemment, sauf qu'ici la "motivation" diffère ("commenting" au lieu de "painting"), et bien sûr le "body" diffère aussi (contenu texte et non image)
  • de plus l'annotation cible une zone particulière du canvas grâce à des coordonnées xywh (voir exemple Châteauroux ci-après)
  • annotation conforme au modèle Web annotation (W3C)
"annotations": [
  {
    "id": "https://example.org/object1/canvas/6/annotations/1",
    "type": "AnnotationPage",
    "items": [
      {
        "id": "https://example.org/object1/canvas/6/annotations/1/anno/1",
        "type": "Annotation",
        "motivation": "commenting",
        "body": {
          "type": "TextualBody",
          "value": "Monastère Sainte-Catherine du Sinaï",
          "language": "fr",
          "format": "text/plain"
        },
        "target": "https://example.org/object1/canvas/6#xywh=4900,11000,900,600"
      }
    ]
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment