iiif-prezi/iiif-prezi3

Can't add AnnotationPage to a Canvas `items` by reference

Opened this issue · 0 comments

Per https://iiif.io/api/presentation/3.0/#53-canvas, "Referenced, external Annotation Pages must have the id and type properties."

This suggests to me that AnnotationPages appearing in items can be done so by reference.

The AnnotationPageRef class has been added to the skeleton, and we can update https://github.com/iiif-prezi/iiif-prezi3/blob/main/iiif_prezi3/helpers/to_reference.py to make sure the class is used correctly when .to_reference() is called on an AnnotationPage object (done in #185)

However, even with this, whilst you can successfully call the .to_reference() function and receive the AnnotationPageRef object, when you try to add it to a Canvas object, it gets coerced back to an AnnotationPage object due to the fact that the referenced type is not permitted in the skeleton: https://github.com/iiif-prezi/iiif-prezi3/blob/main/iiif_prezi3/skeleton.py#L328

We should clarify the intent of the spec, and then update this if appropriate.