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

language should be an array #546

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

language should be an array #546

wants to merge 2 commits into from

Conversation

tomcrane
Copy link
Contributor

@tomcrane tomcrane commented Oct 12, 2024

This passes the validator so I was beginning to doubt myself, but just tripped up a parser of ours.

https://iiif.io/api/presentation/3.0/#language

Also noticed a space where it shouldn't be.

@tomcrane tomcrane requested a review from stephenwf October 12, 2024 17:50
@stephenwf
Copy link
Contributor

stephenwf commented Oct 12, 2024

This ones tricky, because the IIIF specification does say it should be an array but the W3C model says it could be either.

The IIIF specification example also has both - with the language in the annotation body being just a single value.
https://iiif.io/api/presentation/3.0/#b-example-manifest-response

Screenshot 2024-10-12 at 18 59 50

W3C: https://www.w3.org/TR/annotation-model/#h-bodies-and-targets

@glenrobson
Copy link
Member

Will need to fix the validator to allow arrays and strings for this.

"language": "en"
"language": ["en"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Because the annotation model (and the IIIF Specification itself) has single languages as string values in annotation bodies - I think this should too.

@ahankinson
Copy link

As far as I remember when doing the v3.0 spec, it was decided? hoped? that by making values consistently an array, even if they were arrays of single values, it would help developer ergonomics since they could reasonably assume that everything was an array, rather than needing to constantly check the datatype for each field (which is what you needed to do in v2). It was noted at the time that (particularly for language maps) this diverged from the ways you could do it in the Web Annotation spec, but that IIIF could choose to be consistent.

I think we discussed this at the meeting in Toronto, specifically... I'm hoping I'm not misremembering.

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

Successfully merging this pull request may close these issues.

4 participants