Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skeleton issue: A Reference can have an items Property (ManifestRef, CollectionRef) #226

Open
markpbaggett opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@markpbaggett
Copy link
Member

According to the validation schema, a Reference cannot have items:

https://github.com/IIIF/presentation-validator/blob/main/schema/iiif_3_0.json#L103

This ensures many things such as Manifests not getting embedded in Collections.

Expected behaviour:

An error is thrown if an instance of a Reference is passed items or items is dropped when this is attempted.

Observed behaviour:

If items is passed, it is kept. For instance, if you use make_manifest() and pass a full manifest, the manifest gets embedded on the collection. For example:

from iiif_prezi3 import Collection

collection = Collection(
    id="https://example.com/collection/1",
)
collection.make_manifest(
    id="https://example.com/collection/1",
    items=[
    {
      "id": "https://iiif.io/api/cookbook/recipe/0001-mvm-image/canvas/p1",
      "type": "Canvas",
      "height": 1800,
      "width": 1200,
      "items": [
        {
          "id": "https://iiif.io/api/cookbook/recipe/0001-mvm-image/page/p1/1",
          "type": "AnnotationPage",
          "items": [
            {
              "id": "https://iiif.io/api/cookbook/recipe/0001-mvm-image/annotation/p0001-image",
              "type": "Annotation",
              "motivation": "painting",
              "body": {
                "id": "http://iiif.io/api/presentation/2.1/example/fixtures/resources/page1-full.png",
                "type": "Image",
                "format": "image/png",
                "height": 1800,
                "width": 1200
              },
              "target": "https://iiif.io/api/cookbook/recipe/0001-mvm-image/canvas/p1"
            }
          ]
        }
      ]
    }
  ]
)

Potential bug location(s):

I'm sure the Extras.allow is the problem:

https://github.com/iiif-prezi/iiif-prezi3/blob/main/iiif_prezi3/skeleton.py#L425-L428

Any other comments:

If this is difficult to handle in the schema and skeleton, maybe we could just make a concerted effort to handle this in helpers and with tests.

@markpbaggett markpbaggett added the bug Something isn't working label Jan 17, 2025
@markpbaggett markpbaggett changed the title Skeleton issue: A Reference can have an Items Property (ManifestRef, CollectionRef) Skeleton issue: A Reference can have an items Property (ManifestRef, CollectionRef) Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant