mjordan / persistent_identifiers

Drupal 8/9 Module that provides a generalized framework for minting and persisting persistent identifiers (DOIs, ARKs, etc.).
GNU General Public License v2.0
5 stars 11 forks source link

create an alias on demand for identifiers #12

Open Natkeeran opened 4 years ago

Natkeeran commented 4 years ago

There are use cases to show the identifiers portion of the pid/url as the url of a resource.

For example,given https://n2t.net/ark:/67531/metadc107835/ as the pid of the object, and it resolves to dsu.example.com/node/2, we would like to have an alias so that it can resolve to dsu.example.com/67531/metadc107835/.

Would like to have the option to resolve to dsu.example.com/67531/metadc107835 by default for all objects in a repository. This is specially useful for multisites, where node/id can collide easily.

mjordan commented 4 years ago

@Natkeeran thanks for this feature request.

mjordan commented 3 years ago

@Natkeeran I now have a submodule that mints and bind ARKs via N2T (in the n2t branch). I can add this alias feature if you'd like but I have a question. Is the alias you want always everything after the ark: scheme? The module supports "branded" ARKs, which can use a local hostname to redirect to the ARK resolver (see more info at http://n2t.net/e/n2t_apidoc.html). I want to make sure that circular redirects are not possible, e.g. a branded ARK that redirects back to the Drupal host, which then redirects to the ARK resolver, which then resolves to the Drupal host. I think if we remove the ark:/ scheme that will prevent circular redirects.

I'd like this feature to be applicable to any identifier scheme, for example DOIs, Handles, etc.

mjordan commented 3 years ago

I have working code for this in the n2t branch. It removes the PID namespace, anything up to and including a the first : if one is present. For example, when the ARK https://ids-n2t2-stg.n2t.net/ark:/99999/fq3rc75 is created, the alias is /99999/fq3rc75. Admins activate the option to create URL aliases via a checkbox at the bottom of admin/config/persistent_identifiers/settings.

One gotcha: nodes can only have one URL alias. If a node has a URL alias, the one created by this module replaces it. Is that acceptable?

Natkeeran commented 3 years ago

@mjordan Thanks Mark. As alias creation is an option, this seems reasonable. I assume if the user wants to overwrite the url aliases for some objects, they can still do it afterwards.