persistent_identifiers
Provides capabilities for minting and persisting persistent identifiers (Handles, DOIs, ARKs, etc.) for nodes.
This module's primary use case was to provide this service for Islandora objects, but it can be used without Islandora. Preliminary discussion that lead to this module can be found at Islandora/documentation#1042 and Islandora/documentation#1256.
Persistent identifiers can be minted by a variety of sources, such as CrossRef, DataCite, or EZID. Regardless of the specific source, many of the tasks involved in assigning persistent identifiers to Drupal nodes are the same - providing a "Mint Identifier" button in a node edit form, integration into automated workflows, or persisting identifiers to fields on an entity.
This module provides some common tasks while allowing small amounts of code (specifically Drupal services) to handle the particulars of minting and persisting. In addition, a Drupal site admin might want to mix and match minting and persisting services. Generally speaking, this module's goal is to allow site admins to select the minters and persisters they want, while helpin developers to write as little code as necessary to create new minter and persister services.
Minters available
- Handle (contributed by @elizoller)
- DataCite DOI Minter
- EZID ARKs
Persisters available
- Generic Text Field
Configuration
- Assign the "Mint persistent identifiers" permission to desired roles.
- Visit /admin/config/persistent_identifiers/settings for options. Specific configuration options will vary depending on which Minter you select. See the README file for each Minter for more information.
The option exists to add the persistent identifier to the JSON-LD for a node, mapped to schema:sameAs. If this is option is checked, and the resolver base URL "https://example.com/ids" is configured, the JSON-LD will look like this if the persistent identifier is "10.80484/eb7f-x968":
"http:\/\/schema.org\/sameAs":[
{
"@id":"http:\/\/localhost:8000\/node\/1"
},
{
"@id":"https:\/\/example.com\/ids\/10.80484\/eb7f-x968"
}
]
Usage
This module works with a submodule (there are several) to "mint" and "persist" identifiers by showing the following at the bottom of the node add/edit form to users with the "Mint persistent identifiers" permission:
Minter submodules may provide additional workflow options such as using Views Bulk Operations to mint persistent IDs for a batch of nodes. The DataCite DOI module offers this option, for example.
History
This module was originally developed by Mark Jordan and was originally located on a GitHub repository. He relinquished further development and maintenance in Sep 2023 and generously agreed for it to be cloned and moved to Drupal.org for continued maintenance by the Drupal community. Thanks Mark.
Handle minter was contributed by elizoller
EZID ARK minter was contributed by seth-shaw-unlv
Writing minters
At a minimum, a minter module contains a services that "mints" (creates) the persistent identifier that mints the identifier. In its .services.yml file, the service must be registered using the ID pattern foo.minter.sample, where foo is the module's namespace and sample is unique to the minter. minter is a literal string. If the minter requires admin settings, the module should also include an implementation of hook_form_alter() that adds minter-specific settings to the admin form at /admin/config/persistent_identifiers/settings, and also adds minter-specific UI elements and validation to the node add/edit form.
The service class is implemented in the module's src/Minter directory, and implements MinterInterface. The persistent identifier is generated within and returned by the class's mint() method. See the source code in modules/sample_minter for more detail.