From 5b68c516f8fb4806f2ffeaa11283f1dfb83bc382 Mon Sep 17 00:00:00 2001 From: Alin Vetian Date: Wed, 23 Oct 2024 10:01:12 +0300 Subject: [PATCH 01/17] added versioning to API response --- app/controllers/api_application_controller.rb | 3 ++ app/controllers/stash_api/versioning.rb | 34 +++++++++++++ documentation/apis/README.md | 21 ++++++++ spec/requests/api_controller_spec.rb | 48 +++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 app/controllers/stash_api/versioning.rb diff --git a/app/controllers/api_application_controller.rb b/app/controllers/api_application_controller.rb index 6f72ca21ee..ec8a97aa71 100644 --- a/app/controllers/api_application_controller.rb +++ b/app/controllers/api_application_controller.rb @@ -5,10 +5,13 @@ # class ApplicationController < ActionController::Base class ApiApplicationController < StashEngine::ApplicationController + include StashApi::Versioning layout 'layouts/stash_engine/application' before_action :log_request + before_action :set_response_version_header + before_action :check_requested_version skip_before_action :verify_authenticity_token DEFAULT_PAGE_SIZE = 20 diff --git a/app/controllers/stash_api/versioning.rb b/app/controllers/stash_api/versioning.rb new file mode 100644 index 0000000000..93d6481a12 --- /dev/null +++ b/app/controllers/stash_api/versioning.rb @@ -0,0 +1,34 @@ +module StashApi + module Versioning + extend ActiveSupport::Concern + + private + + def set_response_version_header + response.headers['X-API-Version'] = api_version + return if api_version == current_version + + response.headers['X-API-Deprecation'] = 'true' + end + + def check_requested_version + return if !requested_version || requested_version == current_version + + render json: { error: "Unsupported API version: #{requested_version}, latest version is: #{current_version}" }, status: 400 + end + + def current_version + '2.1.0' + end + + def api_version + return requested_version if requested_version + + request.path.include?('/api/v2') ? '2.1.0' : '1.0.0' + end + + def requested_version + @requested_version ||= request.headers['X-API-Version'] + end + end +end diff --git a/documentation/apis/README.md b/documentation/apis/README.md index 7293928210..d98a7d2eff 100644 --- a/documentation/apis/README.md +++ b/documentation/apis/README.md @@ -50,3 +50,24 @@ Dryad maintains a variety of reports regarding its content. - Reports that are automatically generated on a regular basis are available at `https://datadryad.org/api/v2/reports` - Reports that are generated less frequently are available through our [Data about Dryad](https://github.com/datadryad/dryad-data/) repository + +API Versioning +============ + +The Dryad API uses [Semantic Versioning](https://semver.org/) to track changes to the API. + +The current version of our API is `2.1.0`. This is also the only supported API versions, at the moment. + +In order to use the latest API version, you can: +- Use `https://datadryad.org/api/v2/` as the base URL for all API requests. +- You can also send send the `X-API-Version: 2.1.0` + +We added 2 new response headers: +- The `X-API-Version` header to allow clients to specify the version of the API they are using. +- The `X-API-Deprecation` header to notify clients if the version they are using is deprecated and will be removed in the future. + +In case a bad version number is used, the API will respond with: +- `400` error status. +- `{ "error": "Unsupported API version: {requested-version}, latest version is: 2.1.0" }` in the response body. +- The `X-API-Version` header set to the version of the API you requested. +- The `X-API-Deprecation` header set `true`. This header will not be returned in case the version you are using is not deprecated. \ No newline at end of file diff --git a/spec/requests/api_controller_spec.rb b/spec/requests/api_controller_spec.rb index 039881536a..83eb7608ab 100644 --- a/spec/requests/api_controller_spec.rb +++ b/spec/requests/api_controller_spec.rb @@ -35,5 +35,53 @@ module StashApi expect(hsh['_links']['stash:datasets']['href']).to eql('/api/v2/datasets') end end + + describe '#versioning' do + before { post '/api/v2/test', headers: request_headers } + + context 'with no X-API-Version header' do + context 'with current API version' do + let(:request_headers) { default_authenticated_headers } + + it 'is successful and has correct response headers' do + expect(response).to be_successful + expect(response.headers['X-API-Version']).to eql('2.1.0') + expect(response.headers['X-API-deprecation']).to be_nil + end + end + end + + context 'with X-API-Version header' do + context 'with current API version' do + let(:request_headers) { default_authenticated_headers.merge('X-API-Version' => '2.1.0') } + + it 'is successful and has correct response headers' do + expect(response).to be_successful + expect(response.headers['X-API-Version']).to eql('2.1.0') + expect(response.headers['X-API-Deprecation']).to be_nil + end + end + + context 'with old API version' do + let(:request_headers) { default_authenticated_headers.merge('X-API-Version' => '1.0.0') } + + it 'returns 400 and has correct response headers' do + expect(response.status).to eql(400) + expect(response.headers['X-API-Version']).to eql('1.0.0') + expect(response.headers['X-API-Deprecation']).to be_truthy + end + end + + context 'with bad API version' do + let(:request_headers) { default_authenticated_headers.merge('X-API-Version' => 'bad version') } + + it 'returns 400 and has correct response headers' do + expect(response.status).to eql(400) + expect(response.headers['X-API-Version']).to eql('bad version') + expect(response.headers['X-API-Deprecation']).to be_truthy + end + end + end + end end end From e78bcf0085e4126427ceaeeddb9c5ad103ce3517 Mon Sep 17 00:00:00 2001 From: Alin Vetian Date: Mon, 28 Oct 2024 18:33:58 +0200 Subject: [PATCH 02/17] Updated default dataset license, updated existing datasets rights to use SPDX --- app/views/layouts/_best_practices.html.md | 2 +- .../licenses/_license_sidebar.html.erb | 2 +- config/licenses.yml | 4 ++-- db/data/20241028110859_updated_cc0_license.rb | 13 ++++++++++++ documentation/apis/embedded_submission.md | 4 ++-- dryad-config-example/licenses.yml | 4 ++-- lib/stash/wrapper/license.rb | 6 +++--- .../zenodo_replicate/metadata_generator.rb | 2 +- public/api/v2/docs/examples/dataset.json | 2 +- public/api/v2/docs/examples/datasets.json | 16 +++++++-------- spec/data/archive/mrt-datacite.xml | 2 +- spec/data/archive/stash-wrapper.xml | 6 +++--- spec/data/bad-mrt-datacite.xml | 2 +- spec/data/bad-stash-wrapper.xml | 6 +++--- spec/data/dc3.xml | 2 +- spec/data/dc4-with-funding-references.xml | 2 +- spec/data/event-data-citations1.json | 2 +- spec/data/event-data-citations2.json | 2 +- spec/data/example.json | 4 ++-- spec/data/mdc-usage.json | 20 +++++++++---------- spec/data/stash-merritt/mrt-datacite.xml | 2 +- spec/data/stash-merritt/mrt-oaidc.xml | 4 ++-- spec/data/stash-merritt/stash-wrapper.xml | 6 +++--- spec/factories/stash_datacite/rights.rb | 4 ++-- .../stash_datacite/indexing_resource_spec.rb | 2 +- spec/mocks/counter.rb | 2 +- spec/models/stash_api/dataset_spec.rb | 2 +- .../stash_datacite/metadata_entry_spec.rb | 4 ++-- spec/models/stash_engine/license_spec.rb | 2 +- 29 files changed, 72 insertions(+), 59 deletions(-) create mode 100644 db/data/20241028110859_updated_cc0_license.rb diff --git a/app/views/layouts/_best_practices.html.md b/app/views/layouts/_best_practices.html.md index 6935777a38..6a5e1bd198 100644 --- a/app/views/layouts/_best_practices.html.md +++ b/app/views/layouts/_best_practices.html.md @@ -19,7 +19,7 @@ Additionally, if applicable, please do not include any data visualizations that ## Make sure your data are shareable -* **All files submitted to Dryad must abide by the terms of the [Creative Commons Zero (CC0 1.0)](https://creativecommons.org/publicdomain/zero/1.0/) waiver**. Under these terms, the author releases the data to the public domain. +* **All files submitted to Dryad must abide by the terms of the [Creative Commons Zero v1.0 Universal](https://spdx.org/licenses/CC0-1.0.html) waiver**. Under these terms, the author releases the data to the public domain. * Review all files and ensure they conform to `CC0` terms and are not covered by copyright claims or other terms-of-use. We cannot archive any files that contain licenses incompatible with `CC0` (`GNU GPL, MIT, CC-BY,` etc.), but we can link to content in a dedicated software repository (Github, Zenodo, Bitbucket, or CRAN, etc.). * For more information see [Good data practices: Removing barriers to data reuse with CC0 licensing](https://blog.datadryad.org/2023/05/30/good-data-practices-removing-barriers-to-data-reuse-with-cc0-licensing/), [Why Does Dryad Use CC0](https://blog.datadryad.org/2011/10/05/why-does-dryad-use-cc0/), and [Some dos and don'ts for CC0](https://blog.datadryad.org/2017/09/11/some-dos-and-donts-for-cc0/). * Human subjects data must be properly anonymized and prepared under applicable legal and ethical guidelines (see tips for human subjects data). diff --git a/app/views/stash_datacite/licenses/_license_sidebar.html.erb b/app/views/stash_datacite/licenses/_license_sidebar.html.erb index 2028bd24e0..0616ba1fa8 100644 --- a/app/views/stash_datacite/licenses/_license_sidebar.html.erb +++ b/app/views/stash_datacite/licenses/_license_sidebar.html.erb @@ -3,5 +3,5 @@ <%= render partial: 'stash_datacite/licenses/no_license_review', locals: {right: right} %> <% else %>

