-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Milestone
Description
Right now, it doesn't seem possible to use the library for contentState recipes like:
- https://iiif.io/api/cookbook/recipe/0485-contentstate-canvas-region/
- https://iiif.io/api/cookbook/recipe/0540-link-for-opening-multiple-canvases/
This is because of https://github.com/iiif-prezi/iiif-prezi3/blob/main/iiif_prezi3/skeleton.py#L304.
I think this needs to be:
target: Union[AnnoTarget, List[AnnoTarget], CanvasRef, List[CanvasRef]]
Example Code and Results
from iiif_prezi3 import Annotation, CanvasRef, config
config.configs['helpers.auto_fields.AutoLang'].auto_lang = "en"
canvas = CanvasRef(
id="https://iiif.io/api/cookbook/recipe/0009-book-1/canvas/p2#xywh=1528,3024,344,408",
type="Canvas",
partOf=[
{
"id": "https://iiif.io/api/cookbook/recipe/0009-book-1/manifest.json",
"type": "Manifest"
}
]
)
annotation = Annotation(
id="https://example.org/import/1",
motivation="contentState",
type="Annotation",
target=canvas
)
print(annotation.json(indent=2))
Results in:
{
"@context": "http://iiif.io/api/presentation/3/context.json",
"id": "https://example.org/import/1",
"type": "Annotation",
"motivation": "contentState",
"target": {
"id": "https://iiif.io/api/cookbook/recipe/0009-book-1/canvas/p2#xywh=1528,3024,344,408",
"type": "Canvas",
"partOf": [
{
"id": "https://iiif.io/api/cookbook/recipe/0009-book-1/manifest.json",
"type": "Manifest"
}
]
}
}