IIIF / cookbook-recipes

For working on the recipes
https://iiif.io/api/cookbook/index.html
37 stars 32 forks source link

language should be an array #546

Open tomcrane opened 1 month ago

tomcrane commented 1 month ago

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.

stephenwf commented 1 month ago

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 commented 4 weeks ago

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

ahankinson commented 1 week ago

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.