Skip to content

First pass of a v4 cookbook#598

Open
glenrobson wants to merge 56 commits into
masterfrom
v4
Open

First pass of a v4 cookbook#598
glenrobson wants to merge 56 commits into
masterfrom
v4

Conversation

@glenrobson

@glenrobson glenrobson commented Apr 8, 2025

Copy link
Copy Markdown
Member

Steps for adding a v4 recipe for example 0001-mvm-image:

  1. Make a directory in 0001-mvm-image called v4.
  2. Rename the index.md in 0001-mvm-image to recipe.md
  3. copy everything in 0001-mvm-image to v4
  4. Edit the manifest.json and recipe.md in v4 to make it work for v4
  5. Add a index.json similar to the one in this pull requests which will show both recipes.

Notes:

  • Frontmatter is only present in the index.md parent recipe so all topics, viewers and other things need to go in this file rather than the child recipes
  • added a new field to index.md v4-viewers to list v4 supporting recipes
  • Need a more elegant way of linking to v3 only recipes in a v4 recipe.
  • Maybe highlight which versions of a recipe are aviliable when linking to a recipe.
  • Will need to think about validation of v4 and sending v3 files to v3 validator and vise versa.

@glenrobson

Copy link
Copy Markdown
Member Author

Example v3 and v4 recipe: https://preview.iiif.io/cookbook/v4/recipe/0001-mvm-image/

@glenrobson glenrobson linked an issue Apr 8, 2025 that may be closed by this pull request
Comment thread recipe/0001-mvm-image/v4/recipe.md Outdated

This illustrates the mandatory structure and properties of a manifest, with the simplest possible content.

The JSON-LD opens with the `@context` declaration, which identifies the terms used in the document as belonging to the IIIF specification. The `id` property identifies this manifest with the URL at which it is available online. The `type` property must be `Manifest`. The `label` property is mandatory, and the language of its value must be given (or the special value `none`), using a [language map][prezi3-languages]. Here the language of the label is English and its value is "Single Image Example". The manifest's `items` property is a list of canvases. In this example there is only one canvas, with a `height` of 1800 and a `width` of 1200. These units have no dimension: they establish a coordinate space that in this case the single image will fill. The canvas's `id` property is used later as the `target` of the annotation that links to the single image.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point to version 4 of the spec: [language map][prezi3-languages]

I'm surely overthinking this, but I don't want readers to skip these annotations as if they are _only_ building blocks
"id": "{{ id.path }}/annotation/p0001-image",
"type": "Annotation",
"motivation": "painting",
"body": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value must be an array of JSON objects.
https://preview.iiif.io/api/prezi-4/presentation/4.0/model/#body

"id": "{{ id.path }}/timeline/page/annotation",
"type": "Annotation",
"motivation": "painting",
"body": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value must be an array of JSON objects.
https://preview.iiif.io/api/prezi-4/presentation/4.0/model/#body

"id": "{{ id.path }}/canvas/page/annotation",
"type": "Annotation",
"motivation": "painting",
"body": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value must be an array of JSON objects.
https://preview.iiif.io/api/prezi-4/presentation/4.0/model/#body

Comment thread recipe/0002-mvm-audio/v4/manifest.json Outdated
"format": "audio/mp4",
"duration": 1985.024
},
"target": "{{ id.path }}/timeline"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value must be an array of JSON objects.
https://preview.iiif.io/api/prezi-4/presentation/4.0/model/#target

Suggested change
"target": "{{ id.path }}/timeline"
"target": [{"id": "{{ id.path }}/timeline", "type": "Timeline"}]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with body, the current RC has target as a singular JSON object. https://iiif.io/api/presentation/4.0/model/#target

Comment thread recipe/0003-mvm-video/v4/manifest.json Outdated
"duration": 572.034,
"format": "video/mp4"
},
"target": "{{ id.path }}/canvas"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value must be an array of JSON objects.
https://preview.iiif.io/api/prezi-4/presentation/4.0/model/#target

Suggested change
"target": "{{ id.path }}/canvas"
"target": [{"id": "{{ id.path }}/canvas", "type": "Canvas"}]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current RC has target as a singular JSON object. https://iiif.io/api/presentation/4.0/model/#target

Comment thread recipe/0608-mvm-3d/v4/manifest.json Outdated
"type": "Model",
"format": "model/gltf-binary"
},
"target": "{{ id.path }}/scene/1/annotationPage/1"

@stephenwf stephenwf Feb 13, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value must be an array of JSON objects.
https://preview.iiif.io/api/prezi-4/presentation/4.0/model/#target

Suggested change
"target": "{{ id.path }}/scene/1/annotationPage/1"
"target": [{"id":"{{ id.path }}/scene/1", "type": "Scene"}]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it targets the AnnotationPage instead of the Scene. (updated the suggestion)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the referenced part, but left the syntax as current RC says "a JSON object"

Comment on lines +21 to +25
"body": {
"id": "https://raw.githubusercontent.com/IIIF/3d/main/assets/astronaut/astronaut.glb",
"type": "Model",
"format": "model/gltf-binary"
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value must be an array of JSON objects.
https://preview.iiif.io/api/prezi-4/presentation/4.0/model/#body

Suggested change
"body": {
"id": "https://raw.githubusercontent.com/IIIF/3d/main/assets/astronaut/astronaut.glb",
"type": "Model",
"format": "model/gltf-binary"
},
"body": [{
"id": "https://raw.githubusercontent.com/IIIF/3d/main/assets/astronaut/astronaut.glb",
"type": "Model",
"format": "model/gltf-binary"
}],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current API RC describes body as being a (singular) JSON object, if I'm reading correctly.

These edits both bring the 4 minimum viable manifest recipes more in line with each other and also highlight differences better. With v4, there are more significant differences, so for instance the audio recipe needs to spell out more what it shares with the other kind of manifests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta: v4 Notable for v4 (deferred to v4 if there's also the "defer" label)

Projects

Status: Low priority

Development

Successfully merging this pull request may close these issues.

How to handle IIIF v3 and v4 recipes

4 participants