Manually updating DOI metadata

From Dryad wiki
Revision as of 09:24, 1 July 2016 by Ryan Scherle (talk | contribs) (Using ezid.py to update DOI registrations)

Jump to: navigation, search

Overview

When DOIs are registered with EZID through the REST API, it is not possible to manually edit metadata through the web interface.

EZID provides a python command-line tool that communicates with this API. It is documented in the ezid.cdlib.org EZID API Docs: ezid.py

When Dryad sends metadata to ezid, the metadata uses the DataCite XML schema, and is ANVL-encoded. The ezid.py script will handle the ANVL encoding, but the user must provide datacite metadata in XML format.

Manually generating DataCite XML

Dryad generates metadata by transforming XML documents with an XSL, and this process can be replicated using simple command line tools

  1. Copy the DIM2DATACITE.xsl stylesheet file from the dryad-repo/config/crosswalks directory to a local working location
  2. Determine the item's metadata URL. If the item is at http://www.datadryad.org/resource/doi:10.5061/dryad.a1b2c, just add /mets.xml to the URL. Visit the URL in a web browser, and confirm there is an XML document with expected metadata.
  3. Generate a datacite XML document using xsltproc:
    xsltproc DIM2DATACITE.xsl http://www.datadryad.org/resource/doi:10.5061/dryad.a1b2c/mets.xml > datacite-dryad.a1b2c.xml

The XML document can now be modified.

Validating DataCite XML

After making modifications, It's a good idea to validate the xml against the DataCite XSD. This can be done with the xmllint tool:

xmllint --noout --schema http://schema.datacite.org/meta/kernel-2.2/metadata.xsd datacite-a1b2c.xml
datacite-a1b2c.xml validates

Be sure to check schema.datacite.org for the latest schema.

Using ezid.py to update DOI registrations

EZID provides a python script to access their API: ezid.py

Items registered with ezid have elements for target and datacite metadata. To update the target (destination URL), the element name is target and the value is the URL. Note that the identifier is capitalized, this is EZID's convention:

python ezid.py username:password update doi:10.5061/DRYAD.A1B2C target http://datadryad.org/resource/doi:10.5061/dryad.A1B2C

To update the datacite metadata, the element name is datacite and the value is the path to your xml file (the @ indicates to read from the file):

python ezid.py username:password update doi:10.5061/DRYAD.A1B2C datacite @datacite-dryad.a1b2c.xml

ezid.py should allow both on the same line for easier scripting:

python ezid.py username:password update doi:10.5061/DRYAD.A1B2C target http://datadryad.org/resource/doi:10.5061/dryad.A1B2C datacite @datacite-dryad.a1b2c.xml

See Also