Open utterances-bot opened 1 year ago
Cool! Re: the ark:/
to ark:
migration, it is intended that any resolver support both the old-style expression (with a /
after ark:
) and the new one. If you can update to support both, that would be excellent.
well done!
I think this is possible, but I can't imagine it being elegant. Some ideas:
url_prefix
's.My strategy has been a blanket rewrite-and-redirect in a FastAPI app:
@app.get(
"/ark:/{naan}/{rest_of_path:path}",
response_class=RedirectResponse,
tags=["util"],
summary="Get ARK (Slash Before NAAN)",
)
async def _ark(naan: ArkNaan, request: Request):
"""normalize request to not have slash (/) preceding ark naan."""
return RedirectResponse(
url=str(request.url).replace("ark:/", "ark:"), status_code=301
)
I know this can be done at a higher level, e.g. at a reverse proxy level via e.g. an Apache RewriteRule, but it would be nice to work "out of the box" for n2t-ark-resolver
.
The new URN syntax (RFC 8141) does allow the use of slash, so it is up to the ARK community to decide whether to keep it. So an ARK like ark:/53355/cl010277627 may be left unchanged or converted to URN urn:ark:53355/cl010277627. IMO the version without the slash looks better. I don't know if the ARK alliance is planning to register a URN namespace, but I would welcome such decision.
Re-implementing the N2T ARK Resolver | Biopragmatics
Archival Resource Keys (ARKs) are flavor of persistent identifiers like DOIs, URNs, and Handles that have the benefit of being free, flexible with what metadata gets attached, and natively able to resolve to web pages. Name-to-Thing (N2T) implements a resolver for a variety of ARKs, so this blog post is about how that resolver can be re-implemented with the curies Python package.
https://cthoyt.com/2023/04/11/n2t-ark-resolver.html