Manually updating DOI metadata

From Dryad wiki
Revision as of 08:55, 18 July 2013 by DanLeehr (talk | contribs) (Created page with "= 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-...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 n2t.net 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. Edit the DIM2DATACITE.xsl file. Look around line 14, and change
    <xsl:template match="/dim:dim">
    to
    <xsl:template match="/mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim">
  3. 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.
  4. Generate a datacite XML document using xsltproc:
    xsltproc DIM2DATACITE-modified.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

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