License:

- Public domain (opens in new window) + Public domain (opens in new window) <% end %> \ No newline at end of file diff --git a/config/licenses.yml b/config/licenses.yml index 66fe66a18a..69717d6483 100644 --- a/config/licenses.yml +++ b/config/licenses.yml @@ -2,8 +2,8 @@ # and then uri, name, explanation and badge cc0: - uri: https://creativecommons.org/publicdomain/zero/1.0/ - name: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + uri: https://spdx.org/licenses/CC0-1.0.html + name: Creative Commons Zero v1.0 Universal explanation: > This releases your work to the public domain for any use. badge: icon_cc-zero.svg diff --git a/db/data/20241028110859_updated_cc0_license.rb b/db/data/20241028110859_updated_cc0_license.rb new file mode 100644 index 0000000000..6846f1cc5b --- /dev/null +++ b/db/data/20241028110859_updated_cc0_license.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class UpdatedCc0License < ActiveRecord::Migration[7.0] + def up + StashDatacite::Right.where(rights: 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication') + .update_all(rights: 'Creative Commons Zero v1.0 Universal', rights_uri: 'https://spdx.org/licenses/CC0-1.0.html') + aaa + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end diff --git a/documentation/apis/embedded_submission.md b/documentation/apis/embedded_submission.md index 78963734be..b5a8d1908f 100644 --- a/documentation/apis/embedded_submission.md +++ b/documentation/apis/embedded_submission.md @@ -106,7 +106,7 @@ A sample call using the [sample dataset file](sample_dataset.json), with results "lastModificationDate": "2020-10-02", "visibility": "restricted", "userId": "0000-0003-0597-4085", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "editLink": "/stash/edit/doi%3A10.7959%2Fdryad.83bk3jc0" } ``` @@ -197,7 +197,7 @@ Sample call and (abbreviated) response: "visibility": "restricted", "sharingLink":"https://datadryad.org/stash/share/OI-tU-WmoT3I2KCOqX7Of624", "userId": 37182, - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "editLink": "/stash/edit/doi%3A10.7959%2Fdryad.83bk3jc0" } ``` diff --git a/dryad-config-example/licenses.yml b/dryad-config-example/licenses.yml index b45f7027cd..2015a6f49e 100644 --- a/dryad-config-example/licenses.yml +++ b/dryad-config-example/licenses.yml @@ -2,8 +2,8 @@ # and then uri and name cc0: - uri: https://creativecommons.org/publicdomain/zero/1.0/ - name: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + uri: https://spdx.org/licenses/CC0-1.0.html + name: Creative Commons Zero v1.0 Universal explanation: > This releases your work to the public domain for any use. badge: icon_cc-zero.svg diff --git a/lib/stash/wrapper/license.rb b/lib/stash/wrapper/license.rb index c1302ea24f..cd48a99b6b 100644 --- a/lib/stash/wrapper/license.rb +++ b/lib/stash/wrapper/license.rb @@ -30,11 +30,11 @@ class License uri: URI('https://creativecommons.org/licenses/by/4.0/') ) - # Convenience instance for the [CC0](https://creativecommons.org/publicdomain/zero/1.0/) + # Convenience instance for the [CC0](https://spdx.org/licenses/CC0-1.0.html) # public domain declaration CC_ZERO = License.new( - name: 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication', - uri: URI('https://creativecommons.org/publicdomain/zero/1.0/') + name: 'Creative Commons Zero v1.0 Universal', + uri: URI('https://spdx.org/licenses/CC0-1.0.html') ) end end diff --git a/lib/stash/zenodo_replicate/metadata_generator.rb b/lib/stash/zenodo_replicate/metadata_generator.rb index 0c33c25792..ddfe59bf40 100644 --- a/lib/stash/zenodo_replicate/metadata_generator.rb +++ b/lib/stash/zenodo_replicate/metadata_generator.rb @@ -78,7 +78,7 @@ def license end def license_for_data - if @resource.rights.first&.rights_uri&.include?('/zero') + if @resource.rights.first&.rights_uri&.include?('/CC0') 'cc-zero' else 'cc-by' diff --git a/public/api/v2/docs/examples/dataset.json b/public/api/v2/docs/examples/dataset.json index 4e1af953ac..3872b91be1 100644 --- a/public/api/v2/docs/examples/dataset.json +++ b/public/api/v2/docs/examples/dataset.json @@ -77,5 +77,5 @@ "changedFields": [ "none" ], - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "license": "https://spdx.org/licenses/CC0-1.0.html" } diff --git a/public/api/v2/docs/examples/datasets.json b/public/api/v2/docs/examples/datasets.json index efd7df1827..09f4da59dc 100644 --- a/public/api/v2/docs/examples/datasets.json +++ b/public/api/v2/docs/examples/datasets.json @@ -63,7 +63,7 @@ "publicationDate": "2020-01-01", "visibility": "public", "sharingLink": "https://datadryad.org/stash/dataset/doi:10.5072/FK2HM58Q3S", - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "license": "https://spdx.org/licenses/CC0-1.0.html" }, { "_links": { @@ -194,7 +194,7 @@ "publicationDate": "2020-02-01", "visibility": "public", "sharingLink": "https://datadryad.org/stash/dataset/doi:10.5072/FK2474DX0J", - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "license": "https://spdx.org/licenses/CC0-1.0.html" }, { "id": "doi:10.5072/FK22N55P2B", @@ -245,7 +245,7 @@ "publicationDate": "2020-01-07", "visibility": "public", "sharingLink": "https://datadryad.org/stash/dataset/doi:10.5072/FK28W3G720", - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "license": "https://spdx.org/licenses/CC0-1.0.html" }, { "_links": { @@ -290,7 +290,7 @@ "publicationDate": "2020-01-07", "visibility": "public", "sharingLink": "https://datadryad.org/stash/dataset/doi:10.5072/FK2MK6CD6D", - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "license": "https://spdx.org/licenses/CC0-1.0.html" }, { "identifier": "doi:10.5072/FK2C82BM6C", @@ -359,7 +359,7 @@ "publicationDate": "2020-04-17", "visibility": "public", "sharingLink": "https://datadryad.org/stash/dataset/doi:10.5072/FK24T6N929", - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "license": "https://spdx.org/licenses/CC0-1.0.html" }, { "_links": { @@ -410,7 +410,7 @@ "publicationDate": "2020-04-19", "visibility": "public", "sharingLink": "https://datadryad.org/stash/dataset/doi:10.5072/FK2QJ7G49H", - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "license": "https://spdx.org/licenses/CC0-1.0.html" }, { "_links": { @@ -455,7 +455,7 @@ "publicationDate": "2020-05-01", "visibility": "public", "sharingLink": "https://datadryad.org/stash/dataset/doi:10.5072/FK2J966H3B", - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "license": "https://spdx.org/licenses/CC0-1.0.html" }, { "_links": { @@ -500,7 +500,7 @@ "publicationDate": "2020-05-10", "visibility": "public", "sharingLink": "https://datadryad.org/stash/dataset/doi:10.5072/FK2T151W7S", - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "license": "https://spdx.org/licenses/CC0-1.0.html" } ] } diff --git a/spec/data/archive/mrt-datacite.xml b/spec/data/archive/mrt-datacite.xml index 26022b6052..ad2cf032d6 100644 --- a/spec/data/archive/mrt-datacite.xml +++ b/spec/data/archive/mrt-datacite.xml @@ -65,7 +65,7 @@ 1 - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + Creative Commons Zero v1.0 Universal diff --git a/spec/data/archive/stash-wrapper.xml b/spec/data/archive/stash-wrapper.xml index 46584a4f3b..062264fa90 100644 --- a/spec/data/archive/stash-wrapper.xml +++ b/spec/data/archive/stash-wrapper.xml @@ -7,8 +7,8 @@ 2015-08-17Z - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication - https://creativecommons.org/publicdomain/zero/1.0/ + Creative Commons Zero v1.0 Universal + https://spdx.org/licenses/CC0-1.0.html none @@ -154,7 +154,7 @@ 1 - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + Creative Commons Zero v1.0 Universal diff --git a/spec/data/bad-mrt-datacite.xml b/spec/data/bad-mrt-datacite.xml index 0b40b2f8c3..c26859eecd 100644 --- a/spec/data/bad-mrt-datacite.xml +++ b/spec/data/bad-mrt-datacite.xml @@ -69,7 +69,7 @@ 1 - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + Creative Commons Zero v1.0 Universal diff --git a/spec/data/bad-stash-wrapper.xml b/spec/data/bad-stash-wrapper.xml index ec8e2547d5..249009892e 100644 --- a/spec/data/bad-stash-wrapper.xml +++ b/spec/data/bad-stash-wrapper.xml @@ -8,8 +8,8 @@ 2015-08-17Z - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication - https://creativecommons.org/publicdomain/zero/1.0/ + Creative Commons Zero v1.0 Universal + https://spdx.org/licenses/CC0-1.0.html none @@ -155,7 +155,7 @@ 1 - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + Creative Commons Zero v1.0 Universal diff --git a/spec/data/dc3.xml b/spec/data/dc3.xml index 203328202b..f660d1e0d0 100644 --- a/spec/data/dc3.xml +++ b/spec/data/dc3.xml @@ -64,7 +64,7 @@ 1 - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + Creative Commons Zero v1.0 Universal diff --git a/spec/data/dc4-with-funding-references.xml b/spec/data/dc4-with-funding-references.xml index 9e3a31cb36..75035de989 100644 --- a/spec/data/dc4-with-funding-references.xml +++ b/spec/data/dc4-with-funding-references.xml @@ -67,7 +67,7 @@ 1 - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + Creative Commons Zero v1.0 Universal diff --git a/spec/data/event-data-citations1.json b/spec/data/event-data-citations1.json index c1e5f67c3a..c41c2c2127 100644 --- a/spec/data/event-data-citations1.json +++ b/spec/data/event-data-citations1.json @@ -11,7 +11,7 @@ "total": 1, "message-action": "create", "source-token": "28276d12-b320-41ba-9272-bb0adc3466ff", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2019-03-05T20:32:29.000Z", "timestamp": "2019-03-05T20:32:36.843Z" }, diff --git a/spec/data/event-data-citations2.json b/spec/data/event-data-citations2.json index 4d69dff32b..580341cfd7 100644 --- a/spec/data/event-data-citations2.json +++ b/spec/data/event-data-citations2.json @@ -11,7 +11,7 @@ "total": 1, "message-action": "create", "source-token": "28276d12-b320-41ba-9272-bb0adc3466ff", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2019-03-05T20:32:29.000Z", "timestamp": "2019-03-05T20:32:36.921Z" }, diff --git a/spec/data/example.json b/spec/data/example.json index e4c9e55e3e..6b863439e8 100644 --- a/spec/data/example.json +++ b/spec/data/example.json @@ -64,7 +64,7 @@ ], "license": { "@type": "CreativeWork", - "name": "CC0 1.0 Universal (CC0 1.0) Public Domain Dedication", - "license": "https://creativecommons.org/publicdomain/zero/1.0/" + "name": "Creative Commons Zero v1.0 Universal", + "license": "https://spdx.org/licenses/CC0-1.0.html" } } diff --git a/spec/data/mdc-usage.json b/spec/data/mdc-usage.json index b8a22ac775..6f252d7cdd 100644 --- a/spec/data/mdc-usage.json +++ b/spec/data/mdc-usage.json @@ -11,7 +11,7 @@ "total": 67, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-02-01T00:00:00.000Z", "timestamp": "2019-09-07T23:53:57.716Z" } @@ -27,7 +27,7 @@ "total": 79, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-02-01T00:00:00.000Z", "timestamp": "2019-09-07T23:53:58.040Z" } @@ -43,7 +43,7 @@ "total": 13, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-02-01T00:00:00.000Z", "timestamp": "2019-09-07T23:54:00.286Z" } @@ -59,7 +59,7 @@ "total": 13, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-02-01T00:00:00.000Z", "timestamp": "2019-09-07T23:54:00.317Z" } @@ -75,7 +75,7 @@ "total": 10, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-05-01T00:00:00.000Z", "timestamp": "2019-09-08T00:03:44.227Z" } @@ -91,7 +91,7 @@ "total": 112, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-05-01T00:00:00.000Z", "timestamp": "2019-09-08T00:03:44.295Z" } @@ -107,7 +107,7 @@ "total": 127, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-05-01T00:00:00.000Z", "timestamp": "2019-09-08T00:03:44.316Z" } @@ -123,7 +123,7 @@ "total": 10, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-05-01T00:00:00.000Z", "timestamp": "2019-09-08T00:03:46.687Z" } @@ -139,7 +139,7 @@ "total": 107, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-08-01T00:00:00.000Z", "timestamp": "2019-09-08T00:15:23.123Z" } @@ -155,7 +155,7 @@ "total": 119, "message-action": "create", "source-token": "43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc", - "license": "https://creativecommons.org/publicdomain/zero/1.0/", + "license": "https://spdx.org/licenses/CC0-1.0.html", "occurred-at": "2011-08-01T00:00:00.000Z", "timestamp": "2019-09-08T00:15:23.481Z" } diff --git a/spec/data/stash-merritt/mrt-datacite.xml b/spec/data/stash-merritt/mrt-datacite.xml index 1518e095c6..9b9c4d680d 100644 --- a/spec/data/stash-merritt/mrt-datacite.xml +++ b/spec/data/stash-merritt/mrt-datacite.xml @@ -68,7 +68,7 @@ 1 - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + Creative Commons Zero v1.0 Universal diff --git a/spec/data/stash-merritt/mrt-oaidc.xml b/spec/data/stash-merritt/mrt-oaidc.xml index c4ec4d7174..e495f01649 100644 --- a/spec/data/stash-merritt/mrt-oaidc.xml +++ b/spec/data/stash-merritt/mrt-oaidc.xml @@ -9,8 +9,8 @@ Epithelium Barrett's esophagus dataset - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication - https://creativecommons.org/publicdomain/zero/1.0/ + Creative Commons Zero v1.0 Universal + https://spdx.org/licenses/CC0-1.0.html Mammalian esophagus exhibits a remarkable change in epithelial structure during the transition from embryo to adult. However, the molecular mechanisms of esophageal epithelial development are not well understood. diff --git a/spec/data/stash-merritt/stash-wrapper.xml b/spec/data/stash-merritt/stash-wrapper.xml index d7964fd02e..57cdcf1d2c 100644 --- a/spec/data/stash-merritt/stash-wrapper.xml +++ b/spec/data/stash-merritt/stash-wrapper.xml @@ -7,8 +7,8 @@ 2015-08-17Z - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication - https://creativecommons.org/publicdomain/zero/1.0/ + Creative Commons Zero v1.0 Universal + https://spdx.org/licenses/CC0-1.0.html none @@ -154,7 +154,7 @@ 1 - CC0 1.0 Universal (CC0 1.0) Public Domain Dedication + Creative Commons Zero v1.0 Universal diff --git a/spec/factories/stash_datacite/rights.rb b/spec/factories/stash_datacite/rights.rb index 0ad734d8d7..bf24e2ce06 100644 --- a/spec/factories/stash_datacite/rights.rb +++ b/spec/factories/stash_datacite/rights.rb @@ -18,8 +18,8 @@ factory :right, class: StashDatacite::Right do resource - rights { 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication' } - rights_uri { 'https://creativecommons.org/publicdomain/zero/1.0/' } + rights { 'Creative Commons Zero v1.0 Universal' } + rights_uri { 'https://spdx.org/licenses/CC0-1.0.html' } end end diff --git a/spec/lib/stash_datacite/indexing_resource_spec.rb b/spec/lib/stash_datacite/indexing_resource_spec.rb index 5c36b8c1e7..f7fc2f2b9c 100644 --- a/spec/lib/stash_datacite/indexing_resource_spec.rb +++ b/spec/lib/stash_datacite/indexing_resource_spec.rb @@ -345,7 +345,7 @@ module Indexer solr_geom: nil, solr_year_i: 2019, dct_issued_dt: @resource.publication_date.utc.iso8601, - dc_rights_s: 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication', + dc_rights_s: 'Creative Commons Zero v1.0 Universal', dc_publisher_s: @resource.publisher.publisher, dct_temporal_sm: ['2018-11-14'], dryad_author_affiliation_id_sm: ['https://ror.example.org/16xx22bs', 'https://ror.example.org/18dl67sn1'], diff --git a/spec/mocks/counter.rb b/spec/mocks/counter.rb index 4817206bac..1c0dfa611c 100644 --- a/spec/mocks/counter.rb +++ b/spec/mocks/counter.rb @@ -15,7 +15,7 @@ def mock_counter! total: 67, 'message-action': 'create', 'source-token': '43ba99ae-5cf0-11e8-9c2d-fa7ae01bbebc', - license: 'https://creativecommons.org/publicdomain/zero/1.0/', + license: 'https://spdx.org/licenses/CC0-1.0.html', 'occurred-at': '2011-02-01T00:00:00.000Z', timestamp: '2019-09-07T23:53:57.716Z' } } diff --git a/spec/models/stash_api/dataset_spec.rb b/spec/models/stash_api/dataset_spec.rb index ec6e463748..d6ecd6f3b9 100644 --- a/spec/models/stash_api/dataset_spec.rb +++ b/spec/models/stash_api/dataset_spec.rb @@ -133,7 +133,7 @@ module StashApi end it 'defaults to the correct license' do - expect(@metadata[:license]).to eq('https://creativecommons.org/publicdomain/zero/1.0/') + expect(@metadata[:license]).to eq('https://spdx.org/licenses/CC0-1.0.html') end it 'has public visibility when metadata is viewable' do diff --git a/spec/models/stash_datacite/metadata_entry_spec.rb b/spec/models/stash_datacite/metadata_entry_spec.rb index fa9f23aa47..aff2b80771 100644 --- a/spec/models/stash_datacite/metadata_entry_spec.rb +++ b/spec/models/stash_datacite/metadata_entry_spec.rb @@ -42,8 +42,8 @@ module Resource @metadata_entry = MetadataEntry.new(resource, 'dataset', tenant) rights = resource.rights.first expect(rights).not_to be_nil - expect(rights.rights).to eq('CC0 1.0 Universal (CC0 1.0) Public Domain Dedication') - expect(rights.rights_uri).to eq('https://creativecommons.org/publicdomain/zero/1.0/') + expect(rights.rights).to eq('Creative Commons Zero v1.0 Universal') + expect(rights.rights_uri).to eq('https://spdx.org/licenses/CC0-1.0.html') end it 'creates a publisher if needed' do diff --git a/spec/models/stash_engine/license_spec.rb b/spec/models/stash_engine/license_spec.rb index 80a4a82ae4..c1944f55c6 100644 --- a/spec/models/stash_engine/license_spec.rb +++ b/spec/models/stash_engine/license_spec.rb @@ -6,7 +6,7 @@ module StashEngine before(:each) do @uris_by_id = { - cc0: 'https://creativecommons.org/publicdomain/zero/1.0/', + cc0: 'https://spdx.org/licenses/CC0-1.0.html', cc_by: 'https://creativecommons.org/licenses/by/4.0/' }.freeze end From bd49fa4bdc1775f11f9af10589f979f8824ce5ed Mon Sep 17 00:00:00 2001 From: Alin Vetian Date: Mon, 28 Oct 2024 18:46:09 +0200 Subject: [PATCH 03/17] fixed data migration --- db/data/20241028110859_updated_cc0_license.rb | 1 - db/data_schema.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/db/data/20241028110859_updated_cc0_license.rb b/db/data/20241028110859_updated_cc0_license.rb index 6846f1cc5b..d8fda69871 100644 --- a/db/data/20241028110859_updated_cc0_license.rb +++ b/db/data/20241028110859_updated_cc0_license.rb @@ -4,7 +4,6 @@ class UpdatedCc0License < ActiveRecord::Migration[7.0] def up StashDatacite::Right.where(rights: 'CC0 1.0 Universal (CC0 1.0) Public Domain Dedication') .update_all(rights: 'Creative Commons Zero v1.0 Universal', rights_uri: 'https://spdx.org/licenses/CC0-1.0.html') - aaa end def down diff --git a/db/data_schema.rb b/db/data_schema.rb index e8a4173b31..ea24e76f9c 100644 --- a/db/data_schema.rb +++ b/db/data_schema.rb @@ -1 +1 @@ -DataMigrate::Data.define(version: 20240924165505) +DataMigrate::Data.define(version: 20241028110859) From 0c5963963796a8ae97180a60a47079c985871354 Mon Sep 17 00:00:00 2001 From: Audrey Hamelers Date: Thu, 7 Nov 2024 16:25:05 +0100 Subject: [PATCH 04/17] Closes https://github.com/datadryad/dryad-product-roadmap/issues/3754 --- app/views/layouts/_requirements.html.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/layouts/_requirements.html.md b/app/views/layouts/_requirements.html.md index 0dcdec30e9..61e98bd002 100644 --- a/app/views/layouts/_requirements.html.md +++ b/app/views/layouts/_requirements.html.md @@ -23,6 +23,10 @@ Most types of files can be submitted (e.g., text, spreadsheets, video, photograp * **Video**: `AVI, MPEG, MP4` * **Compressed file archive**: `TAR.GZ, 7Z, ZIP` +
+

Note: RAR (Roshal ARchive) is a proprietary compression format. Because users may not have access to the necessary tools to open RAR files, we cannot accept them for publication. Please open, widely supported, and easily accessible formats like those listed above.

+
+ ## File size From 83b7792080c063a0b850a83aa58e1819e3669c76 Mon Sep 17 00:00:00 2001 From: Audrey Hamelers Date: Thu, 14 Nov 2024 12:04:34 -0500 Subject: [PATCH 05/17] add blank first research domain option --- app/javascript/react/components/MetadataEntry/ResearchDomain.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/javascript/react/components/MetadataEntry/ResearchDomain.jsx b/app/javascript/react/components/MetadataEntry/ResearchDomain.jsx index d8770cbb0b..cf60756db5 100644 --- a/app/javascript/react/components/MetadataEntry/ResearchDomain.jsx +++ b/app/javascript/react/components/MetadataEntry/ResearchDomain.jsx @@ -52,6 +52,7 @@ function ResearchDomain({ formik.handleSubmit(); }} > +