Stash::Merritt

Build Status Code Climate Inline docs

Packaging and SWORD 2.0 deposit module for submitting Stash datasets to Merritt.

Submission process

The Stash::Merritt::SubmissionJob class does the following:

  1. if no identifier is present, mint a new DOI with EZID (using the ezid-client gem) and assign it to the resource
  2. generate a ZIP package containing:

| filename | purpose | | -------- | ------- | | stash-wrapper.xml | Stash wrapper, including Datacite 4 XML | | mrt-datacite.xml | Datacite 3 XML, for Merritt internal use. | | mrt-oaidc.xml | Dublin Core metadata, packaged in oai_dc format for OAI-PMH compliance | | mrt-dataone-manifest.txt | legacy DataONE manifest* | | mrt-delete.txt | list of files to be deleted in this version, if any |

* Note that the DataONE manifest is generated for all tenants, not just DataONE.

  1. using the stash-sword gem, submit the package to Merritt via SWORD 2.0; update the download_uri and update_uri of the resource if not present
  2. set the resource version_zipfile
  3. again via ezid-client, update the target URL (landing page) and Datacite 3 metadata for the DOI
  4. clean up uploads and other temporary files
  5. returns a successful SubmissionResult

If at any point one of these steps fails, the job exits with a failed SubmissionResult.

Development

Dependencies

stash-merritt expects to find the stash_engine and stash_datacite source locally under a sister directory stash_engines:

┬── stash-merritt
└── stash_engines
    ├── stash_datacite
    └── stash_engine

Test database creation

For compatibility with Travis, you need

  1. a local MySQL installation
  2. a travis@localhost user with no password
  3. a stash_merritt database
  4. travis to have all privileges on that database

This should look something like:

$ mysql -u root
mysql> create user 'travis'@'localhost';
mysql> create database stash_merritt character set UTF8mb4 collate utf8mb4_bin;
mysql> use stash_merritt;
mysql> grant all on stash_merritt.* to 'travis'@'localhost';