CDLUC3 / dmphub

Simple metadata repository for networked DMPs
MIT License
3 stars 1 forks source link

DMPHub

Brakeman Rubocop RSpec

Overview

The DMPHub is a metadata repository for Data Management Plans (DMP). It can gather DMP metadata from many different sources and can be extended to interact with other APIs to collect/harvest additional metadata to enhance or refine the DMP record (e.g. grant IDs, journal articles, datasets, etc.).

The DMPHub serves two primary purposes:

  1. To host a public landing page for the DMP ID (see below)
  2. Act as a proxy between an external system and EZID for the purpose of acquiring DMP IDs

The DMPHub does not currently pro vide any UI pages to allow a user to add or edit DMP metadata. All management of DMP metadata is meant to be performed via it's API.

The DMPHub provides an API that communicates via the new metadata standard developed by an RDA working group called the RDA common standard for machine-actionable data management plans.

See the Wiki for more information on the API.

What is a DMP ID

A DMP ID is a unique persistent identifier for a data management plan. The exact format of the DMP ID can change depending on the minting authoriy used (e.g. DOI, ARK, etc.).

DataCite will begin providding support for DMP IDs in schema 4.4. Once released, you will be able to query DataCite's EventData API to discover other identifiers related to a DMP.

Security

The DMPHub uses the concept of ApiClients. There is no admin UI interface at this time, so you must add records manually to the api_clients table in order to provide access for an external system. You must also add a corresponding record to the provenances and api_client_permissions tables for each ApiClient.

We recommend running rails sceret to generate a unique identifier for your client_id and client_secret entries.

Example api_clients record:

name: 'dmphub'   # Required - should be lowercase and MUST match the corresponding provenance record
description: 'Local account used for testing' # Optional
hompage: 'https://dmphub.example.org' # Optional
contact_name: 'Jane Doe' # Optional
contact_email: 'jane.doe@example.org' # Required
client_id: 'my_client_id'
client_secret: 'my_client_secret'
last_access: '2021-03-01 10:30:23' # Maintained and updated by the API code

Example api_client_permissions record (note that permission 1 & 2 have not yet been implemented):

api_client_id: 1
permission: 0 # 0 = data_management_plan_creation, 1 = funding_assertion 2 = contributor_assertion

Example provenances record:

name: 'dmphub' # Required - should be lowercase
description: 'Local account used for testing' # Optional

The DMPHub controls which users/systems can modify a DMP's record through the api_client_authorizations table. By default, the ApiClient that creates the DMP has full access to make modifications to that DMP.

See the API documentation on the Wiki for more details on API authentication and authorization.

Versioning

The DMPHub does not officially version a DMP's metadata. It relies on the original system that sent it the created the DMP to maintain proper versions and to notify the DMPHub when a new version is available.

A system can convey that it is sending a new version through the modified date on the incoming JSON record.

The DMPHub does however record all changes for simple debugging purposes. It stores these changes in the alterations table. An alteration record contains the type of object (e.g. DataManagementPlan, Affiliation, etc.), it's record id, and the change log. The change log is a hash of fields with 2 entries, the original value and the new value. For example:

alterable_id: 123
alterable_type: 'Contributor'
change_log: { "name": ["John Doe", "John Doe PhD"], "affiliation_id": [12, 98] }
provenance: 1

Funding

Original funding for the DMPHub was provided by an NSF EAGER grant for work surrounding machine-actionable DMPs (maDMPs)

Feedback

We welcome any and all feedback. Please use Github Issues to provide suggestions or to report a bug, and a PR if if you wish to contribute.

Get Involved

We welcome collaborators and anyone wishing to use or extend the code.

Requirements

Installation

Once the application is up and running you can do the following to ensure that the API is functional:

Once you have confirmed that the site is operational you can follow the API instructions in the Wiki to start adding DMPs.

You can use the code in lib/tasks/utils/api_tester.rake as an example for accessing the DMPHub's API.

Don't forget to change the client_id and client_secret for the default dmphub ApiClient!