-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7504 from GlobalDataverseCommunityConsortium/IQSS…
…/6497-migrate_dataset_api IQSS/6497 migrate dataset api
- Loading branch information
Showing
12 changed files
with
371 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Release Highlights | ||
|
||
### Dataset Migration API (Experimental) | ||
|
||
Datasets can now imported following the format of an OAI-ORE export (RDA-conformant Bags), allowing for easier migration from one Dataverse installation to another, and migration from other systems. This experimental, super-user only, endpoint also allows keeping the existing persistent identifier (where the authority and shoulder match those for which the software is configured) and publication dates. | ||
|
||
This development was supported by DANS and the [Research Data Alliance](https://rd-alliance.org) and follows the recommendations from the [Research Data Repository Interoperability Working Group](http://dx.doi.org/10.15497/RDA00025). |
43 changes: 43 additions & 0 deletions
43
doc/sphinx-guides/source/_static/api/dataset-migrate.jsonld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"citation:Depositor": "Admin, Dataverse", | ||
"Title": "Test Dataset", | ||
"Subject": "Computer and Information Science", | ||
"Creator": { | ||
"author:Name": "Admin, Dataverse", | ||
"author:Affiliation": "GDCC" | ||
}, | ||
"Deposit Date": "2020-10-08", | ||
"citation:Distributor": { | ||
"distributor:Name": "Demo Dataverse Repository", | ||
"distributor:Affiliation": "Dataverse Community", | ||
"distributor:Abbreviation": "GDCC", | ||
"distributor:URL": "https://dataverse.org/global-dataverse-community-consortium" | ||
}, | ||
"citation:Contact": { | ||
"datasetContact:Name": "Admin, Dataverse", | ||
"datasetContact:Affiliation": "GDCC", | ||
"datasetContact:E-mail": "admin@demo.dataverse.org" | ||
}, | ||
"citation:Description": { | ||
"dsDescription:Text": "A short description" | ||
}, | ||
"@id": "doi:10.33564/FK27U7YBV", | ||
"schema:version": "1.0", | ||
"schema:license": "https://creativecommons.org/publicdomain/zero/1.0/", | ||
"schema:datePublished": "2021-07-21", | ||
"dvcore:fileTermsOfAccess": { | ||
"dvcore:fileRequestAccess": false | ||
}, | ||
"@context": { | ||
"Creator": "http://purl.org/dc/terms/creator", | ||
"Deposit Date": "http://purl.org/dc/terms/dateSubmitted", | ||
"Subject": "http://purl.org/dc/terms/subject", | ||
"Title": "http://purl.org/dc/terms/title", | ||
"author": "https://dataverse.org/schema/citation/author#", | ||
"citation": "https://dataverse.org/schema/citation/", | ||
"datasetContact": "https://dataverse.org/schema/citation/datasetContact#", | ||
"distributor": "https://dataverse.org/schema/citation/distributor#", | ||
"dsDescription": "https://dataverse.org/schema/citation/dsDescription#", | ||
"dvcore": "https://dataverse.org/schema/core#", | ||
"schema": "http://schema.org/" | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
doc/sphinx-guides/source/developers/dataset-migration-api.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Dataset Migration API | ||
===================== | ||
|
||
The Dataverse software includes several ways to add Datasets originally created elsewhere (not to mention Harvesting capabilities). These include the Sword API (see the :doc:`/api/sword` guide) and the /dataverses/{id}/datasets/:import methods (json and ddi) (see the :doc:`/api/native-api` guide). | ||
|
||
This experimental migration API offers an additional option with some potential advantages: | ||
|
||
* metadata can be specified using the json-ld format used in the OAI-ORE metadata export | ||
* existing publication dates and PIDs are maintained (currently limited to the case where the PID can be managed by the Dataverse software, e.g. where the authority and shoulder match those the software is configured for) | ||
* adding files can be done via the standard APIs, including using direct-upload to S3 | ||
|
||
This API consists of 2 calls: one to create an initial Dataset version, and one to 'republish' the dataset through Dataverse with a specified publication date. | ||
Both calls require super-admin privileges. | ||
|
||
These calls can be used in concert with other API calls to add files, update metadata, etc. before the 'republish' step is done. | ||
|
||
|
||
Start Migrating a Dataset into a Dataverse Collection | ||
----------------------------------------------------- | ||
|
||
.. note:: This action requires a Dataverse installation account with superuser permissions. | ||
|
||
To import a dataset with an existing persistent identifier (PID), the provided json-ld metadata should include it. | ||
|
||
.. code-block:: bash | ||
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | ||
export SERVER_URL=https://demo.dataverse.org | ||
export DATAVERSE_ID=root | ||
curl -H X-Dataverse-key:$API_TOKEN -X POST $SERVER_URL/api/dataverses/$DATAVERSE_ID/datasets/:startmigration --upload-file dataset-migrate.jsonld | ||
An example jsonld file is available at :download:`dataset-migrate.jsonld <../_static/api/dataset-migrate.jsonld>` . Note that you would need to replace the PID in the sample file with one supported in your Dataverse instance. (Also note that `Issue #8028 <https://github.com/IQSS/dataverse/issues/8028>`_ currently breaks testing this API with DataCite test DOIs.) | ||
|
||
Publish a Migrated Dataset | ||
-------------------------- | ||
|
||
The call above creates a Dataset. Once it is created, other APIs can be used to add files, add additional metadata, etc. When a version is complete, the following call can be used to publish it with its original publication date. | ||
|
||
.. note:: This action requires a Dataverse installation account with superuser permissions. | ||
|
||
.. code-block:: bash | ||
export API_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx | ||
export SERVER_URL=https://demo.dataverse.org | ||
curl -H 'Content-Type: application/jsonld' -H X-Dataverse-key:$API_TOKEN -X POST -d '{"schema:datePublished": "2020-10-26","@context":{ "schema":"http://schema.org/"}}' "$SERVER_URL/api/datasets/{id}/actions/:releasemigrated" | ||
datePublished is the only metadata supported in this call. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.