DOI Minting Service

A DOI is minted via a request to the DataCite API with the relevant info. This is attempted if the UI checkbox Publish on Save is clicked before saving the record, or if the value publish_on_save is set as true in an API POST/PUT request made to the citation service.

Fetch the unique ROR id link for an institution.

citations.external.minting.mint_doi_for_record(data: dict, publication_timestamp: str, id: str, return_citation: bool = False) str[source]

Apply to mint a DOI via DataCite for the information in this record.

Create the DOI request and send to DataCite. This includes assembling the DataCite-compliant JSON payload.

citations.external.minting.resolve_drs(drs_url: str | None) bool[source]

Resolve a DRS URL to check if data exists.

This should return False if the DRS (Data Access) URL returns a 404 or some other response to indicate the data is not available. This function prevents DOIs being minted for records where the data is not yet accessible.

citations.external.minting.publish_record(data: dict, id: str) str[source]

Apply to mint a DOI via DataCite for the information in this record.

Assemble the published flag and set the publication year in the resulting data.