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

Issues with retrieving IIIF collections #306

Open
BartChris opened this issue May 17, 2022 · 0 comments
Open

Issues with retrieving IIIF collections #306

BartChris opened this issue May 17, 2022 · 0 comments

Comments

@BartChris
Copy link

BartChris commented May 17, 2022

I want to retrieve an IIIF-collection via Hymir and have setup the resolver rule with a "collection"-prefix as described in the documentation.

 - pattern: ^collection-([a-zA-Z0-9-_]+)$
        substitutions:
          - 'file:/collections/$1.json'

I had the assumption that i could request a collection using the Identifier and Hymir would statically add the prefix to match the defined collection rule. But when requesting the endpoint

api/presentation/v2/collection/123456

the log indicates that there is no match and it seems like the prefix is not added.
matching 123456 against ^collection-([a-zA-Z0-9-_]+)$ is false

But if i then change my request by including the prefix in the URL
api/presentation/v2/collection/collection-123456

it seems like the prefix is added to the identifier. The consequence is that now the matching is tried with a duplicated prefix

collection-collection-123456 against ^collection-([a-zA-Z0-9-_]+)$ is true

This is of course not what i want since now i file with a collection prefix is searched which does not exist:

 Could not resolve identifier collection-collection-123456 with MIME type application/json to a readable Resource
 Attempted URIs were [file:/collections/collection-123456.json]

The only way to fix this was to not append the collection-prefix in the implementation. by taking out this line.

The rule ( ^collection-([a-zA-Z0-9-_]+)$ then works as expected (if the collection-prefix is added to the URL) and the files are delivered.

@BartChris BartChris changed the title Issues with retrieving IIIF collection Issues with retrieving IIIF collections May 17, 2022
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

1 participant