From b85ee28477ca8851620ebb8b5d048aa4ae0a034b Mon Sep 17 00:00:00 2001 From: Stephen Fraser Date: Sun, 7 Jun 2020 12:39:32 +0100 Subject: [PATCH] Added and fixed tests --- README.md | 96 +- .../presentation-2-parser/traverse-test.ts | 78 ++ .../presentation-2/biblissima-manifest.json | 1017 +++++++++++++++++ .../iiif-fixture-annotation-list.json | 28 + .../iiif-fixture-collection.json | 292 +++++ .../presentation-2/iiif-fixture-manifest.json | 34 + packages/vault/src/Vault.ts | 8 + tsconfig.json | 114 +- yarn.lock | 5 + 9 files changed, 1594 insertions(+), 78 deletions(-) create mode 100644 __tests__/presentation-2-parser/traverse-test.ts create mode 100644 fixtures/presentation-2/biblissima-manifest.json create mode 100644 fixtures/presentation-2/iiif-fixture-annotation-list.json create mode 100644 fixtures/presentation-2/iiif-fixture-collection.json create mode 100644 fixtures/presentation-2/iiif-fixture-manifest.json diff --git a/README.md b/README.md index 6ffc991f..4c9e83ab 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,87 @@

-Experimental framework for working with IIIF in JavaScript and Typescript. +Set of packages for Typescript and Javascript projects both in the browser and in Node to work with IIIF. -Aims to provide safe typings for valid Presentation 3 JSON-LD and normalization step (also with typings). +## Packages -3 steps in that the library does: -- Preprocess resources to ensure valid Presentation 3 -- Cast JSON to Typescript interface -- Normalize resources into flat tree of resources +- `@hyperion-framework/types` - Typescript types for the latest IIIF Presentation version (currently 3.0). +- `@hyperion-framework/presentation-2` - Typescript types for IIIF Presentation 2.1.1 +- `@hyperion-framework/presentation-3` - Typescript types for IIIF Presentation 3.0 +- `@hyperion-framework/parser` - Traverse, normalise, serialise IIIF Presentation 3.0 +- `@hyperion-framework/presentation-2-parser` - Traverse and upgrade IIIF Presentation 2.0 +- `@hyperion-framework/store` - Minimal Redux store for IIIF resources (note: does not include state, e.g. selected items) +- `@hyperion-framework/vault` - Reference implementation around store and parser to make simple IIIF library +- `@hyperion-framework/react-vault` - React hooks for Vault. IIIF building blocks for creating React components. -This library can be the basis of other tools that want to work deeper with IIIF Presentation 3 resources. +#### Related packages +- `@atlas-viewer/iiif-image-api` - Types and tools for working with IIIF Image API (version 1-3) - [view repository](https://github.com/atlas-viewer/iiif-image-api) +- `@atlas-viewer/atlas` - Standalone IIIF deep-zoom viewer with optional React fiber - [view repository](https://github.com/atlas-viewer/atlas) -
+## Common patterns +Some common patterns working with IIIF. -
+#### Remotely loading IIIF. -This is the main library used to fetch, store and retrieve IIIF resources. It is not tied to a single framework and can be used with both JavaScript and Typescript. -
+With Vault, you can load remote resource and work with IIIF as Presentation 3 (presentation 2 will be upgraded to 3). +All the fields will be normalized, so you don't need to perform as many checks for undefined items. When you +load something into Vault it will be flattened into database-like tables. When you load a manifest for example, +the object you get back doesn't contain all of the canvases on that manifest fully, instead just a reference +pointing to them `{ id: '..', type: 'Canvas' }`. You can retrieve the full canvas by calling `vault.fromRef(ref)`. +This "references everywhere" model allows you to do the same thing for already referenced properties, such as +`partOf` where you will always be able to get the full resource. -
+Aside from this change in structure, the objects you get back are all Presentation 3 resources. This is not +a complete abstraction or helper library. +```js +import { Vault } from '@hyperion-framework/vault'; -Super-fast, abstract IIIF Viewer. Build a world and fill it with canvases. Lets users move, pan and zoom, or take your users on a smooth tour of your world. +const vault = new Vault(); -
+vault.loadManifest('http://example.org/..').then(manifest => { + // Note: manifest here is flattened. You need to call: vault.fromRef() or vault.allFromRef + const canvasRef = manifest.items[0] // { id: 'http://...', type: 'Canvas' } + const fullCanvas = vault.fromRef(canvasRef); // { id: '..', type: '', items: [], ... } + const allCanvases = vault.allFromRef(manifest.items); // [{ id: '..', type: '', items: [], ... }, ...] +}); +``` -
-React hooks are, hands down, the best way to work with IIIF. -
+#### Upgrade Presentation 2 to 3 -## Development -You need `yarn` in order to work with this monorepo. Simply clone the repository and run `yarn` followed by `yarn start`. This will build -all of the libraries and examples, running them in watch mode. You'll get the following servers started: -- [http://localhost:5105/](http://localhost:5105/) - Documentation site -- [http://localhost:5103/](http://localhost:5103/) - Vanilla example -- [http://localhost:5101/](http://localhost:5101/) - React example -- [http://localhost:5102/](http://localhost:5102/) - Annotation example +If you want to start building with IIIF Presentation 3 you will likely want to support both IIIF Presentation 2 +as the community transitions. The `@hyperion-framework/parser` package contains a simple converter that can +be used to convert 2 to 3 in the browser and can be dropped into most applications right after fetching an +IIIF resource. This supports both Collections and Manifests. If you need more granular control and options +you can check the `@hyperion-framework/presentation-2-parser` package. -If you want to see the pattern library for the annotation example, you can cd into `./examples/hyperion-annotation-example` and run `yarn docz:dev`. +```js +import { convertPresentation2 } from '@hyperion-framework/parser'; -You can run tests from the root of the repository by running: `yarn test`. +// ... -**Pull requests are always welcome!* +const presentation3Manifest = convertPresentation2(presentation2Manifest); +``` + +#### Extracting a single field from all resources + +Given the flexibility of IIIF you may want to extract a field from all levels of an IIIF resource, like rights +information. + +```js +import { Traverse } from '@hyperion-framework/parser'; // or presentation-2-parser for Presentation 2. + +// Create the helper. +const logAllRights = Traverse.all(anyResource => { + if (anyResource.rights) { + console.log(anyResource.rights); + } +}); + +// Use the traversal helper. +logAllRights.traverseManifest({ ... }); +``` + +#### React + +[See a demo](https://codesandbox.io/s/atlas-demo-omhg3?file=/src/Canvas.js) of Atlas + Vault working together in React. diff --git a/__tests__/presentation-2-parser/traverse-test.ts b/__tests__/presentation-2-parser/traverse-test.ts new file mode 100644 index 00000000..95cd23fc --- /dev/null +++ b/__tests__/presentation-2-parser/traverse-test.ts @@ -0,0 +1,78 @@ +import iiifCollection from '../../fixtures/presentation-2/iiif-fixture-collection.json'; +import iiifManifest from '../../fixtures/presentation-2/iiif-fixture-manifest.json'; +import bibManifest from '../../fixtures/presentation-2/biblissima-manifest.json'; +import iiifAnnoList from '../../fixtures/presentation-2/iiif-fixture-annotation-list.json'; +import { Traverse } from '../../packages/presentation-2-parser/src/traverse'; +import { upgraderTraverse } from '../../packages/presentation-2-parser/src/upgrader'; + +describe('Presentation 2 Traverse', () => { + // test('upgrade 2 to 3', () => { + // const result = upgraderTraverse.traverseManifest(bibManifest as any); + // + // expect(result).toEqual({}); + // }); + + test('traverse simple collection', () => { + const ids = []; + const manifestIds = []; + const traverse = new Traverse({ + collection: [ + collection => { + ids.push(collection['@id']); + return collection; + }, + ], + manifest: [ + manifest => { + manifestIds.push(manifest['@id']); + }, + ], + }); + + traverse.traverseCollection(iiifCollection); + + expect(ids).toEqual(['http://iiif.io/api/presentation/2.1/example/fixtures/collection.json']); + expect(manifestIds.length).toEqual(55); + }); + + test('traverse simple manifest', () => { + const ids = []; + function trackId(type: string) { + return (item: any) => { + ids.push({ id: item['@id'], type }); + }; + } + const traverse = new Traverse({ + manifest: [trackId('manifest')], + sequence: [trackId('sequence')], + canvas: [trackId('canvas')], + contentResource: [trackId('contentResource')], + annotation: [trackId('annotation')], + }); + + traverse.traverseManifest(iiifManifest); + + expect(ids).toEqual([ + { + id: 'http://iiif.io/api/presentation/2.1/example/fixtures/resources/page1-full.png', + type: 'contentResource', + }, + { + // No id, but it traversed it. + type: 'annotation', + }, + { + id: 'http://iiif.io/api/presentation/2.1/example/fixtures/canvas/1/c1.json', + type: 'canvas', + }, + { + // No id, but it traversed it. + type: 'sequence', + }, + { + id: 'http://iiif.io/api/presentation/2.1/example/fixtures/1/manifest.json', + type: 'manifest', + }, + ]); + }); +}); diff --git a/fixtures/presentation-2/biblissima-manifest.json b/fixtures/presentation-2/biblissima-manifest.json new file mode 100644 index 00000000..ff6c9fbc --- /dev/null +++ b/fixtures/presentation-2/biblissima-manifest.json @@ -0,0 +1,1017 @@ +{ + "@context": "http://iiif.io/api/presentation/2/context.json", + "@id": "http://demos.biblissima-condorcet.fr/iiif/metadata/BVMM/chateauroux/manifest.json", + "@type": "sc:Manifest", + "label": "Reconstructed manifest (partial): Grandes Chroniques de France (Châteauroux, BM, ms 5)", + "description": "This manifest is a partial reconstruction of the Grandes Chroniques de France manuscript (Châteauroux, BM, ms 5 ; full page images coming from the BVMM). The miniatures are associated as detail images on their respective canvas (images coming from Gallica). It only shows the mutilated pages of the original manuscript, not the full object.", + "attribution": "Images : Gallica - Bibliothèque nationale de France / BVMM (IRHT-CNRS) - Bibliothèque municipale de Châteauroux ; Manifest IIIF : Régis Robineau (Biblissima)", + "thumbnail": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0038/full/150,/0/default.jpg", + "logo": "http://static.biblissima.fr/images/logo-biblissima-350w.jpg", + "related": [ + { + "@id": "http://bvmm.irht.cnrs.fr/consult/consult.php?reproductionId=4490", + "label": "Digitized manuscript (BVMM, IRHT-CNRS)" + }, + { + "@id": "http://ccfr.bnf.fr/portailccfr/jsp/index_view_direct_anonymous.jsp?record=eadcgm:EADC:D15100021", + "label": "Catalogue record (CCFr)" + }, + { + "@id": "http://gallica.bnf.fr/ark:/12148/btv1b10511137f", + "label": "Digitized miscellany containing the miniatures (Gallica)" + }, + { + "@id": "http://gallica.bnf.fr/Search?idArk=&n=50&p=1&lang=FR&adva=1&adv=1&reset=&urlReferer=%2Fadvancedsearch%3Flang%3DFR&enreg=&tri=&catsel1=f_source&cat1=4-AD-133&ope2=MUST&catsel2=f_creator&cat2=&ope3=MUST&catsel3=f_tdm&cat3=&date=daTo&daFr=&daTo=&t_typedoc=images&sel_collection=toutesCollections&biblio=Biblioth%C3%A8que+nationale+de+France&sel_source=toutSources&biblioSpecifique=Gallica&sel_provenance_Part=toutPartenaires&sel_provenance_Edist=toutSNE&dateMiseEnLigne=indexDateFrom&firstIndexationDateDebut=&firstIndexationDateFin=&tri=&submit2=Lancer+la+recherche", + "label": "Digitized miniatures, retail (Gallica)" + }, + { + "@id": "http://catalogue.bnf.fr/ark:/12148/cb40341664z", + "label": "Catalogue record of the miscellany (BnF)" + } + ], + "metadata": [ + { + "label": "Type", + "value": "Reconstructed manuscrit (partial reconstruction)" + }, + { + "label": "Holding institution (manuscript)", + "value": "Bibliothèque municipale de Châteauroux" + }, + { + "label": "Holding institution (cuttings)", + "value": "Bibliothèque nationale de France, Département des Estampes et de la photographie" + }, + { + "label": "Shelfmarks", + "value": [ + "Châteauroux, Bibliothèque municipale, ms. 5", + "Paris, BnF, Département des Estampes et de la photographie, RESERVE 4-AD-133" + ] + }, + { + "label": "Images Providers", + "value": [ + "Gallica - Bibliothèque nationale de France", + "BVMM (IRHT-CNRS) - Bibliothèque municipale de Châteauroux" + ] + }, + { + "label": "Manifest Provider", + "value": "Equipex Biblissima" + } + ], + "sequences": [ + { + "@type": "sc:Sequence", + "canvases": [ + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981394", + "@type": "sc:Canvas", + "label": "f. 033v - 034", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0038/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0038", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981394" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511139b/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2138, + "height": 2414, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511139b/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981394#xywh=3949,994,1091,1232" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981395", + "@type": "sc:Canvas", + "label": "f. 034v - 035", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0039/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0039", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981395" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511139b/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2159, + "height": 2447, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511139b/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981395#xywh=2618,927,1080,1224" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981406", + "@type": "sc:Canvas", + "label": "f. 045v - 046", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0050/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0050", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981406" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111432/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2161, + "height": 2094, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111432/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981406#xywh=3953,927,1078,1045" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981407", + "@type": "sc:Canvas", + "label": "f. 046v - 047", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0051/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0051", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981407" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111432/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2175, + "height": 2041, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111432/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981407#xywh=2632,881,1091,1024" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981414", + "@type": "sc:Canvas", + "label": "f. 053v - 054", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0058/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0058", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981414" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511147v/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2183, + "height": 2758, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511147v/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981414#xywh=3928,956,1093,1381" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981415", + "@type": "sc:Canvas", + "label": "f. 054v - 055", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0059/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0059", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981415" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511147v/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2186, + "height": 2785, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511147v/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981415#xywh=2683,925,1046,1333" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981428", + "@type": "sc:Canvas", + "label": "f. 067v - 068", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0072/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0072", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981428" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111504/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2161, + "height": 2073, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111504/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981428#xywh=4053,964,1096,1051" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981429", + "@type": "sc:Canvas", + "label": "f. 068v - 069", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0073/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0073", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981429" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111504/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2230, + "height": 2102, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111504/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981429#xywh=2695,938,1087,1025" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981441", + "@type": "sc:Canvas", + "label": "f. 080v - 081", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0085/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0085", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981441" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511154x/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2227, + "height": 2165, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511154x/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981441#xywh=4007,970,1094,1064" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981442", + "@type": "sc:Canvas", + "label": "f. 081v - 082", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0086/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0086", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981442" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511154x/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2157, + "height": 2162, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511154x/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981442#xywh=2758,974,1044,1046" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981445", + "@type": "sc:Canvas", + "label": "f. 084v - 085", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0089/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0089", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981445" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511158q/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2150, + "height": 2143, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511158q/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981445#xywh=4005,963,1089,1085" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981446", + "@type": "sc:Canvas", + "label": "f. 085v - 086", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0090/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0090", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981446" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511158q/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2171, + "height": 2137, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511158q/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981446#xywh=2726,970,1097,1080" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981449", + "@type": "sc:Canvas", + "label": "f. 088v - 089", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0093/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0093", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981449" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111610/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2177, + "height": 2095, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111610/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981449#xywh=4077,1028,1055,1015" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981450", + "@type": "sc:Canvas", + "label": "f. 089v - 090", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0094/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0094", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981450" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111610/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2129, + "height": 2083, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111610/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981450#xywh=2904,956,1030,1008" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981542", + "@type": "sc:Canvas", + "label": "f. 181v - 182", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0186/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0186", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981542" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511164b/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2015, + "height": 2119, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511164b/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981542#xywh=4064,1409,976,1026" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981543", + "@type": "sc:Canvas", + "label": "f. 182v - 183", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0187/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0187", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981543" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511164b/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 1991, + "height": 2089, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511164b/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981543#xywh=2843,1384,990,1039" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981549", + "@type": "sc:Canvas", + "label": "f. 188v - 189", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0193/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0193", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981549" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511167p/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 1972, + "height": 2107, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511167p/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981549#xywh=4067,2816,961,1027" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981550", + "@type": "sc:Canvas", + "label": "f. 189v - 190", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0194/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0194", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981550" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511167p/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 1932, + "height": 2075, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511167p/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981550#xywh=2864,2853,1000,1074" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981720", + "@type": "sc:Canvas", + "label": "f. 359v - 360", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0364/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0364", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981720" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511170z/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2115, + "height": 2090, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511170z/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981720#xywh=5025,2529,1058,1045" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981721", + "@type": "sc:Canvas", + "label": "f. 360v - 361", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0365/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0365", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981721" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511170z/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2103, + "height": 2054, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b10511170z/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981721#xywh=1093,2503,1085,1060" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981776", + "@type": "sc:Canvas", + "label": "f. 415v - 416", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0420/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0420", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981776" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111739/f2/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2053, + "height": 2277, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111739/f2" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981776#xywh=4865,2140,1053,1168" + } + ] + }, + { + "@id": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981777", + "@type": "sc:Canvas", + "label": "f. 416v - 417", + "height": 5412, + "width": 7216, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0421/full/full/0/default.jpg", + "@type": "dctypes:Image", + "format": "image/jpeg", + "height": 5412, + "width": 7216, + "service": { + "@context": "http://iiif.io/api/image/2/context.json", + "@id": "http://iiif.irht.cnrs.fr/iiif/Châteauroux/B360446201_MS0005/jp2/B360446201_MS0005_0421", + "profile": "http://iiif.io/api/image/2/level2.json" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981777" + }, + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111739/f1/full/full/0/native.jpg", + "format": "image/jpeg", + "@type": "dctypes:Image", + "width": 2047, + "height": 2253, + "service": { + "@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json", + "profile": "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", + "@id": "http://gallica.bnf.fr/iiif/ark:/12148/btv1b105111739/f1" + } + }, + "on": "http://bvmm.irht.cnrs.fr/iiif/2309/canvas/981777#xywh=1019,2146,1077,1185" + } + ] + } + ] + } + ] +} diff --git a/fixtures/presentation-2/iiif-fixture-annotation-list.json b/fixtures/presentation-2/iiif-fixture-annotation-list.json new file mode 100644 index 00000000..35862e76 --- /dev/null +++ b/fixtures/presentation-2/iiif-fixture-annotation-list.json @@ -0,0 +1,28 @@ +{ + "@context": "http://iiif.io/api/presentation/2/context.json", + "@id": "http://iiif.io/api/presentation/2.0/example/fixtures/list/65/list1.json", + "@type": "sc:AnnotationList", + "label": "Test 65 List 1", + "resources": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@type": "cnt:ContentAsText", + "chars": "Top of First Page to Display" + }, + "on": { + "@type": "oa:SpecificResource", + "full": { + "@id": "http://iiif.io/api/presentation/2.0/example/fixtures/canvas/65/c1.json", + "@type": "sc:Canvas", + "label": "Test 65 Canvas: 1" + }, + "selector": { + "@type": "oa:FragmentSelector", + "value": "xywh=225,70,750,150" + } + } + } + ] +} diff --git a/fixtures/presentation-2/iiif-fixture-collection.json b/fixtures/presentation-2/iiif-fixture-collection.json new file mode 100644 index 00000000..fa6c945e --- /dev/null +++ b/fixtures/presentation-2/iiif-fixture-collection.json @@ -0,0 +1,292 @@ +{ + "@context": "http://iiif.io/api/presentation/2/context.json", + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/collection.json", + "@type": "sc:Collection", + "label": "Collection of Test Cases", + "manifests": [ + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/1/manifest.json", + "@type": "sc:Manifest", + "label": "Test 1 Manifest: Minimum Required Fields" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/2/manifest.json", + "@type": "sc:Manifest", + "label": "Test 2 Manifest: Metadata Pairs" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/3/manifest.json", + "@type": "sc:Manifest", + "label": "Test 3 Manifest: Metadata Pairs with Languages" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/4/manifest.json", + "@type": "sc:Manifest", + "label": "Test 4 Manifest: Metadata Pairs with Multiple Values in same Language" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/5/manifest.json", + "@type": "sc:Manifest", + "label": "Test 5 Manifest: Description field" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/6/manifest.json", + "@type": "sc:Manifest", + "label": "Test 6 Manifest: Multiple Descriptions" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/7/manifest.json", + "@type": "sc:Manifest", + "label": "Test 7 Manifest: Rights Metadata" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/8/manifest.json", + "@type": "sc:Manifest", + "label": "Test 8 Manifest: SeeAlso link / Manifest" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/9/manifest.json", + "@type": "sc:Manifest", + "label": "Test 9 Manifest: Service link / Manifest" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/10/manifest.json", + "@type": "sc:Manifest", + "label": "Test 10 Manifest: Service link as Object" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/11/manifest.json", + "@type": "sc:Manifest", + "label": "Test 11 Manifest: ViewingDirection: l-t-r" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/12/manifest.json", + "@type": "sc:Manifest", + "label": "Test 12 Manifest: ViewingDirection: r-t-l" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/13/manifest.json", + "@type": "sc:Manifest", + "label": "Test 13 Manifest: ViewingDirection: t-t-b" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/14/manifest.json", + "@type": "sc:Manifest", + "label": "Test 14 Manifest: ViewingDirection: b-t-t" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/15/manifest.json", + "@type": "sc:Manifest", + "label": "Test 15 Manifest: ViewingHint: paged" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/16/manifest.json", + "@type": "sc:Manifest", + "label": "Test 16 Manifest: ViewingHint: continuous" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/17/manifest.json", + "@type": "sc:Manifest", + "label": "Test 17 Manifest: ViewingHint: individuals" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/18/manifest.json", + "@type": "sc:Manifest", + "label": "Test 18 Manifest: Non Standard Keys" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/19/manifest.json", + "@type": "sc:Manifest", + "label": "Test 19 Manifest: Multiple Canvases" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/20/manifest.json", + "@type": "sc:Manifest", + "label": "Test 20 Manifest: Multiple Sequences" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/21/manifest.json", + "@type": "sc:Manifest", + "label": "Test 21 Manifest: Sequence with Metadata" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/22/manifest.json", + "@type": "sc:Manifest", + "label": "Test 22 Manifest: /Sequence/ with non l-t-r viewingDirection" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/23/manifest.json", + "@type": "sc:Manifest", + "label": "Test 23 Manifest: /Sequence/ with non paged viewingHint" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/24/manifest.json", + "@type": "sc:Manifest", + "label": "Test 24 Manifest: Image with IIIF Service" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/25/manifest.json", + "@type": "sc:Manifest", + "label": "Test 25 Manifest: Image with IIIF Service, embedded info" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/26/manifest.json", + "@type": "sc:Manifest", + "label": "Test 26 Manifest: Image different size to Canvas" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/27/manifest.json", + "@type": "sc:Manifest", + "label": "Test 27 Manifest: No Image" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/28/manifest.json", + "@type": "sc:Manifest", + "label": "Test 28 Manifest: Choice of Image" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/29/manifest.json", + "@type": "sc:Manifest", + "label": "Test 29 Manifest: Choice of Image with IIIF Service" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/30/manifest.json", + "@type": "sc:Manifest", + "label": "Test 30 Manifest: Main + Detail Image" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/31/manifest.json", + "@type": "sc:Manifest", + "label": "Test 31 Manifest: Detail with IIIF Service" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/32/manifest.json", + "@type": "sc:Manifest", + "label": "Test 32 Manifest: Multiple Detail Images" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/33/manifest.json", + "@type": "sc:Manifest", + "label": "Test 33 Manifest: Detail Image with Choice" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/34/manifest.json", + "@type": "sc:Manifest", + "label": "Test 34 Manifest: Detail Image with Choice, and 'no image' as option" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/35/manifest.json", + "@type": "sc:Manifest", + "label": "Test 35 Manifest: Partial Image as Main Image" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/36/manifest.json", + "@type": "sc:Manifest", + "label": "Test 36 Manifest: Partial Image as Main Image with IIIF Service" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/37/manifest.json", + "@type": "sc:Manifest", + "label": "Test 37 Manifest: Partial Image as Detail Image" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/38/manifest.json", + "@type": "sc:Manifest", + "label": "Test 38 Manifest: Partial Image as Detail Image with IIIF Service" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/39/manifest.json", + "@type": "sc:Manifest", + "label": "Test 39 Manifest: Image with CSS Rotation" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/40/manifest.json", + "@type": "sc:Manifest", + "label": "Test 40 Manifest: Multiple Languages for Metadata Labels" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/41/manifest.json", + "@type": "sc:Manifest", + "label": "Test 41 Manifest: Main Image with Server side Rotation" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/43/manifest.json", + "@type": "sc:Manifest", + "label": "Test 43 Manifest: Embedded Transcription on Canvas" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/44/manifest.json", + "@type": "sc:Manifest", + "label": "Test 44 Manifest: Embedded Transcription on Fragment Segment" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/45/manifest.json", + "@type": "sc:Manifest", + "label": "Test 45 Manifest: External text/plain Transcription on Canvas" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/46/manifest.json", + "@type": "sc:Manifest", + "label": "Test 46 Manifest: External text/plain Transcription on Segment" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/47/manifest.json", + "@type": "sc:Manifest", + "label": "Test 47 Manifest: Embedded HTML Transcription on Canvas" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/48/manifest.json", + "@type": "sc:Manifest", + "label": "Test 48 Manifest: Embedded HTML Transcription on Segment" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/51/manifest.json", + "@type": "sc:Manifest", + "label": "Test 51 Manifest: Embedded Comment on a Canvas" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/52/manifest.json", + "@type": "sc:Manifest", + "label": "Test 52 Manifest: Embedded Comment on a Segment" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/54/manifest.json", + "@type": "sc:Manifest", + "label": "Test 54 Manifest: Comment in HTML" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/61/manifest.json", + "@type": "sc:Manifest", + "label": "Test 61 Manifest: Embedded Transcription on Selector Segment" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/62/manifest.json", + "@type": "sc:Manifest", + "label": [ + { + "@value": "62: quelque titre", + "@language": "fr" + }, + { + "@value": "62: some title", + "@language": "en" + } + ] + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/63/manifest.json", + "@type": "sc:Manifest", + "label": "Test 63 Manifest: Description in Multiple Languages" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/64/manifest.json", + "@type": "sc:Manifest", + "label": "Test 64 Manifest: Description in HTML" + }, + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/65/manifest.json", + "@type": "sc:Manifest", + "label": "Test 65 Manifest: Sequence with startCanvas" + } + ] +} diff --git a/fixtures/presentation-2/iiif-fixture-manifest.json b/fixtures/presentation-2/iiif-fixture-manifest.json new file mode 100644 index 00000000..dd6dbd03 --- /dev/null +++ b/fixtures/presentation-2/iiif-fixture-manifest.json @@ -0,0 +1,34 @@ +{ + "@context": "http://iiif.io/api/presentation/2/context.json", + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/1/manifest.json", + "@type": "sc:Manifest", + "label": "Test 1 Manifest: Minimum Required Fields", + "within": "http://iiif.io/api/presentation/2.1/example/fixtures/collection.json", + "sequences": [ + { + "@type": "sc:Sequence", + "canvases": [ + { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/canvas/1/c1.json", + "@type": "sc:Canvas", + "label": "Test 1 Canvas: 1", + "height": 1800, + "width": 1200, + "images": [ + { + "@type": "oa:Annotation", + "motivation": "sc:painting", + "resource": { + "@id": "http://iiif.io/api/presentation/2.1/example/fixtures/resources/page1-full.png", + "@type": "dctypes:Image", + "height": 1800, + "width": 1200 + }, + "on": "http://iiif.io/api/presentation/2.1/example/fixtures/canvas/1/c1.json" + } + ] + } + ] + } + ] +} diff --git a/packages/vault/src/Vault.ts b/packages/vault/src/Vault.ts index 64b4342a..e912e8e5 100644 --- a/packages/vault/src/Vault.ts +++ b/packages/vault/src/Vault.ts @@ -24,6 +24,7 @@ import { UnknownSizeImage, VariableSizeImage, } from '@atlas-viewer/iiif-image-api'; +import { fromRef } from './globalVault'; export type VaultOptions = { reducers: {}; @@ -104,6 +105,13 @@ export class Vault { return selector(state, resource) as R; } + allFromRef( + references: Reference[], + selector?: (state: HyperionStore, ctx: C) => R + ) { + return references.map(reference => this.fromRef(reference, selector)); + } + select(selector: (state: HyperionStore) => R): R { return selector(this.getState()); } diff --git a/tsconfig.json b/tsconfig.json index 8d45c8cf..401398b6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,61 +1,73 @@ { "compilerOptions": { - "baseUrl": "./", // enables project relative paths config - //"outDir": "dist/", // target for compiled files - "allowSyntheticDefaultImports": true, // no errors with commonjs modules interop - "esModuleInterop": true, - "allowJs": false, // include js files - "checkJs": false, // typecheck js files - "declaration": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "forceConsistentCasingInFileNames": true, - "importHelpers": true, // importing helper functions from tslib - "noEmitHelpers": true, // disable emitting inline helper functions - "jsx": "react", +// //"baseUrl": "./", // enables project relative paths config +// //"outDir": "dist/", // target for compiled files +// "allowSyntheticDefaultImports": true, // no errors with commonjs modules interop +// "esModuleInterop": true, +// "allowJs": false, // include js files +// "checkJs": false, // typecheck js files +// "declaration": true, +// "emitDecoratorMetadata": true, +// "experimentalDecorators": true, +// "forceConsistentCasingInFileNames": true, +// "importHelpers": true, // importing helper functions from tslib +// "noEmitHelpers": true, // disable emitting inline helper functions +// "jsx": "react", "lib": [ "dom", - "es2016", - "es2017.object" + "esnext" ], "target": "es2015", // "es2015" for ES6+ engines "module": "commonjs", "moduleResolution": "node", - "noEmitOnError": true, - "noFallthroughCasesInSwitch": true, - "noImplicitAny": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "noUnusedLocals": true, - "traceResolution": false, - "strict": true, - "strictNullChecks": true, - "skipLibCheck": true, - "pretty": true, - "removeComments": true, - "sourceMap": true, "resolveJsonModule": true, - "composite": true, - "declarationMap": true, - "rootDirs": [ - "./packages" - ] - }, - "exclude": [ - "node_modules" - ], - "references": [ - { - "path": "./packages/types" - }, - { - "path": "./packages/vault" - }, - { - "path": "./packages/react-vault" - }, - { - "path": "./packages/pattern-matching" - } - ] + "esModuleInterop": true +// "noEmitOnError": true, +// "noFallthroughCasesInSwitch": true, +// "noImplicitAny": true, +// "noImplicitReturns": true, +// "noImplicitThis": true, +// "noUnusedLocals": true, +// "traceResolution": false, +// "strict": true, +// "strictNullChecks": true, +// "skipLibCheck": true, +// "pretty": true, +// "removeComments": true, +// "sourceMap": true, +// "resolveJsonModule": true, +// "composite": true, +// "declarationMap": true + } +// "include": [ +// "packages/presentation-2-parser/**/*", +// "packages/**/*", +// "fixtures/**/*" +// ], +// "exclude": [ +// "node_modules" +// ], +// "references": [ +// { +// "path": "./packages/types" +// }, +// { +// "path": "./packages/presentation-2" +// }, +// { +// "path": "./packages/presentation-2-parser" +// }, +// { +// "path": "./packages/vault" +// }, +// { +// "path": "./packages/react-vault" +// }, +// { +// "path": "./packages/pattern-matching" +// }, +// { +// "path": "./fixtures" +// } +// ] } diff --git a/yarn.lock b/yarn.lock index 410d22b7..a7120d5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1452,6 +1452,11 @@ resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== +"@types/geojson@^7946.0.7": + version "7946.0.7" + resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.7.tgz#c8fa532b60a0042219cdf173ca21a975ef0666ad" + integrity sha512-wE2v81i4C4Ol09RtsWFAqg3BUitWbHSpSlIo+bNdsCJijO9sjme+zm+73ZMCa/qMC8UEERxzGbvmr1cffo2SiQ== + "@types/glob@^7.1.1": version "7.1.1" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575"