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

Potential for adding more propeties to partOf entry #9

Open
mathewjordan opened this issue Oct 25, 2022 · 2 comments
Open

Potential for adding more propeties to partOf entry #9

mathewjordan opened this issue Oct 25, 2022 · 2 comments

Comments

@mathewjordan
Copy link
Member

mathewjordan commented Oct 25, 2022

Hey Stephen,

An idea I've had for a while is to be able to extend a partOf entry of a Manifest with some additional properties. Doing so would allow the Manifest to carry some information for the Collection it may be a part of.

{
  "partOf": [
    {
      "id": "https://acw5dcf49d.execute-api.us-east-1.amazonaws.com/dev/collections/iiif-image-collection",
      "type": "Collection",
      "label": { "none": ["Commedia dell'Arte: The Masks of Antonio Fava"] },
      "summary": {
        "none": [
          "The Commedia dell'Arte, the famous improvisational theatre style born in Renaissance Italy, remains a major influence in today's theatre. Antonio Fava is an actor, comedian, author, director, musician, mask maker and Internationally renowned Maestro of Commedia dell'Arte."
        ]
      },
      "homepage": [
        {
          "id": "https://dc.library.northwestern.edu/collections/c373ecd2-2c45-45f2-9f9e-52dc244870bd",
          "type": "Text",
          "label": {
            "none": ["Commedia dell'Arte: The Masks of Antonio Fava"]
          },
          "format": "text/html"
        }
      ],
      "thumbnail": [
        {
          "id": "https://iiif.stack.rdc.library.northwestern.edu/iiif/2/180682c9-dfaf-4881-b7b6-1f2f21092d4f/full/200,/0/default.jpg",
          "type": "Image",
          "format": "image/jpeg",
          "service": [
            {
              "id": "https://iiif.stack.rdc.library.northwestern.edu/iiif/2/180682c9-dfaf-4881-b7b6-1f2f21092d4f",
              "profile": "http://iiif.io/api/image/2/level2.json",
              "type": "ImageService2"
            }
          ],
          "width": 200,
          "height": 200
        }
      ]
    }
  ]
}

Currently, it seems like the partOf property strips out homepage and does an $UNSET for thumbnail. I'd love to gauge your thoughts on this but I do wonder how possible it might be to allow some of these properties.

@adamjarling
Copy link
Member

Hey @stephenwf We're going to help out with this issue in our next work cycle, if that's ok with you.

@stephenwf
Copy link
Member

There is some new features in the parser, but it's not yet ready!
IIIF-Commons/parser#23

I'll try to explain with one of the test fixtures.

{
  "format": "image/jpeg",
  "height": 3024,
  "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/full/max/0/default.jpg",
  "iiif-parser:hasPart": [
    {
      "@explicit": true,
      "format": {},
      "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/full/max/0/default.jpg",
      "iiif-parser:partOf": "https://example.org/canvas-2",
      "type": "Image",
    },
    {
      "@explicit": true,
      "format": {},
      "height": {},
      "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/full/max/0/default.jpg",
      "iiif-parser:partOf": "https://example.org/canvas-1",
      "service": {},
      "type": "Image",
      "width": {},
    },
  ],
  "service": [
    {
      "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen",
      "profile": "level1",
      "type": "ImageService3",
    },
  ],
  "type": "Image",
  "width": 4032,
}

This is the format that will be in the v2 parser when you import a resource with the same ID more than once. The iiif-parser:hasPart describes which properties should be present when it's "part of" the original resource.

It uses a subset of JSON-LD Framing. The main parts are {} which is a wild-card (take the whole value) and then everything else is overrides.

{
  "@explicit": true,
  "format": {},
  "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/full/max/0/default.jpg",
  "iiif-parser:partOf": "https://example.org/canvas-2",
  "type": "Image",
}

This would resolve to:

{
  "format": "image/jpeg",
  "id": "https://iiif.io/api/image/3.0/example/reference/918ecd18c2592080851777620de9bcb5-gottingen/full/max/0/default.jpg",
  "type": "Image"
}

So in your example above, the Collection could have:

{
  "id": "https://acw5dcf49d.execute-api.us-east-1.amazonaws.com/dev/collections/iiif-image-collection",
  "type": "Collection",
  "iiif-parser:hasPart": [
    {
      "@explicit": true,
      "id": "https://acw5dcf49d.execute-api.us-east-1.amazonaws.com/dev/collections/iiif-image-collection",
      "iiif-parser:partOf": "https://example.org/manifest",
      "type": "Collection",
      "label": {},
      "summary": {},
      "homepage": {},
      "thumbnail": {}
    },
  ],
  "..."
}

And similarly, the role of iiif-builder could be to encode that in some way.

However, there is still quite a bit of work and testing before the v2 parser is good to go. I think making an exception for Manifest.partOf -> Collection to have extra properties would be a good addition. Let me know when you are working on it, and I'll try and help with any parser/serialisation changes required!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants