From ae835c2b66a2e6a803a6f0f553fd27cdac3b6673 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 16 Jan 2026 11:13:45 -0500 Subject: [PATCH 01/34] Metadata 4.7 updates for lupo --- Gemfile | 3 +- Gemfile.lock | 56 +++++++++++++----------- app/lib/params_sanitizer.rb | 2 + app/models/doi.rb | 2 + spec/requests/datacite_dois/post_spec.rb | 6 ++- 5 files changed, 41 insertions(+), 28 deletions(-) diff --git a/Gemfile b/Gemfile index cc20a711a..839303c21 100644 --- a/Gemfile +++ b/Gemfile @@ -13,7 +13,8 @@ gem "aws-sdk-sqs", "~> 1.3" gem "base32-url", "~> 0.3" gem "batch-loader", "~> 1.4", ">= 1.4.1" gem "bcrypt", "~> 3.1.7" -gem "bolognese", "~> 2.4.0" +# gem "bolognese", "~> 2.4.0" +gem 'bolognese', git: 'https://github.com/datacite/bolognese.git', branch: 'metadata-47' gem "bootsnap", "~> 1.4", ">= 1.4.4", require: false gem "cancancan", "~> 3.0" gem "countries", "~> 2.1", ">= 2.1.2" diff --git a/Gemfile.lock b/Gemfile.lock index 5653910ae..46563834b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,33 @@ +GIT + remote: https://github.com/datacite/bolognese.git + revision: 6c5ebf18074d6a2078ba7d38fab88d50d77dd893 + branch: metadata-47 + specs: + bolognese (2.5.1) + activesupport (>= 4.2.5) + benchmark_methods (~> 0.7) + bibtex-ruby (>= 5.1.0) + builder (~> 3.2, >= 3.2.2) + citeproc-ruby (~> 1.1, >= 1.1.12) + colorize (~> 0.8.1) + concurrent-ruby (~> 1.1, >= 1.1.5) + csl-styles (~> 1.0, >= 1.0.1.10) + edtf (~> 3.0, >= 3.0.4) + gender_detector (~> 0.1.2) + iso8601 (~> 0.9.1) + json-ld-preloaded (~> 3.1, >= 3.1.3) + jsonlint (~> 0.3.0) + loofah (~> 2.0, >= 2.0.3) + maremma (~> 5.0) + namae (~> 1.0) + nokogiri (~> 1.16, >= 1.16.2) + oj (~> 3.10) + oj_mimic_json (~> 1.0, >= 1.0.1) + postrank-uri (~> 1.0, >= 1.0.18) + rdf-rdfxml (~> 3.1) + rdf-turtle (~> 3.1) + thor (>= 0.19) + GEM remote: https://rubygems.org/ specs: @@ -137,30 +167,6 @@ GEM bigdecimal (3.1.6) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - bolognese (2.4.0) - activesupport (>= 4.2.5) - benchmark_methods (~> 0.7) - bibtex-ruby (>= 5.1.0) - builder (~> 3.2, >= 3.2.2) - citeproc-ruby (~> 1.1, >= 1.1.12) - colorize (~> 0.8.1) - concurrent-ruby (~> 1.1, >= 1.1.5) - csl-styles (~> 1.0, >= 1.0.1.10) - edtf (~> 3.0, >= 3.0.4) - gender_detector (~> 0.1.2) - iso8601 (~> 0.9.1) - json-ld-preloaded (~> 3.1, >= 3.1.3) - jsonlint (~> 0.3.0) - loofah (~> 2.0, >= 2.0.3) - maremma (~> 5.0) - namae (~> 1.0) - nokogiri (~> 1.16, >= 1.16.2) - oj (~> 3.10) - oj_mimic_json (~> 1.0, >= 1.0.1) - postrank-uri (~> 1.0, >= 1.0.18) - rdf-rdfxml (~> 3.1) - rdf-turtle (~> 3.1) - thor (>= 0.19) bootsnap (1.15.0) msgpack (~> 1.2) brakeman (6.1.2) @@ -811,7 +817,7 @@ DEPENDENCIES bcrypt (~> 3.1.7) better_errors binding_of_caller - bolognese (~> 2.4.0) + bolognese! bootsnap (~> 1.4, >= 1.4.4) brakeman (~> 6.1, >= 6.1.2) bullet (~> 7.1, >= 7.1.6) diff --git a/app/lib/params_sanitizer.rb b/app/lib/params_sanitizer.rb index 2c716c0dc..6801ec9df 100644 --- a/app/lib/params_sanitizer.rb +++ b/app/lib/params_sanitizer.rb @@ -175,6 +175,7 @@ class ParamsSanitizer schemeUri schemeType resourceTypeGeneral + relationTypeInformation relatedMetadataScheme schemeUri schemeType @@ -231,6 +232,7 @@ class ParamsSanitizer relatedItems: [ :relationType, :relatedItemType, + :relationTypeInformation, { relatedItemIdentifier: %i[relatedItemIdentifier relatedItemIdentifierType relatedMetadataScheme schemeURI schemeType], }, diff --git a/app/models/doi.rb b/app/models/doi.rb index 810151932..e1afe2f69 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -300,10 +300,12 @@ def validate_publisher_obj?(doi) schemeUri: { type: :keyword }, schemeType: { type: :keyword }, resourceTypeGeneral: { type: :keyword }, + relationTypeInformation: { type: :keyword }, } indexes :related_items, type: :object, properties: { relatedItemType: { type: :keyword }, relationType: { type: :keyword }, + relationTypeInformation: { type: :keyword }, relatedItemIdentifier: { type: :object, properties: { relatedItemIdentifier: { type: :keyword, normalizer: "keyword_lowercase" }, relatedItemIdentifierType: { type: :keyword }, diff --git a/spec/requests/datacite_dois/post_spec.rb b/spec/requests/datacite_dois/post_spec.rb index 0309ca087..02c329296 100644 --- a/spec/requests/datacite_dois/post_spec.rb +++ b/spec/requests/datacite_dois/post_spec.rb @@ -242,7 +242,7 @@ "classificationCode" => "080505" }], "contributors" => [{ "contributorType" => "DataManager", "familyName" => "Fenner", "givenName" => "Kurt", "nameIdentifiers" => [{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2401", "nameIdentifierScheme" => "ORCID", "schemeUri" => "https://orcid.org" }], "name" => "Fenner, Kurt", "nameType" => "Personal" }], "dates" => [{ "date" => "2017-02-24", "dateType" => "Issued" }, { "date" => "2015-11-28", "dateType" => "Created" }, { "date" => "2017-02-24", "dateType" => "Updated" }], - "relatedIdentifiers" => [{ "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "DOI", "relationType" => "References" }], + "relatedIdentifiers" => [{ "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "DOI", "relationType" => "References", "relationTypeInformation" => "Test relatedIdentifier => relationTypeInformation" }], "descriptions" => [ { "lang" => "en", @@ -295,7 +295,7 @@ "schemeUri" => "https://orcid.org" }], "nameType" => "Personal" }]) expect(json.dig("data", "attributes", "dates")).to eq([{ "date" => "2017-02-24", "dateType" => "Issued" }, { "date" => "2015-11-28", "dateType" => "Created" }, { "date" => "2017-02-24", "dateType" => "Updated" }]) - expect(json.dig("data", "attributes", "relatedIdentifiers")).to eq([{ "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "DOI", "relationType" => "References" }]) + expect(json.dig("data", "attributes", "relatedIdentifiers")).to eq([{ "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "DOI", "relationType" => "References", "relationTypeInformation" => "Test relatedIdentifier => relationTypeInformation" }]) expect(json.dig("data", "attributes", "descriptions", 0, "description")).to start_with("Diet and physical activity") expect(json.dig("data", "attributes", "geoLocations")).to eq([{ "geoLocationPoint" => { "pointLatitude" => 49.0850736, "pointLongitude" => -123.3300992 } }]) expect(json.dig("data", "attributes", "source")).to eq("test") @@ -358,6 +358,7 @@ }, "relatedItemType" => "Journal", "relationType" => "IsPublishedIn", + "relationTypeInformation" => "Test relatedItem => relationTypeInformation", "titles" => [{ "title" => "Physics letters / B" }], "volume" => "776" }], @@ -390,6 +391,7 @@ expect(json.dig("data", "attributes", "state")).to eq("findable") expect(json.dig("data", "attributes", "relatedItems")).to eq(["relationType" => "IsPublishedIn", "relatedItemType" => "Journal", + "relationTypeInformation" => "Test relatedItem => relationTypeInformation", "publicationYear" => "2018", "relatedItemIdentifier" => { "relatedItemIdentifier" => "10.1016/j.physletb.2017.11.044", From 4c281411f23dcb047f9dca2a933e4750ba132252 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 16 Jan 2026 11:31:06 -0500 Subject: [PATCH 02/34] Appease rubocop. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 839303c21..352cfa69e 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,7 @@ gem "base32-url", "~> 0.3" gem "batch-loader", "~> 1.4", ">= 1.4.1" gem "bcrypt", "~> 3.1.7" # gem "bolognese", "~> 2.4.0" -gem 'bolognese', git: 'https://github.com/datacite/bolognese.git', branch: 'metadata-47' +gem "bolognese", git: "https://github.com/datacite/bolognese.git", branch: "metadata-47" gem "bootsnap", "~> 1.4", ">= 1.4.4", require: false gem "cancancan", "~> 3.0" gem "countries", "~> 2.1", ">= 2.1.2" From 1c64a2e00301f5b1a90d0d5325753fad75d5e8ea Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 26 Jan 2026 21:38:50 -0500 Subject: [PATCH 03/34] Testing. --- .../files/datacite-example-full-v4.7.xml | 295 ++++++++++++++++++ .../creates_a_Doi.yml | 75 +++++ .../creates_a_Doi.yml | 75 +++++ spec/requests/datacite_dois/post_spec.rb | 203 +++++++++++- 4 files changed, 644 insertions(+), 4 deletions(-) create mode 100644 spec/fixtures/files/datacite-example-full-v4.7.xml create mode 100644 spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/dois/when_the_request_uses_schema_4_7_-_json/creates_a_Doi.yml create mode 100644 spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/dois/when_the_request_uses_schema_4_7_-_xml/creates_a_Doi.yml diff --git a/spec/fixtures/files/datacite-example-full-v4.7.xml b/spec/fixtures/files/datacite-example-full-v4.7.xml new file mode 100644 index 000000000..fd2328337 --- /dev/null +++ b/spec/fixtures/files/datacite-example-full-v4.7.xml @@ -0,0 +1,295 @@ + + + + 10.82433/B09Z-4K37 + + + ExampleFamilyName, ExampleGivenName + ExampleGivenName + ExampleFamilyName + https://orcid.org/0000-0001-5727-2427 + ExampleAffiliation + + + ExampleOrganization + https://ror.org/04wxnsj81 + + + + Example Title + Example Subtitle + Example TranslatedTitle + Example AlternativeTitle + + Example Publisher + 2023 + Example ResourceType + + FOS: Computer and information sciences + Digital curation and preservation + Example Subject + + + + ExampleFamilyName, ExampleGivenName + ExampleGivenName + ExampleFamilyName + https://orcid.org/0000-0001-5727-2427/ + ExampleAffiliation + + + ExampleFamilyName, ExampleGivenName + + + ExampleFamilyName, ExampleGivenName + + + ExampleFamilyName, ExampleGivenName + + + ExampleOrganization + + + ExampleFamilyName, ExampleGivenName + + + ExampleOrganization + + + ExampleFamilyName, ExampleGivenName + + + ExampleFamilyName, ExampleGivenName + + + ExampleFamilyName, ExampleGivenName + + + ExampleFamilyName, ExampleGivenName + + + DataCite + + + International DOI Foundation + + + ExampleFamilyName, ExampleGivenName + + + ExampleFamilyName, ExampleGivenName + + + ExampleContributor + + + ExampleFamilyName, ExampleGivenName + + + ExampleContributor + + + ExampleFamilyName, ExampleGivenName + + + ExampleOrganization + + + ExampleFamilyName, ExampleGivenName + + + + 2023-01-01 + 2023-01-01 + 2023-01-01 + 2022-01-01/2022-12-31 + 2023-01-01 + 2023-01-01 + 2023-01-01 + 2023-01-01 + 2023-01-01 + 2023-01-01 + 2023-01-01 + + en + + 12345 + + + ark:/13030/tqb3kh97gh8w + arXiv:0706.0001 + 2018AGUFM.A24K..07S + 10.1016/j.epsl.2011.11.037 + 9783468111242 + 1562-6865 + 10013/epic.10033 + IECUR0097 + 978-3-905673-82-1 + 0077-5606 + 0A9 2002 12B4A105 7 + 1188-1534 + urn:lsid:ubio.org:namebank:11815 + 12082125 + http://purl.oclc.org/foo/bar + 123456789999 + http://www.heatflow.und.edu/index2.html + urn:nbn:de:101:1-201102033592 + https://w3id.org/games/spec/coil#Coil_Bomb_Die_Of_Age + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + 10.1016/j.epsl.2011.11.037 + + + 1 MB + 90 pages + + + application/xml + text/plain + + 1 + + Creative Commons Attribution 4.0 International + + + Example Abstract + Example Methods + Example SeriesInformation + Example TableOfContents + Example TechnicalInfo + Example Other + + + + Vancouver, British Columbia, Canada + + 49.2827 + -123.1207 + + + -123.27 + -123.02 + 49.195 + 49.315 + + + + 41.991 + -71.032 + + + 42.893 + -69.622 + + + 41.991 + -68.211 + + + 41.090 + -69.622 + + + 41.991 + -71.032 + + + + + + + Example Funder + https://doi.org/10.13039/501100000780 + 12345 + Example AwardTitle + + + + + 1234-5678 + + + ExampleFamilyName, ExampleGivenName + ExampleGivenName + ExampleFamilyName + + + + Example RelatedItem Title + Example RelatedItem TranslatedTitle + + 1990 + 1 + 2 + 1 + 1 + 100 + Example RelatedItem Publisher + Example RelatedItem Edition + + + ExampleFamilyName, ExampleGivenName + ExampleGivenName + ExampleFamilyName + + + + + 1234-5678 + + Journal of Metadata Examples - Collects + + + + 0123-4567 + + Journal of Metadata Examples - IsCollectedBy + + + + 0123-4567 + + Journal of Metadata Examples - IsCollectedBy - Presentation + + + + 0123-4567 + + Journal of Metadata Examples - IsCollectedBy - Poster + + + + 0123-4567 + + Journal of Metadata Examples - IsCollectedBy - Poster + + + + 0123-4567 + + Journal of Metadata Examples - IsCollectedBy - Poster + + + + diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/dois/when_the_request_uses_schema_4_7_-_json/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/dois/when_the_request_uses_schema_4_7_-_json/creates_a_Doi.yml new file mode 100644 index 000000000..55244e289 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/dois/when_the_request_uses_schema_4_7_-_json/creates_a_Doi.yml @@ -0,0 +1,75 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"TEST/ADMIN","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/5.0.0; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 27 Jan 2026 02:25:02 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '44' + Connection: + - keep-alive + Vary: + - Accept-Encoding, User-Agent + body: + encoding: ASCII-8BIT + string: '{"responseCode":1,"handle":"10.14454/10703"}' + recorded_at: Tue, 27 Jan 2026 02:25:03 GMT +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"TEST/ADMIN","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/5.0.0; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 27 Jan 2026 02:25:03 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '44' + Connection: + - keep-alive + Vary: + - Accept-Encoding, User-Agent + body: + encoding: ASCII-8BIT + string: '{"responseCode":1,"handle":"10.14454/10703"}' + recorded_at: Tue, 27 Jan 2026 02:25:03 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/dois/when_the_request_uses_schema_4_7_-_xml/creates_a_Doi.yml b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/dois/when_the_request_uses_schema_4_7_-_xml/creates_a_Doi.yml new file mode 100644 index 000000000..395ac7661 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/DataciteDoisController/POST_/dois/when_the_request_uses_schema_4_7_-_xml/creates_a_Doi.yml @@ -0,0 +1,75 @@ +--- +http_interactions: +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"TEST/ADMIN","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/5.0.0; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 27 Jan 2026 02:24:48 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '44' + Connection: + - keep-alive + Vary: + - Accept-Encoding, User-Agent + body: + encoding: ASCII-8BIT + string: '{"responseCode":1,"handle":"10.14454/10703"}' + recorded_at: Tue, 27 Jan 2026 02:24:48 GMT +- request: + method: put + uri: https://handle.test.datacite.org/api/handles/10.14454/10703 + body: + encoding: UTF-8 + string: '[{"index":100,"type":"HS_ADMIN","data":{"format":"admin","value":{"handle":"TEST/ADMIN","index":300,"permissions":"111111111111"}}},{"index":1,"type":"URL","data":{"format":"string","value":"http://www.bl.uk/pdf/patspec.pdf"}}]' + headers: + User-Agent: + - Mozilla/5.0 (compatible; Maremma/5.0.0; mailto:info@datacite.org) + Accept: + - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5 + Content-Type: + - application/json;charset=UTF-8 + Authorization: + - Basic + Accept-Encoding: + - gzip,deflate + response: + status: + code: 200 + message: OK + headers: + Date: + - Tue, 27 Jan 2026 02:24:49 GMT + Content-Type: + - application/json;charset=utf-8 + Content-Length: + - '44' + Connection: + - keep-alive + Vary: + - Accept-Encoding, User-Agent + body: + encoding: ASCII-8BIT + string: '{"responseCode":1,"handle":"10.14454/10703"}' + recorded_at: Tue, 27 Jan 2026 02:24:49 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/requests/datacite_dois/post_spec.rb b/spec/requests/datacite_dois/post_spec.rb index 02c329296..c284af661 100644 --- a/spec/requests/datacite_dois/post_spec.rb +++ b/spec/requests/datacite_dois/post_spec.rb @@ -242,7 +242,7 @@ "classificationCode" => "080505" }], "contributors" => [{ "contributorType" => "DataManager", "familyName" => "Fenner", "givenName" => "Kurt", "nameIdentifiers" => [{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2401", "nameIdentifierScheme" => "ORCID", "schemeUri" => "https://orcid.org" }], "name" => "Fenner, Kurt", "nameType" => "Personal" }], "dates" => [{ "date" => "2017-02-24", "dateType" => "Issued" }, { "date" => "2015-11-28", "dateType" => "Created" }, { "date" => "2017-02-24", "dateType" => "Updated" }], - "relatedIdentifiers" => [{ "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "DOI", "relationType" => "References", "relationTypeInformation" => "Test relatedIdentifier => relationTypeInformation" }], + "relatedIdentifiers" => [{ "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "DOI", "relationType" => "References" }], "descriptions" => [ { "lang" => "en", @@ -295,7 +295,7 @@ "schemeUri" => "https://orcid.org" }], "nameType" => "Personal" }]) expect(json.dig("data", "attributes", "dates")).to eq([{ "date" => "2017-02-24", "dateType" => "Issued" }, { "date" => "2015-11-28", "dateType" => "Created" }, { "date" => "2017-02-24", "dateType" => "Updated" }]) - expect(json.dig("data", "attributes", "relatedIdentifiers")).to eq([{ "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "DOI", "relationType" => "References", "relationTypeInformation" => "Test relatedIdentifier => relationTypeInformation" }]) + expect(json.dig("data", "attributes", "relatedIdentifiers")).to eq([{ "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "DOI", "relationType" => "References" }]) expect(json.dig("data", "attributes", "descriptions", 0, "description")).to start_with("Diet and physical activity") expect(json.dig("data", "attributes", "geoLocations")).to eq([{ "geoLocationPoint" => { "pointLatitude" => 49.0850736, "pointLongitude" => -123.3300992 } }]) expect(json.dig("data", "attributes", "source")).to eq("test") @@ -358,7 +358,6 @@ }, "relatedItemType" => "Journal", "relationType" => "IsPublishedIn", - "relationTypeInformation" => "Test relatedItem => relationTypeInformation", "titles" => [{ "title" => "Physics letters / B" }], "volume" => "776" }], @@ -391,7 +390,6 @@ expect(json.dig("data", "attributes", "state")).to eq("findable") expect(json.dig("data", "attributes", "relatedItems")).to eq(["relationType" => "IsPublishedIn", "relatedItemType" => "Journal", - "relationTypeInformation" => "Test relatedItem => relationTypeInformation", "publicationYear" => "2018", "relatedItemIdentifier" => { "relatedItemIdentifier" => "10.1016/j.physletb.2017.11.044", @@ -2426,5 +2424,202 @@ expect(doc.at_css("identifier").content).to eq("10.14454/10704") end end + + ## Metadata 4.7 elements + + context "when the request uses schema 4.7 - xml" do + let(:xml) { Base64.strict_encode64(file_fixture("datacite-example-full-v4.7.xml").read) } + let(:doi) { "10.14454/10703" } + let(:valid_attributes) do + { + "data" => { + "type" => "dois", + "attributes" => { + "doi" => doi, + "url" => "http://www.bl.uk/pdf/patspec.pdf", + "xml" => xml, + "event" => "publish", + }, + }, + } + end + + it "creates a Doi" do + post "/dois", valid_attributes, headers + + expect(last_response.status).to eq(201) + expect(json.dig("data", "attributes", "doi")).to eq(doi) + expect(json.dig("data", "attributes", "schemaVersion")).to eq("http://datacite.org/schema/kernel-4") + expect(json.dig("data", "attributes", "state")).to eq("findable") + expect(json.dig("data", "attributes", "publisher")).to eq("Example Publisher") + + expect(json.dig("data", "attributes", "types", "resourceTypeGeneral")).to eq("Presentation") + + expect(json.dig("data", "attributes", "relatedIdentifiers", 36, "resourceTypeGeneral")).to eq("Poster") + expect(json.dig("data", "attributes", "relatedIdentifiers", 37, "resourceTypeGeneral")).to eq("Presentation") + expect(json.dig("data", "attributes", "relatedIdentifiers", 38, "relatedIdentifierType")).to eq("RAiD") + expect(json.dig("data", "attributes", "relatedIdentifiers", 40, "relationType")).to eq("Other") + expect(json.dig("data", "attributes", "relatedIdentifiers", 40, "relationTypeInformation")).to eq("More relationType information to supplement relationType 'Other'") + + expect(json.dig("data", "attributes", "relatedItems", 1, "relationType")).to eq("Collects") + expect(json.dig("data", "attributes", "relatedItems", 1, "titles", 0, "title")).to eq("Journal of Metadata Examples - Collects") + expect(json.dig("data", "attributes", "relatedItems", 2, "relationType")).to eq("IsCollectedBy") + expect(json.dig("data", "attributes", "relatedItems", 2, "titles", 0, "title")).to eq("Journal of Metadata Examples - IsCollectedBy") + + expect(json.dig("data", "attributes", "relatedItems", 3, "relatedItemType")).to eq("Presentation") + expect(json.dig("data", "attributes", "relatedItems", 4, "relatedItemType")).to eq("Poster") + expect(json.dig("data", "attributes", "relatedItems", 5, "relatedItemIdentifier", "relatedItemIdentifierType")).to eq("SWHID") + expect(json.dig("data", "attributes", "relatedItems", 6, "relationType")).to eq("Other") + # expect(json.dig("data", "attributes", "relatedItems", 6, "relationTypeInformation")).to eq("More relationType information to supplement relationType 'Other'") + end + end + + context "when the request uses schema 4.7 - json" do + let(:valid_attributes) do + { + "data" => { + "type" => "dois", + "attributes" => { + "doi" => "10.14454/10703", + "url" => "http://www.bl.uk/pdf/patspec.pdf", + "types": { + "resourceTypeGeneral": "Poster", + "resourceType": "Test Resource Type" + }, + "titles" => [{ "title" => "Eating your own Dog Food" }], + "publisher" => "DataCite", + "publicationYear" => 2016, + "creators" => [{ "familyName" => "Fenner", "givenName" => "Martin", "nameIdentifiers" => [{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme" => "ORCID", "schemeUri" => "https://orcid.org" }], "name" => "Fenner, Martin", "nameType" => "Personal" }], + "subjects" => [{ "subject" => "80505 Web Technologies (excl. Web Search)", + "schemeUri" => "http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E", + "subjectScheme" => "FOR", + "lang" => "en", + "classificationCode" => "080505" }], + "contributors" => [{ "contributorType" => "DataManager", "familyName" => "Fenner", "givenName" => "Kurt", "nameIdentifiers" => [{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2401", "nameIdentifierScheme" => "ORCID", "schemeUri" => "https://orcid.org" }], "name" => "Fenner, Kurt", "nameType" => "Personal" }], + "dates" => [{ "date" => "2017-02-24", "dateType" => "Issued" }, { "date" => "2015-11-28", "dateType" => "Created" }, { "date" => "2017-02-24", "dateType" => "Updated" }], + "relatedIdentifiers" => [ + { + "relatedIdentifier" => "10.5438/55e5-t5c0", + "relatedIdentifierType" => "DOI", + "relationType" => "Other", + "relationTypeInformation" => "More information to supplement relationType 'Other'", "resourceTypeGeneral" => "Presentation" + }, + { + "relatedIdentifier" => "10.5438/55e5-t5c0", + "relatedIdentifierType" => "RAiD", + "relationType" => "Other", + "relationTypeInformation" => "More information to supplement relationType 'Other'", "resourceTypeGeneral" => "Presentation" + }, + ], + + "relatedItems": [ + { + "relatedItemType" => "Presentation", + "relationType" => "Other", + "relationTypeInformation" => "More information to supplement relationType 'Other'", + "relatedItemIdentifier": { "relatedItemIdentifier" => "10.82523/hnhr-r562", "relatedItemIdentifierType" => "SWHID" } + } + ], + + "descriptions" => [ + { + "lang" => "en", + "description" => "Diet and physical activity are two modifiable factors that can curtail the development of osteoporosis in the aging population. One purpose of this study was to assess the differences in dietary intake and bone mineral density (BMD) in a Masters athlete population (n=87, n=49 female; 41.06 ± 5.00 years of age) and examine sex- and sport-related differences in dietary and total calcium and vitamin K intake and BMD of the total body, lumbar spine, and dual femoral neck (TBBMD, LSBMD and DFBMD, respectively). Total calcium is defined as calcium intake from diet and supplements. Athletes were categorized as participating in an endurance or interval sport. BMD was measured using dual-energy X-ray absorptiometry (DXA). Data on dietary intake was collected from Block 2005 Food Frequency Questionnaires (FFQs). Dietary calcium, total calcium, or vitamin K intake did not differ between the female endurance and interval athletes. All three BMD sites were significantly different among the female endurance and interval athletes, with female interval athletes having higher BMD at each site (TBBMD: 1.26 ± 0.10 g/cm2, p<0.05; LSBMD: 1.37 ± 0.14 g/cm2, p<0.01; DFBMD: 1.11 ± 0.12 g/cm2, p<0.05, for female interval athletes; TBBMD: 1.19 ± 0.09 g/cm2; LSBMD: 1.23 ± 0.16 g/cm2; DFBMD: 1.04 ± 0.10 g/cm2, for female endurance athletes). Male interval athletes had higher BMD at all three sites (TBBMD 1.44 ± 0.11 g/cm2, p<0.05; LSBMD 1.42 ± 0.15 g/cm2, p=0.179; DFBMD 1.26 ± 0.14 g/cm2, p<0.01, for male interval athletes; TBBMD 1.33 ± 0.11 g/cm2; LSBMD 1.33 ± 0.17 g/cm2; DFBMD 1.10 ± 0.12 g/cm2 for male endurance athletes). Dietary calcium, total daily calcium and vitamin K intake did not differ between the male endurance and interval athletes. This study evaluated the relationship between calcium intake and BMD. No relationship between dietary or total calcium intake and BMD was evident in all female athletes, female endurance athletes or female interval athletes. In all male athletes, there was no significant correlation between dietary or total calcium intake and BMD at any of the measured sites. However, the male interval athlete group had a negative relationship between dietary calcium intake and TBBMD (r=-0.738, p<0.05) and LSBMD (r=-0.738, p<0.05). The negative relationship persisted between total calcium intake and LSBMD (r=-0.714, p<0.05), but not TBBMD, when calcium from supplements was included. The third purpose of this study was to evaluate the relationship between vitamin K intake (as phylloquinone) and BMD. In all female athletes, there was no significant correlation between vitamin K intake and BMD at any of the measured sites. No relationship between vitamin K and BMD was evident in female interval or female endurance athletes. Similarly, there was no relationship between vitamin K intake and BMD in the male endurance and interval groups. The final purpose of this study was to assess the relationship between the Calcium-to-Vitamin K (Ca:K) ratio and BMD. A linear regression model established that the ratio predicted TBBMD in female athletes, F(1,47) = 4.652, p <0.05, and the ratio accounted for 9% of the variability in TBBMD. The regression equation was: predicted TBBMD in a female athlete = 1.250 - 0.008 x (Ca:K). In conclusion, Masters interval athletes have higher BMD than Masters endurance athletes; however, neither dietary or supplemental calcium nor vitamin K were related to BMD in skeletal sites prone to fracture in older adulthood. We found that a Ca:K ratio could predict TBBMD in female athletes. Further research should consider the calcium-to-vitamin K relationship in conjunction with other modifiable, lifestyle factors associated with bone health in the investigation of methods to minimize the development and effect of osteoporosis in the older athlete population.", + "descriptionType" => "Abstract", + }, + ], + "geoLocations" => [ + { + "geoLocationPoint" => { + "pointLatitude" => 49.0850736, + "pointLongitude" => -123.3300992, + }, + }, + ], + "source" => "test", + "event" => "publish", + }, + }, + } + end + + it "creates a Doi" do + post "/dois", valid_attributes, headers + + expect(last_response.status).to eq(201) + + expect(json.dig("data", "attributes", "url")).to eq("http://www.bl.uk/pdf/patspec.pdf") + expect(json.dig("data", "attributes", "doi")).to eq("10.14454/10703") + expect(json.dig("data", "attributes", "titles")).to eq([{ "title" => "Eating your own Dog Food" }]) + expect(json.dig("data", "attributes", "creators")).to eq([{ "affiliation" => [], "familyName" => "Fenner", "givenName" => "Martin", "nameIdentifiers" => [{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2405", "nameIdentifierScheme" => "ORCID", "schemeUri" => "https://orcid.org" }], "name" => "Fenner, Martin", "nameType" => "Personal" }]) + expect(json.dig("data", "attributes", "publisher")).to eq("DataCite") + expect(json.dig("data", "attributes", "publicationYear")).to eq(2016) + expect(json.dig("data", "attributes", "subjects")).to eq([{ "lang" => "en", + "subject" => "80505 Web Technologies (excl. Web Search)", + "schemeUri" => "http://www.abs.gov.au/ausstats/abs@.nsf/0/6BB427AB9696C225CA2574180004463E", + "subjectScheme" => "FOR", + "classificationCode" => "080505" }, + { "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf", + "subject" => "FOS: Computer and information sciences", + "subjectScheme" => "Fields of Science and Technology (FOS)" } + ]) + expect(json.dig("data", "attributes", "contributors")).to eq([{ "affiliation" => [], + "contributorType" => "DataManager", + "familyName" => "Fenner", + "givenName" => "Kurt", + "name" => "Fenner, Kurt", + "nameIdentifiers" => + [{ + "nameIdentifier" => "https://orcid.org/0000-0003-1419-2401", + "nameIdentifierScheme" => "ORCID", + "schemeUri" => "https://orcid.org" }], + "nameType" => "Personal" + }]) + expect(json.dig("data", "attributes", "dates")).to eq([{ "date" => "2017-02-24", "dateType" => "Issued" }, { "date" => "2015-11-28", "dateType" => "Created" }, { "date" => "2017-02-24", "dateType" => "Updated" }]) + + expect(json.dig("data", "attributes", "types", "resourceTypeGeneral")).to eq("Poster") + expect(json.dig("data", "attributes", "types", "resourceType")).to eq("Test Resource Type") + + expect(json.dig("data", "attributes", "relatedIdentifiers", 0)).to eq( + { + "relatedIdentifier" => "10.5438/55e5-t5c0", + "relatedIdentifierType" => "DOI", + "relationType" => "Other", + "relationTypeInformation" => "More information to supplement relationType 'Other'", + "resourceTypeGeneral"=>"Presentation" + } + ) + expect(json.dig("data", "attributes", "relatedIdentifiers", 1)).to eq( + { + "relatedIdentifier" => "10.5438/55e5-t5c0", + "relatedIdentifierType" => "RAiD", + "relationType" => "Other", + "relationTypeInformation" => "More information to supplement relationType 'Other'", + "resourceTypeGeneral"=>"Presentation" + } + ) + + expect(json.dig("data", "attributes", "relatedItems")).to eq([{ + "relatedItemType" => "Presentation", + "relationType" => "Other", + "relationTypeInformation" => "More information to supplement relationType 'Other'", + "relatedItemIdentifier" => { "relatedItemIdentifier" => "10.82523/hnhr-r562", "relatedItemIdentifierType" => "SWHID" } + }]) + + expect(json.dig("data", "attributes", "descriptions", 0, "description")).to start_with("Diet and physical activity") + expect(json.dig("data", "attributes", "geoLocations")).to eq([{ "geoLocationPoint" => { "pointLatitude" => 49.0850736, "pointLongitude" => -123.3300992 } }]) + expect(json.dig("data", "attributes", "source")).to eq("test") + expect(json.dig("data", "attributes", "state")).to eq("findable") + + doc = Nokogiri::XML(Base64.decode64(json.dig("data", "attributes", "xml")), nil, "UTF-8", &:noblanks) + expect(doc.at_css("identifier").content).to eq("10.14454/10703") + expect(doc.at_css("subjects").content).to eq("80505 Web Technologies (excl. Web Search)") + expect(doc.at_css("contributors").content).to eq("Fenner, KurtKurtFennerhttps://orcid.org/0000-0003-1419-2401") + expect(doc.at_css("dates").content).to eq("2017-02-242015-11-282017-02-24") + # expect(doc.at_css("relatedIdentifiers").content).to eq("10.5438/55e5-t5c0") + expect(doc.at_css("descriptions").content).to start_with("Diet and physical activity") + expect(doc.at_css("geoLocations").content).to eq("49.0850736-123.3300992") + end + end end end From 4b846a13e2da1b4e5223d441eacc2da638f38f51 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 26 Jan 2026 21:43:45 -0500 Subject: [PATCH 04/34] Appease Rubocop --- spec/requests/datacite_dois/post_spec.rb | 40 ++++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/spec/requests/datacite_dois/post_spec.rb b/spec/requests/datacite_dois/post_spec.rb index c284af661..255338327 100644 --- a/spec/requests/datacite_dois/post_spec.rb +++ b/spec/requests/datacite_dois/post_spec.rb @@ -2498,29 +2498,29 @@ "contributors" => [{ "contributorType" => "DataManager", "familyName" => "Fenner", "givenName" => "Kurt", "nameIdentifiers" => [{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2401", "nameIdentifierScheme" => "ORCID", "schemeUri" => "https://orcid.org" }], "name" => "Fenner, Kurt", "nameType" => "Personal" }], "dates" => [{ "date" => "2017-02-24", "dateType" => "Issued" }, { "date" => "2015-11-28", "dateType" => "Created" }, { "date" => "2017-02-24", "dateType" => "Updated" }], "relatedIdentifiers" => [ - { + { "relatedIdentifier" => "10.5438/55e5-t5c0", - "relatedIdentifierType" => "DOI", - "relationType" => "Other", + "relatedIdentifierType" => "DOI", + "relationType" => "Other", "relationTypeInformation" => "More information to supplement relationType 'Other'", "resourceTypeGeneral" => "Presentation" }, - { + { "relatedIdentifier" => "10.5438/55e5-t5c0", - "relatedIdentifierType" => "RAiD", - "relationType" => "Other", + "relatedIdentifierType" => "RAiD", + "relationType" => "Other", "relationTypeInformation" => "More information to supplement relationType 'Other'", "resourceTypeGeneral" => "Presentation" }, ], "relatedItems": [ - { - "relatedItemType" => "Presentation", - "relationType" => "Other", - "relationTypeInformation" => "More information to supplement relationType 'Other'", + { + "relatedItemType" => "Presentation", + "relationType" => "Other", + "relationTypeInformation" => "More information to supplement relationType 'Other'", "relatedItemIdentifier": { "relatedItemIdentifier" => "10.82523/hnhr-r562", "relatedItemIdentifierType" => "SWHID" } } ], - + "descriptions" => [ { "lang" => "en", @@ -2569,7 +2569,7 @@ "givenName" => "Kurt", "name" => "Fenner, Kurt", "nameIdentifiers" => - [{ + [{ "nameIdentifier" => "https://orcid.org/0000-0003-1419-2401", "nameIdentifierScheme" => "ORCID", "schemeUri" => "https://orcid.org" }], @@ -2581,28 +2581,28 @@ expect(json.dig("data", "attributes", "types", "resourceType")).to eq("Test Resource Type") expect(json.dig("data", "attributes", "relatedIdentifiers", 0)).to eq( - { + { "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "DOI", "relationType" => "Other", - "relationTypeInformation" => "More information to supplement relationType 'Other'", - "resourceTypeGeneral"=>"Presentation" + "relationTypeInformation" => "More information to supplement relationType 'Other'", + "resourceTypeGeneral" => "Presentation" } ) expect(json.dig("data", "attributes", "relatedIdentifiers", 1)).to eq( - { + { "relatedIdentifier" => "10.5438/55e5-t5c0", "relatedIdentifierType" => "RAiD", "relationType" => "Other", - "relationTypeInformation" => "More information to supplement relationType 'Other'", - "resourceTypeGeneral"=>"Presentation" + "relationTypeInformation" => "More information to supplement relationType 'Other'", + "resourceTypeGeneral" => "Presentation" } ) - expect(json.dig("data", "attributes", "relatedItems")).to eq([{ + expect(json.dig("data", "attributes", "relatedItems")).to eq([{ "relatedItemType" => "Presentation", "relationType" => "Other", - "relationTypeInformation" => "More information to supplement relationType 'Other'", + "relationTypeInformation" => "More information to supplement relationType 'Other'", "relatedItemIdentifier" => { "relatedItemIdentifier" => "10.82523/hnhr-r562", "relatedItemIdentifierType" => "SWHID" } }]) From e1c640d1b5186242ed3423c7a67d95a6bf2e9742 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 26 Jan 2026 22:40:31 -0500 Subject: [PATCH 05/34] Test - puts/patch metadata-4.7 --- spec/requests/datacite_dois/patch_spec.rb | 38 +++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/spec/requests/datacite_dois/patch_spec.rb b/spec/requests/datacite_dois/patch_spec.rb index 01cba929d..0e0646404 100644 --- a/spec/requests/datacite_dois/patch_spec.rb +++ b/spec/requests/datacite_dois/patch_spec.rb @@ -998,4 +998,42 @@ end end end + + # Metadata 4.7 - elements + + context "when the record exists" do + let(:xml) { Base64.strict_encode64(file_fixture("datacite-example-full-v4.7.xml").read) } + let(:valid_attributes) do + { + "data" => { + "type" => "dois", + "attributes" => { + "url" => "http://www.bl.uk/pdf/pat.pdf", + "xml" => xml, + }, + }, + } + end + + it "updates the record" do + patch "/dois/#{doi.doi}", valid_attributes, headers + + expect(last_response.status).to eq(200) + + expect(json.dig("data", "attributes", "url")).to eq("http://www.bl.uk/pdf/pat.pdf") + expect(json.dig("data", "attributes", "doi")).to eq(doi.doi.downcase) + + expect(json.dig("data", "attributes", "types", "resourceTypeGeneral")).to eq("Presentation") + expect(json.dig("data", "attributes", "types", "resourceType")).to eq("Example ResourceType") + + expect(json.dig("data", "attributes", "relatedIdentifiers", 40, "relationType")).to eq("Other") + expect(json.dig("data", "attributes", "relatedIdentifiers", 40, "relationTypeInformation")).to eq("More relationType information to supplement relationType 'Other'") + + expect(json.dig("data", "attributes", "relatedItems", 3, "relatedItemType")).to eq("Presentation") + expect(json.dig("data", "attributes", "relatedItems", 4, "relatedItemType")).to eq("Poster") + expect(json.dig("data", "attributes", "relatedItems", 5, "relatedItemIdentifier", "relatedItemIdentifierType")).to eq("SWHID") + expect(json.dig("data", "attributes", "relatedItems", 6, "relationType")).to eq("Other") + # expect(json.dig("data", "attributes", "relatedItems", 6, "relationTypeInformation")).to eq("More relationType information to supplement relationType 'Other'") + end + end end From 6c843b7c9c6377d13a7606fccc8b12e32082ff3e Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 26 Jan 2026 22:45:27 -0500 Subject: [PATCH 06/34] Appease Rubocop --- spec/requests/datacite_dois/patch_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/requests/datacite_dois/patch_spec.rb b/spec/requests/datacite_dois/patch_spec.rb index 0e0646404..a0c5b9cce 100644 --- a/spec/requests/datacite_dois/patch_spec.rb +++ b/spec/requests/datacite_dois/patch_spec.rb @@ -1022,7 +1022,7 @@ expect(json.dig("data", "attributes", "url")).to eq("http://www.bl.uk/pdf/pat.pdf") expect(json.dig("data", "attributes", "doi")).to eq(doi.doi.downcase) - + expect(json.dig("data", "attributes", "types", "resourceTypeGeneral")).to eq("Presentation") expect(json.dig("data", "attributes", "types", "resourceType")).to eq("Example ResourceType") From 5e1bc6e636bb8faebffa2e7dded6826ffaaf70d7 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 27 Jan 2026 19:45:39 -0500 Subject: [PATCH 07/34] Config fix. --- docker-compose.local.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docker-compose.local.yml b/docker-compose.local.yml index b1727aaed..3dad310c1 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -1,8 +1,3 @@ services: web: - build: - context: . - dockerfile: Dockerfile.local - additional_contexts: - mygitdir: ../ - pull_policy: build \ No newline at end of file + build: . From 95c889a5de8791801ca49b885ce81747c0a6095a Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 27 Jan 2026 19:56:36 -0500 Subject: [PATCH 08/34] Config fix. --- docker-compose.yml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 06ac74ad7..984d70ae6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,10 @@ services: env_file: .env environment: - ELASTIC_PASSWORD=AnUnsecurePassword123 - image: lupo-web:latest + - PASSENGER_MAX_POOL_SIZE=12 + - PASSENGER_MIN_INSTANCES=5 + image: ghcr.io/datacite/lupo:main + # build: . ports: - "8065:80" - "2265:22" @@ -16,27 +19,31 @@ services: - ./lib:/home/app/webapp/lib - ./spec:/home/app/webapp/spec - ./storage:/home/app/webapp/storage - - ../bolognese:/home/app/webapp/vendor/gems-2 networks: - public depends_on: - elasticsearch + - mysql + - memcached + - minio + memcached: - image: memcached:1.4.31 + image: memcached:1.6.22 networks: - public + mysql: command: --max_allowed_packet=50000000 environment: MYSQL_DATABASE: datacite MYSQL_ALLOW_EMPTY_PASSWORD: "yes" - image: mysql:8 + image: mysql:8.4.7 ports: - "3309:3306" networks: - public elasticsearch: - image: opensearchproject/opensearch:2 + image: opensearchproject/opensearch:2 ports: - "9201:9200" - "9301:9300" @@ -59,6 +66,20 @@ services: interval: 10s timeout: 1s + minio: + command: server /data --console-address ":9001" + environment: + MINIO_ROOT_USER: minioadmin + MINIO_ROOT_PASSWORD: minioadmin + image: minio/minio:latest + ports: + - "9000:9000" + - "9001:9001" + networks: + - public + volumes: + - data:/user/share/minio/data + volumes: data: driver: local From 312c05e6171355bf2b55a06fcfd3050467456c91 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 29 Jan 2026 15:29:31 -0500 Subject: [PATCH 09/34] Add tests for relatedItemsInformation bolognese bug. --- spec/fixtures/files/datacite-example-full-v4.7.xml | 2 +- spec/requests/datacite_dois/patch_spec.rb | 2 +- spec/requests/datacite_dois/post_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/fixtures/files/datacite-example-full-v4.7.xml b/spec/fixtures/files/datacite-example-full-v4.7.xml index fd2328337..d4c979ecd 100644 --- a/spec/fixtures/files/datacite-example-full-v4.7.xml +++ b/spec/fixtures/files/datacite-example-full-v4.7.xml @@ -285,7 +285,7 @@ Journal of Metadata Examples - IsCollectedBy - Poster - + 0123-4567 Journal of Metadata Examples - IsCollectedBy - Poster diff --git a/spec/requests/datacite_dois/patch_spec.rb b/spec/requests/datacite_dois/patch_spec.rb index a0c5b9cce..8641f479a 100644 --- a/spec/requests/datacite_dois/patch_spec.rb +++ b/spec/requests/datacite_dois/patch_spec.rb @@ -1033,7 +1033,7 @@ expect(json.dig("data", "attributes", "relatedItems", 4, "relatedItemType")).to eq("Poster") expect(json.dig("data", "attributes", "relatedItems", 5, "relatedItemIdentifier", "relatedItemIdentifierType")).to eq("SWHID") expect(json.dig("data", "attributes", "relatedItems", 6, "relationType")).to eq("Other") - # expect(json.dig("data", "attributes", "relatedItems", 6, "relationTypeInformation")).to eq("More relationType information to supplement relationType 'Other'") + expect(json.dig("data", "attributes", "relatedItems", 6, "relationTypeInformation")).to eq("More relationType information to supplement relationType 'Other'") end end end diff --git a/spec/requests/datacite_dois/post_spec.rb b/spec/requests/datacite_dois/post_spec.rb index 255338327..6996ca1da 100644 --- a/spec/requests/datacite_dois/post_spec.rb +++ b/spec/requests/datacite_dois/post_spec.rb @@ -2470,7 +2470,7 @@ expect(json.dig("data", "attributes", "relatedItems", 4, "relatedItemType")).to eq("Poster") expect(json.dig("data", "attributes", "relatedItems", 5, "relatedItemIdentifier", "relatedItemIdentifierType")).to eq("SWHID") expect(json.dig("data", "attributes", "relatedItems", 6, "relationType")).to eq("Other") - # expect(json.dig("data", "attributes", "relatedItems", 6, "relationTypeInformation")).to eq("More relationType information to supplement relationType 'Other'") + expect(json.dig("data", "attributes", "relatedItems", 6, "relationTypeInformation")).to eq("More relationType information to supplement relationType 'Other'") end end From 5c744d000d8d9555f033199a07e66dd0432ecdca Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 29 Jan 2026 15:43:25 -0500 Subject: [PATCH 10/34] Forgot to update bolognese. --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8167158d7..476239294 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/datacite/bolognese.git - revision: 02e99bbb92309a3aae9e10c1185cd5c21cb9e5fd + revision: 25b92c22de944d4c34a319423677d919c4c0a47d branch: metadata-47 specs: bolognese (2.5.1) From 9d6e0e5c14666b1ed34440542b5e2ec2df3318b1 Mon Sep 17 00:00:00 2001 From: jrhoads Date: Wed, 4 Feb 2026 09:41:34 +0100 Subject: [PATCH 11/34] Uncomment shoryuken config --- config/shoryuken.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/config/shoryuken.yml b/config/shoryuken.yml index 39385ad9c..c3da64082 100644 --- a/config/shoryuken.yml +++ b/config/shoryuken.yml @@ -1,21 +1,21 @@ -#concurrency: <%= ENV.fetch('SHORYUKEN_CONCURRENCY', 30) %> -#delay: 0 -#pidfile: tmp/pids/shoryuken.pid -#queues: -# - [lupo, 8] -# - [lupo_doi_registration, 8] -# - [lupo_import, 8] -# - [lupo_import_other_doi, 8] -# - [lupo_transfer, 4] -# - [lupo_background, 2] -# - [lupo_support, 1] +concurrency: <%= ENV.fetch('SHORYUKEN_CONCURRENCY', 30) %> +delay: 0 +pidfile: tmp/pids/shoryuken.pid +queues: + - [lupo, 8] + - [lupo_doi_registration, 8] + - [lupo_import, 8] + - [lupo_import_other_doi, 8] + - [lupo_transfer, 4] + - [lupo_background, 2] + - [lupo_support, 1] -#groups: -# batch_enqueue_other_group: -# concurrency: 1 -# queues: -# - lupo_queue_batches_other_doi -# batch_enqueue_datacite_group: -# concurrency: 1 -# queues: -# - lupo_queue_batches_datacite_doi +groups: + batch_enqueue_other_group: + concurrency: 1 + queues: + - lupo_queue_batches_other_doi + batch_enqueue_datacite_group: + concurrency: 1 + queues: + - lupo_queue_batches_datacite_doi From d3af110a61a127e0d846c2c0981c09847fecc525 Mon Sep 17 00:00:00 2001 From: jrhoads Date: Wed, 4 Feb 2026 09:44:58 +0100 Subject: [PATCH 12/34] Add back events group to shoryuken config --- config/shoryuken.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/shoryuken.yml b/config/shoryuken.yml index c3da64082..201cad06c 100644 --- a/config/shoryuken.yml +++ b/config/shoryuken.yml @@ -19,3 +19,8 @@ groups: concurrency: 1 queues: - lupo_queue_batches_datacite_doi + events_other_doi_job_group: + concurrency: 10 + queues: + - events_other_doi_job + - events_other_doi_by_id_job From 2267c7b5ebd9020bfa1a68052fca958d3ce807a1 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 6 Feb 2026 10:19:16 -0500 Subject: [PATCH 13/34] Changing relationTypeInformation from ES/OS 'keyword' type field to 'text' type field. --- app/models/doi.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index f72ee4912..088780759 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -300,12 +300,12 @@ def validate_publisher_obj?(doi) schemeUri: { type: :keyword }, schemeType: { type: :keyword }, resourceTypeGeneral: { type: :keyword }, - relationTypeInformation: { type: :keyword }, + relationTypeInformation: { type: :text }, } indexes :related_items, type: :object, properties: { relatedItemType: { type: :keyword }, relationType: { type: :keyword }, - relationTypeInformation: { type: :keyword }, + relationTypeInformation: { type: :text }, relatedItemIdentifier: { type: :object, properties: { relatedItemIdentifier: { type: :keyword, normalizer: "keyword_lowercase" }, relatedItemIdentifierType: { type: :keyword }, From 3225a254b0b7050978d3f23d3869b83cd796d453 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 6 Feb 2026 10:36:33 -0500 Subject: [PATCH 14/34] Use released bolognese. Appease rubocop. --- Gemfile | 4 ++-- Gemfile.lock | 56 +++++++++++++++++++++-------------------------- app/models/doi.rb | 2 +- 3 files changed, 28 insertions(+), 34 deletions(-) diff --git a/Gemfile b/Gemfile index f58562dc8..690cc8c2b 100644 --- a/Gemfile +++ b/Gemfile @@ -13,8 +13,8 @@ gem "aws-sdk-sqs", "~> 1.3" gem "base32-url", "~> 0.3" gem "batch-loader", "~> 1.4", ">= 1.4.1" gem "bcrypt", "~> 3.1.7" -# gem "bolognese", "~> 2.5.1" -gem "bolognese", git: "https://github.com/datacite/bolognese.git", branch: "metadata-47" +gem "bolognese", "~> 2.5.1" +# gem "bolognese", git: "https://github.com/datacite/bolognese.git", branch: "metadata-47" # gem "bolognese", path: "./vendor/gems/bolognese" gem "bootsnap", "~> 1.4", ">= 1.4.4", require: false gem "cancancan", "~> 3.0" diff --git a/Gemfile.lock b/Gemfile.lock index 114582be2..a4e8b5014 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,33 +1,3 @@ -GIT - remote: https://github.com/datacite/bolognese.git - revision: 25b92c22de944d4c34a319423677d919c4c0a47d - branch: metadata-47 - specs: - bolognese (2.5.1) - activesupport (= 7.2.3) - benchmark_methods (~> 0.7) - bibtex-ruby (>= 5.1.0) - builder (~> 3.2, >= 3.2.2) - citeproc-ruby (~> 1.1, >= 1.1.12) - colorize (~> 0.8.1) - concurrent-ruby (~> 1.1, >= 1.1.5) - csl-styles (~> 1.0, >= 1.0.1.10) - edtf (~> 3.0, >= 3.0.4) - gender_detector (~> 0.1.2) - iso8601 (~> 0.9.1) - json-ld-preloaded (~> 3.1, >= 3.1.3) - jsonlint (~> 0.3.0) - loofah (~> 2.0, >= 2.0.3) - maremma (~> 5.0) - namae (~> 1.0) - nokogiri (~> 1.16, >= 1.16.2) - oj (~> 3.10) - oj_mimic_json (~> 1.0, >= 1.0.1) - postrank-uri (~> 1.0, >= 1.0.18) - rdf-rdfxml (~> 3.1) - rdf-turtle (~> 3.1) - thor (>= 0.19) - GEM remote: https://rubygems.org/ specs: @@ -167,6 +137,30 @@ GEM bigdecimal (3.1.6) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) + bolognese (2.5.1) + activesupport (= 7.2.3) + benchmark_methods (~> 0.7) + bibtex-ruby (>= 5.1.0) + builder (~> 3.2, >= 3.2.2) + citeproc-ruby (~> 1.1, >= 1.1.12) + colorize (~> 0.8.1) + concurrent-ruby (~> 1.1, >= 1.1.5) + csl-styles (~> 1.0, >= 1.0.1.10) + edtf (~> 3.0, >= 3.0.4) + gender_detector (~> 0.1.2) + iso8601 (~> 0.9.1) + json-ld-preloaded (~> 3.1, >= 3.1.3) + jsonlint (~> 0.3.0) + loofah (~> 2.0, >= 2.0.3) + maremma (~> 5.0) + namae (~> 1.0) + nokogiri (~> 1.16, >= 1.16.2) + oj (~> 3.10) + oj_mimic_json (~> 1.0, >= 1.0.1) + postrank-uri (~> 1.0, >= 1.0.18) + rdf-rdfxml (~> 3.1) + rdf-turtle (~> 3.1) + thor (>= 0.19) bootsnap (1.15.0) msgpack (~> 1.2) brakeman (6.1.2) @@ -821,7 +815,7 @@ DEPENDENCIES bcrypt (~> 3.1.7) better_errors binding_of_caller - bolognese! + bolognese (~> 2.5.1) bootsnap (~> 1.4, >= 1.4.4) brakeman (~> 6.1, >= 6.1.2) bullet (~> 8.1) diff --git a/app/models/doi.rb b/app/models/doi.rb index 088780759..3a6fd758c 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -302,7 +302,7 @@ def validate_publisher_obj?(doi) resourceTypeGeneral: { type: :keyword }, relationTypeInformation: { type: :text }, } - indexes :related_items, type: :object, properties: { + indexes :related_items, type: :object, properties: { relatedItemType: { type: :keyword }, relationType: { type: :keyword }, relationTypeInformation: { type: :text }, From 5c415ee0a23664caf3a27e88a79b012d86132d62 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 6 Feb 2026 14:05:47 -0500 Subject: [PATCH 15/34] Debugging output. --- app/jobs/datacite_doi_batch_enqueue_job.rb | 4 ++++ app/jobs/datacite_doi_import_in_bulk_job.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/app/jobs/datacite_doi_batch_enqueue_job.rb b/app/jobs/datacite_doi_batch_enqueue_job.rb index f31ee5d63..457d5d516 100644 --- a/app/jobs/datacite_doi_batch_enqueue_job.rb +++ b/app/jobs/datacite_doi_batch_enqueue_job.rb @@ -5,8 +5,12 @@ class DataciteDoiBatchEnqueueJob < ApplicationJob queue_as :lupo_queue_batches_datacite_doi def perform(start_id, end_id, batch_size: 50, index: nil) + # GOT HERE!!!! + Rails.logger.info "ZZZZ: Enqueuing DataciteDoiImportInBulkJob for DataciteDois with IDs #{start_id}-#{end_id} in batches of #{batch_size} to index #{index}." ids = DataciteDoi.where(type: "DataciteDoi", id: start_id..end_id).pluck(:id) ids.each_slice(batch_size) do |batch_ids| + # GOT HERE!!!! + Rails.logger.info "ZZZZ: Enqueuing DataciteDoiImportInBulkJob for batch of DataciteDois with IDs #{batch_ids.first}-#{batch_ids.last} to index #{index}." DataciteDoiImportInBulkJob.perform_later(batch_ids, index: index) end end diff --git a/app/jobs/datacite_doi_import_in_bulk_job.rb b/app/jobs/datacite_doi_import_in_bulk_job.rb index 14cf6952c..64a8bbcb7 100644 --- a/app/jobs/datacite_doi_import_in_bulk_job.rb +++ b/app/jobs/datacite_doi_import_in_bulk_job.rb @@ -4,6 +4,8 @@ class DataciteDoiImportInBulkJob < ApplicationJob queue_as :lupo_import def perform(ids, options = {}) + # GOT HERE!!!! + Rails.logger.info "ZZZZ: Starting DataciteDoiImportInBulkJob for DataciteDois with IDs #{ids.first}-#{ids.last} to index #{options[:index]}." DataciteDoi.import_in_bulk(ids, options) end end From d3180e731017d7edbf8a313c2fea476a0165bb09 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Sun, 8 Feb 2026 16:18:13 -0500 Subject: [PATCH 16/34] Issue due to upgrade? Presence of both positional parameters and keyed parameters mixed with upgrade to ruby 3 caused 'ArgumentError: wrong number of arguments (given 3, expected 2)' during reindexing of DOIS --- app/jobs/datacite_doi_batch_enqueue_job.rb | 6 +----- app/jobs/datacite_doi_import_in_bulk_job.rb | 2 -- app/models/datacite_doi.rb | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/app/jobs/datacite_doi_batch_enqueue_job.rb b/app/jobs/datacite_doi_batch_enqueue_job.rb index 457d5d516..7cc5bd965 100644 --- a/app/jobs/datacite_doi_batch_enqueue_job.rb +++ b/app/jobs/datacite_doi_batch_enqueue_job.rb @@ -4,13 +4,9 @@ class DataciteDoiBatchEnqueueJob < ApplicationJob queue_as :lupo_queue_batches_datacite_doi - def perform(start_id, end_id, batch_size: 50, index: nil) - # GOT HERE!!!! - Rails.logger.info "ZZZZ: Enqueuing DataciteDoiImportInBulkJob for DataciteDois with IDs #{start_id}-#{end_id} in batches of #{batch_size} to index #{index}." + def perform(start_id, end_id, batch_size = 50, index = nil ) ids = DataciteDoi.where(type: "DataciteDoi", id: start_id..end_id).pluck(:id) ids.each_slice(batch_size) do |batch_ids| - # GOT HERE!!!! - Rails.logger.info "ZZZZ: Enqueuing DataciteDoiImportInBulkJob for batch of DataciteDois with IDs #{batch_ids.first}-#{batch_ids.last} to index #{index}." DataciteDoiImportInBulkJob.perform_later(batch_ids, index: index) end end diff --git a/app/jobs/datacite_doi_import_in_bulk_job.rb b/app/jobs/datacite_doi_import_in_bulk_job.rb index 64a8bbcb7..14cf6952c 100644 --- a/app/jobs/datacite_doi_import_in_bulk_job.rb +++ b/app/jobs/datacite_doi_import_in_bulk_job.rb @@ -4,8 +4,6 @@ class DataciteDoiImportInBulkJob < ApplicationJob queue_as :lupo_import def perform(ids, options = {}) - # GOT HERE!!!! - Rails.logger.info "ZZZZ: Starting DataciteDoiImportInBulkJob for DataciteDois with IDs #{ids.first}-#{ids.last} to index #{options[:index]}." DataciteDoi.import_in_bulk(ids, options) end end diff --git a/app/models/datacite_doi.rb b/app/models/datacite_doi.rb index 1e67ec85e..1ce8fea70 100644 --- a/app/models/datacite_doi.rb +++ b/app/models/datacite_doi.rb @@ -43,7 +43,7 @@ def self.import_by_ids(options = {}) count = 0 (from_id..until_id).step(shard_size) do |start_id| end_id = [start_id + shard_size - 1, until_id].min - DataciteDoiBatchEnqueueJob.perform_later(start_id, end_id, batch_size: batch_size, index: index) + DataciteDoiBatchEnqueueJob.perform_later(start_id, end_id, batch_size, index) count += 1 Rails.logger.info "Queued batch (#{count}) of DataciteDoiBatchEnqueueJob for DataciteDois with IDs #{start_id}-#{end_id}" end From c823af3a77baea62865883d1faabcba9af09a8db Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Sun, 8 Feb 2026 16:22:16 -0500 Subject: [PATCH 17/34] Appease rubocop. --- app/jobs/datacite_doi_batch_enqueue_job.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/datacite_doi_batch_enqueue_job.rb b/app/jobs/datacite_doi_batch_enqueue_job.rb index 7cc5bd965..c46dd6a92 100644 --- a/app/jobs/datacite_doi_batch_enqueue_job.rb +++ b/app/jobs/datacite_doi_batch_enqueue_job.rb @@ -4,7 +4,7 @@ class DataciteDoiBatchEnqueueJob < ApplicationJob queue_as :lupo_queue_batches_datacite_doi - def perform(start_id, end_id, batch_size = 50, index = nil ) + def perform(start_id, end_id, batch_size = 50, index = nil) ids = DataciteDoi.where(type: "DataciteDoi", id: start_id..end_id).pluck(:id) ids.each_slice(batch_size) do |batch_ids| DataciteDoiImportInBulkJob.perform_later(batch_ids, index: index) From 0bc8a7200ba5ed49d38cb895d7af5308c428237d Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Mon, 9 Feb 2026 13:21:12 -0500 Subject: [PATCH 18/34] Upgrade shoryuken from 7.0.0 to 7.0.1. 7.0.0 had broken support for mixed keyword and positional parameters which we use in reindexing. --- Gemfile | 2 +- Gemfile.lock | 4 ++-- app/jobs/datacite_doi_batch_enqueue_job.rb | 2 +- app/models/datacite_doi.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 690cc8c2b..4c7aa03f5 100644 --- a/Gemfile +++ b/Gemfile @@ -68,7 +68,7 @@ gem "rails", "~> 7.2" gem "rake", "~> 12.0" gem "sentry-ruby", "~> 5.20" gem "sentry-rails", "~> 5.20" -gem "shoryuken", "~> 7.0" +gem "shoryuken", "~> 7.0.1" gem "simple_command" gem "slack-notifier", "~> 2.1" gem "sparql", "~> 3.1", ">= 3.1.2" diff --git a/Gemfile.lock b/Gemfile.lock index a4e8b5014..7e3fae831 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -702,7 +702,7 @@ GEM bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) sexp_processor (4.17.1) - shoryuken (7.0.0) + shoryuken (7.0.1) aws-sdk-sqs (>= 1.66.0) concurrent-ruby thor @@ -891,7 +891,7 @@ DEPENDENCIES seedbank sentry-rails (~> 5.20) sentry-ruby (~> 5.20) - shoryuken (~> 7.0) + shoryuken (~> 7.0.1) shoulda-matchers (~> 4.1, >= 4.1.2) simple_command simplecov (~> 0.22.0) diff --git a/app/jobs/datacite_doi_batch_enqueue_job.rb b/app/jobs/datacite_doi_batch_enqueue_job.rb index c46dd6a92..f31ee5d63 100644 --- a/app/jobs/datacite_doi_batch_enqueue_job.rb +++ b/app/jobs/datacite_doi_batch_enqueue_job.rb @@ -4,7 +4,7 @@ class DataciteDoiBatchEnqueueJob < ApplicationJob queue_as :lupo_queue_batches_datacite_doi - def perform(start_id, end_id, batch_size = 50, index = nil) + def perform(start_id, end_id, batch_size: 50, index: nil) ids = DataciteDoi.where(type: "DataciteDoi", id: start_id..end_id).pluck(:id) ids.each_slice(batch_size) do |batch_ids| DataciteDoiImportInBulkJob.perform_later(batch_ids, index: index) diff --git a/app/models/datacite_doi.rb b/app/models/datacite_doi.rb index 1ce8fea70..1e67ec85e 100644 --- a/app/models/datacite_doi.rb +++ b/app/models/datacite_doi.rb @@ -43,7 +43,7 @@ def self.import_by_ids(options = {}) count = 0 (from_id..until_id).step(shard_size) do |start_id| end_id = [start_id + shard_size - 1, until_id].min - DataciteDoiBatchEnqueueJob.perform_later(start_id, end_id, batch_size, index) + DataciteDoiBatchEnqueueJob.perform_later(start_id, end_id, batch_size: batch_size, index: index) count += 1 Rails.logger.info "Queued batch (#{count}) of DataciteDoiBatchEnqueueJob for DataciteDois with IDs #{start_id}-#{end_id}" end From 4c23b5e30542ecc0f2a753cd58443a1b69c9b83a Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 10 Feb 2026 10:34:39 -0500 Subject: [PATCH 19/34] Shoryuken - use all keyword arguments. --- app/jobs/datacite_doi_batch_enqueue_job.rb | 2 +- app/models/datacite_doi.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jobs/datacite_doi_batch_enqueue_job.rb b/app/jobs/datacite_doi_batch_enqueue_job.rb index f31ee5d63..64919de20 100644 --- a/app/jobs/datacite_doi_batch_enqueue_job.rb +++ b/app/jobs/datacite_doi_batch_enqueue_job.rb @@ -4,7 +4,7 @@ class DataciteDoiBatchEnqueueJob < ApplicationJob queue_as :lupo_queue_batches_datacite_doi - def perform(start_id, end_id, batch_size: 50, index: nil) + def perform(start_id:, end_id:, batch_size: 50, index: nil) ids = DataciteDoi.where(type: "DataciteDoi", id: start_id..end_id).pluck(:id) ids.each_slice(batch_size) do |batch_ids| DataciteDoiImportInBulkJob.perform_later(batch_ids, index: index) diff --git a/app/models/datacite_doi.rb b/app/models/datacite_doi.rb index 1e67ec85e..ac15b7fec 100644 --- a/app/models/datacite_doi.rb +++ b/app/models/datacite_doi.rb @@ -43,7 +43,7 @@ def self.import_by_ids(options = {}) count = 0 (from_id..until_id).step(shard_size) do |start_id| end_id = [start_id + shard_size - 1, until_id].min - DataciteDoiBatchEnqueueJob.perform_later(start_id, end_id, batch_size: batch_size, index: index) + DataciteDoiBatchEnqueueJob.perform_later(start_id: start_id, end_id: end_id, batch_size: batch_size, index: index) count += 1 Rails.logger.info "Queued batch (#{count}) of DataciteDoiBatchEnqueueJob for DataciteDois with IDs #{start_id}-#{end_id}" end From 2c64ebf444652b821d0f2d627254676204c40bd1 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 10 Feb 2026 12:09:00 -0500 Subject: [PATCH 20/34] Correct regressions in gemfile.lock. --- Gemfile | 2 -- Gemfile.lock | 84 +++++++++++++++++++++++++++------------------------- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/Gemfile b/Gemfile index 4c7aa03f5..3118d7a18 100644 --- a/Gemfile +++ b/Gemfile @@ -14,8 +14,6 @@ gem "base32-url", "~> 0.3" gem "batch-loader", "~> 1.4", ">= 1.4.1" gem "bcrypt", "~> 3.1.7" gem "bolognese", "~> 2.5.1" -# gem "bolognese", git: "https://github.com/datacite/bolognese.git", branch: "metadata-47" -# gem "bolognese", path: "./vendor/gems/bolognese" gem "bootsnap", "~> 1.4", ">= 1.4.4", require: false gem "cancancan", "~> 3.0" gem "countries", "~> 2.1", ">= 2.1.2" diff --git a/Gemfile.lock b/Gemfile.lock index 7e3fae831..9f42592d2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,8 +96,8 @@ GEM activerecord (>= 5.2, < 8.2) activesupport (>= 5.2, < 8.2) aws-eventstream (1.4.0) - aws-partitions (1.1203.0) - aws-sdk-core (3.241.3) + aws-partitions (1.1206.0) + aws-sdk-core (3.241.4) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) @@ -134,7 +134,7 @@ GEM latex-decode (~> 0.0) logger (~> 1.7) racc (~> 1.7) - bigdecimal (3.1.6) + bigdecimal (4.0.1) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) bolognese (2.5.1) @@ -165,7 +165,7 @@ GEM msgpack (~> 1.2) brakeman (6.1.2) racc - builder (3.2.4) + builder (3.3.0) bullet (8.1.0) activesupport (>= 3.0.0) uniform_notifier (~> 1.11) @@ -185,7 +185,7 @@ GEM xpath (~> 3.2) case_transform (0.2) activesupport - cgi (0.5.1) + cgi (0.5.0) citeproc (1.1.0) date forwardable @@ -200,7 +200,7 @@ GEM coderay (1.1.3) colorize (0.8.1) concurrent-ruby (1.3.6) - connection_pool (2.3.0) + connection_pool (2.5.4) countries (2.1.4) i18n_data (~> 0.8.0) money (~> 6.9) @@ -228,7 +228,7 @@ GEM libdatadog (~> 11.0.0.1.0) libddwaf (~> 1.14.0.0.0) msgpack - date (3.4.1) + date (3.5.0) debase-ruby_core_source (3.3.1) debug_inspector (1.1.0) departure (6.8.0) @@ -242,8 +242,7 @@ GEM domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) - drb (2.2.0) - ruby2_keywords + drb (2.2.3) dry-configurable (1.1.0) dry-core (~> 1.0, < 2) zeitwerk (~> 2.6) @@ -264,8 +263,8 @@ GEM dry-logic (>= 1.4, < 2) dry-types (>= 1.7, < 2) zeitwerk (~> 2.6) - dry-types (1.7.2) - bigdecimal (~> 3.0) + dry-types (1.9.0) + bigdecimal (>= 3.0) concurrent-ruby (~> 1.0) dry-core (~> 1.0) dry-inflector (~> 1.0) @@ -300,7 +299,9 @@ GEM multi_json equivalent-xml (0.6.0) nokogiri (>= 1.4.3) - erubi (1.12.0) + erb (4.0.4) + cgi (>= 0.3.3) + erubi (1.13.1) excon (0.71.1) facets (3.1.0) factory_bot (6.4.6) @@ -343,7 +344,7 @@ GEM git (1.13.0) addressable (~> 2.8) rchardet (~> 1.8) - globalid (1.2.1) + globalid (1.3.0) activesupport (>= 6.1) google-protobuf (3.25.8-aarch64-linux) google-protobuf (3.25.8-arm64-darwin) @@ -364,11 +365,11 @@ GEM http-accept (1.7.0) http-cookie (1.0.5) domain_name (~> 0.5) - i18n (1.12.0) + i18n (1.14.7) concurrent-ruby (~> 1.0) i18n_data (0.8.0) - io-console (0.7.2) - irb (1.16.0) + io-console (0.8.1) + irb (1.15.3) pp (>= 0.6.0) rdoc (>= 4.0.0) reline (>= 0.4.2) @@ -450,14 +451,15 @@ GEM nokogiri (>= 1.12.0) macaddr (1.7.2) systemu (~> 2.6.5) - mail (2.8.1) + mail (2.9.0) + logger mini_mime (>= 0.1.1) net-imap net-pop net-smtp mailgun-ruby (1.2.6) rest-client (>= 2.0.2) - marcel (1.0.2) + marcel (1.0.4) maremma (5.0.0) activesupport (>= 4.2.5) addressable (>= 2.3.6) @@ -477,8 +479,8 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2022.0105) mini_magick (4.12.0) - mini_mime (1.1.2) - minitest (5.18.0) + mini_mime (1.1.5) + minitest (5.26.1) money (6.16.0) i18n (>= 0.6.4, <= 2) msgpack (1.7.2) @@ -491,24 +493,24 @@ GEM uri net-http-persistent (4.0.1) connection_pool (~> 2.2) - net-imap (0.4.20) + net-imap (0.5.12) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.1) net-protocol netrc (0.11.0) - nio4r (2.7.0) - nokogiri (1.18.9-aarch64-linux-gnu) + nio4r (2.7.5) + nokogiri (1.18.10-aarch64-linux-gnu) racc (~> 1.4) - nokogiri (1.18.9-arm64-darwin) + nokogiri (1.18.10-arm64-darwin) racc (~> 1.4) - nokogiri (1.18.9-x86_64-darwin) + nokogiri (1.18.10-x86_64-darwin) racc (~> 1.4) - nokogiri (1.18.9-x86_64-linux-gnu) + nokogiri (1.18.10-x86_64-linux-gnu) racc (~> 1.4) observer (0.1.2) oj (3.13.23) @@ -546,18 +548,18 @@ GEM sysrandom qonfig (0.28.0) racc (1.8.1) - rack (2.2.20) + rack (2.2.21) rack-accept (0.4.5) rack (>= 0.4) rack-cors (1.1.1) rack (>= 2.0.0) rack-session (1.0.2) rack (< 3) - rack-test (2.1.0) + rack-test (2.2.0) rack (>= 1.3) rack-utf8_sanitizer (1.8.0) rack (>= 1.0, < 4.0) - rackup (1.0.0) + rackup (1.0.1) rack (< 3) webrick rails (7.2.3) @@ -574,11 +576,11 @@ GEM activesupport (= 7.2.3) bundler (>= 1.15.0) railties (= 7.2.3) - rails-dom-testing (2.2.0) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.1) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) railties (7.2.3) @@ -612,15 +614,17 @@ GEM rdf-xsd (3.2.1) rdf (~> 3.2) rexml (~> 3.2) - rdoc (6.6.3.1) + rdoc (6.15.1) + erb psych (>= 4.0.0) + tsort reek (6.3.0) dry-schema (~> 1.13.0) parser (~> 3.3.0) rainbow (>= 2.0, < 4.0) rexml (~> 3.1) regexp_parser (2.11.3) - reline (0.4.3) + reline (0.6.2) io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) @@ -687,7 +691,6 @@ GEM rubocop-rspec (2.16.0) rubocop (~> 1.33) ruby-progressbar (1.11.0) - ruby2_keywords (0.0.5) ruby_parser (3.21.0) racc (~> 1.5) sexp_processor (~> 4.16) @@ -754,11 +757,11 @@ GEM terrapin (1.0.1) climate_control test-prof (0.10.2) - thor (1.4.0) + thor (1.5.0) tilt (2.0.11) time (0.4.1) date - timeout (0.4.3) + timeout (0.4.4) tsort (0.2.0) turnout (2.5.0) i18n (>= 0.7, < 2) @@ -785,13 +788,14 @@ GEM addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) - webrick (1.8.2) - websocket-driver (0.7.6) + webrick (1.9.1) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.7) + zeitwerk (2.6.18) zlib (2.1.1) PLATFORMS From bdab260d0f1a5e66f80ad8d8b1b48feb14ff3715 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 10 Feb 2026 12:25:14 -0500 Subject: [PATCH 21/34] Remove perform/perform_later arg/param signature changes from previous commit. --- app/jobs/datacite_doi_batch_enqueue_job.rb | 2 +- app/models/datacite_doi.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jobs/datacite_doi_batch_enqueue_job.rb b/app/jobs/datacite_doi_batch_enqueue_job.rb index 64919de20..f31ee5d63 100644 --- a/app/jobs/datacite_doi_batch_enqueue_job.rb +++ b/app/jobs/datacite_doi_batch_enqueue_job.rb @@ -4,7 +4,7 @@ class DataciteDoiBatchEnqueueJob < ApplicationJob queue_as :lupo_queue_batches_datacite_doi - def perform(start_id:, end_id:, batch_size: 50, index: nil) + def perform(start_id, end_id, batch_size: 50, index: nil) ids = DataciteDoi.where(type: "DataciteDoi", id: start_id..end_id).pluck(:id) ids.each_slice(batch_size) do |batch_ids| DataciteDoiImportInBulkJob.perform_later(batch_ids, index: index) diff --git a/app/models/datacite_doi.rb b/app/models/datacite_doi.rb index ac15b7fec..1e67ec85e 100644 --- a/app/models/datacite_doi.rb +++ b/app/models/datacite_doi.rb @@ -43,7 +43,7 @@ def self.import_by_ids(options = {}) count = 0 (from_id..until_id).step(shard_size) do |start_id| end_id = [start_id + shard_size - 1, until_id].min - DataciteDoiBatchEnqueueJob.perform_later(start_id: start_id, end_id: end_id, batch_size: batch_size, index: index) + DataciteDoiBatchEnqueueJob.perform_later(start_id, end_id, batch_size: batch_size, index: index) count += 1 Rails.logger.info "Queued batch (#{count}) of DataciteDoiBatchEnqueueJob for DataciteDois with IDs #{start_id}-#{end_id}" end From 69f5a1c660e21b884f7fbc2fcfe11e53e1c492dd Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Tue, 10 Feb 2026 14:05:53 -0500 Subject: [PATCH 22/34] Remove inadvertently committed mods. --- config/environments/development.rb | 8 -------- 1 file changed, 8 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 9301116db..d5d1f64ec 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -38,19 +38,11 @@ # Use an evented file watcher to asynchronously detect changes in source code, # routes, locales, etc. This feature depends on the listen gem. config.file_watcher = ActiveSupport::EventedFileUpdateChecker - # config.file_watcher = ActiveSupport::FileUpdateChecker - - # config.action_controller.action_on_unpermitted_parameters = :raise - require "flipper/middleware/memoizer" config.middleware.use Flipper::Middleware::Memoizer config.flipper.memoize = false config.hosts << "lupo_web" - config.hosts << "lupo-web-1" - config.hosts << "lupo-web-1:8065" - config.hosts << "whirlwind.local:8065" - ENV["TEST_ENV_NUMBER"] ||= "" # For parallel tests, often set by CI, default to empty ENV["ES_PREFIX"] ||= "" # ElasticSearch index prefix ENV["API_KEY"] ||= "test_api_key" # Placeholder for general API key From 9a198131758ad3cedc47b098352e6a9ea009dcb6 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 11 Feb 2026 15:41:45 -0500 Subject: [PATCH 23/34] Appease coderabbitai --- spec/requests/datacite_dois/post_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/requests/datacite_dois/post_spec.rb b/spec/requests/datacite_dois/post_spec.rb index 6996ca1da..8c634c2e1 100644 --- a/spec/requests/datacite_dois/post_spec.rb +++ b/spec/requests/datacite_dois/post_spec.rb @@ -2482,7 +2482,7 @@ "attributes" => { "doi" => "10.14454/10703", "url" => "http://www.bl.uk/pdf/patspec.pdf", - "types": { + "types" => { "resourceTypeGeneral": "Poster", "resourceType": "Test Resource Type" }, @@ -2512,12 +2512,12 @@ }, ], - "relatedItems": [ + "relatedItems" => [ { "relatedItemType" => "Presentation", "relationType" => "Other", "relationTypeInformation" => "More information to supplement relationType 'Other'", - "relatedItemIdentifier": { "relatedItemIdentifier" => "10.82523/hnhr-r562", "relatedItemIdentifierType" => "SWHID" } + "relatedItemIdentifier" => { "relatedItemIdentifier" => "10.82523/hnhr-r562", "relatedItemIdentifierType" => "SWHID" } } ], From 6df20192a2cb29a85bece7d0eca118fa6b9f3625 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 11 Feb 2026 16:07:34 -0500 Subject: [PATCH 24/34] Appease coderabbitai. --- spec/requests/datacite_dois/post_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/requests/datacite_dois/post_spec.rb b/spec/requests/datacite_dois/post_spec.rb index 8c634c2e1..0eeab9d71 100644 --- a/spec/requests/datacite_dois/post_spec.rb +++ b/spec/requests/datacite_dois/post_spec.rb @@ -2616,7 +2616,7 @@ expect(doc.at_css("subjects").content).to eq("80505 Web Technologies (excl. Web Search)") expect(doc.at_css("contributors").content).to eq("Fenner, KurtKurtFennerhttps://orcid.org/0000-0003-1419-2401") expect(doc.at_css("dates").content).to eq("2017-02-242015-11-282017-02-24") - # expect(doc.at_css("relatedIdentifiers").content).to eq("10.5438/55e5-t5c0") + expect(doc.at_css("relatedIdentifiers").content).to eq("10.5438/55e5-t5c010.5438/55e5-t5c0") expect(doc.at_css("descriptions").content).to start_with("Diet and physical activity") expect(doc.at_css("geoLocations").content).to eq("49.0850736-123.3300992") end From e03d735e0799cfb1ecbf84323756b46f64c8349a Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 12 Feb 2026 15:25:02 -0500 Subject: [PATCH 25/34] Test 'query' for new field. --- .../datacite_dois/datacite_dois_spec.rb | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/spec/requests/datacite_dois/datacite_dois_spec.rb b/spec/requests/datacite_dois/datacite_dois_spec.rb index e72e8e1c3..8edafcc23 100755 --- a/spec/requests/datacite_dois/datacite_dois_spec.rb +++ b/spec/requests/datacite_dois/datacite_dois_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +require "pp" require "rails_helper" include Passwordable @@ -2177,4 +2178,80 @@ def clear_doi_index end end end + + # Metadata 4.7 search for new field: relationTypeInformation (in relatedIdentifiers and relatedItems) + + describe "GET /dois/query=...relationTypeInformation", vcr: true, elasticsearch: true do + + let!(:datacite_doi) { create(:doi, client: client, aasm_state: "findable", + related_items: [ + { + "firstPage" => "250", + "lastPage" => "264", + "publicationYear" => "2018", + "relatedItemIdentifier" => { "relatedItemIdentifier" => "10.1016/j.physletb.2017.11.044", "relatedItemIdentifierType" => "DOI" }, + "relatedItemType" => "Journal", + "relationType" => "IsPublishedIn", + "relationTypeInformation" => "Relates this DOI to the journal in which it was published.", + "titles" => [{ "title" => "Physics letters / B" }], + "volume" => "776" + } + ], + related_identifiers: [ + { + "relatedIdentifier": "10.5061/dryad.8515/1", + "relatedIdentifierType": "DOI", + "relationType": "HasPart", + "relationTypeInformation": "Relates this DOI to the dataset in Dryad that contains the data underlying the article.", + }, + { + "relatedIdentifier": "10.5061/dryad.8515/2", + "relatedIdentifierType": "DOI", + "relationType": "HasPart", + }, + { + "relatedIdentifier": "10.1371/journal.ppat.1000446", + "relatedIdentifierType": "DOI", + "relationType": "IsReferencedBy", + "relationTypeInformation": "Relates this DOI to the article that references it.", + }, + { + "relatedIdentifier": "10.1371/journal.ppat.1000446", + "relatedIdentifierType": "DOI", + "relationType": "IsSupplementTo", + }, + { + "relatedIdentifier": "19478877", + "relatedIdentifierType": "PMID", + "relationType": "IsReferencedBy", + }, + { + "relatedIdentifier": "19478877", + "relatedIdentifierType": "PMID", + "relationType": "IsSupplementTo", + } + ] + )} + + before do + clear_doi_index + import_doi_index + end + + it "finds the doi based on relatedItems.relationTypeInformation" do + get "/dois?query=relatedItems.relationTypeInformation:\"Relates this DOI to*\"", nil, headers + expect(last_response.status).to eq(200) + expect(json.dig("meta", "total")).to eq(1) + expect(json.dig("data", 0, "attributes", "relatedItems", 0, "relationTypeInformation")).to eq("Relates this DOI to the journal in which it was published.") + end + + + it "finds the dois based on relatedIdentiers.relationTypeInformation" do + get "/dois?query=relatedIdentifiers.relationTypeInformation:\"Relates this DOI to*\"", nil, headers + expect(last_response.status).to eq(200) + expect(json.dig("meta", "total")).to eq(1) + expect(json.dig("data", 0, "attributes", "relatedIdentifiers", 0, "relationTypeInformation")).to eq("Relates this DOI to the dataset in Dryad that contains the data underlying the article.") + expect(json.dig("data", 0, "attributes", "relatedIdentifiers", 2, "relationTypeInformation")).to eq("Relates this DOI to the article that references it.") + end + end end From 2fd876b055fe65116b2e6992a123dd60e5a0a66e Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 12 Feb 2026 15:33:16 -0500 Subject: [PATCH 26/34] Appease rubocop. --- spec/requests/datacite_dois/datacite_dois_spec.rb | 6 +++--- spec/requests/datacite_dois/patch_spec.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/requests/datacite_dois/datacite_dois_spec.rb b/spec/requests/datacite_dois/datacite_dois_spec.rb index 8edafcc23..f7ff7e9aa 100755 --- a/spec/requests/datacite_dois/datacite_dois_spec.rb +++ b/spec/requests/datacite_dois/datacite_dois_spec.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "pp" require "rails_helper" @@ -2179,11 +2180,10 @@ def clear_doi_index end end - # Metadata 4.7 search for new field: relationTypeInformation (in relatedIdentifiers and relatedItems) + ## Metadata 4.7 queries with new field: relationTypeInformation (in relatedIdentifiers and relatedItems) describe "GET /dois/query=...relationTypeInformation", vcr: true, elasticsearch: true do - - let!(:datacite_doi) { create(:doi, client: client, aasm_state: "findable", + let!(:datacite_doi) { create(:doi, client: client, aasm_state: "findable", related_items: [ { "firstPage" => "250", diff --git a/spec/requests/datacite_dois/patch_spec.rb b/spec/requests/datacite_dois/patch_spec.rb index 8641f479a..b3d729cff 100644 --- a/spec/requests/datacite_dois/patch_spec.rb +++ b/spec/requests/datacite_dois/patch_spec.rb @@ -999,7 +999,7 @@ end end - # Metadata 4.7 - elements + ## Metadata 4.7 elements context "when the record exists" do let(:xml) { Base64.strict_encode64(file_fixture("datacite-example-full-v4.7.xml").read) } From 431d4c435b890621a0d7bc517a3f84918c714278 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Thu, 12 Feb 2026 16:29:19 -0500 Subject: [PATCH 27/34] Test memcached update --- .github/workflows/parallel_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/parallel_ci.yml b/.github/workflows/parallel_ci.yml index 0159b3a9f..8851908a6 100644 --- a/.github/workflows/parallel_ci.yml +++ b/.github/workflows/parallel_ci.yml @@ -23,7 +23,7 @@ jobs: services: memcached: - image: memcached:1.4.31 + image: memcached:1.6.22 ports: - 11211 mysql: From 6b79846d4d238d55ecc4c3d3c63cd394ba669ea4 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 18 Feb 2026 09:58:55 -0500 Subject: [PATCH 28/34] Fixes - related to facets/aggregations for resource type general. --- app/models/doi.rb | 6 +++--- app/models/resource_type.rb | 2 ++ config/initializers/constants.rb | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index 3a6fd758c..d9885d4ab 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -711,8 +711,8 @@ def as_indexed_json(_options = {}) end DOI_AGGREGATION_DEFINITIONS = { - # number of resourceTypeGeneral increased from 30 to 32 in schema 4.6 - resource_types: { terms: { field: "resource_type_id_and_name", size: 32, min_doc_count: 1 } }, + # number of resourceTypeGeneral increased from 34 to 34 in schema 4.6 + resource_types: { terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 } }, open_licenses: { filter: { terms: { "rights_list.rightsIdentifier": [ @@ -730,7 +730,7 @@ def as_indexed_json(_options = {}) } }, aggs: { resource_types: { - terms: { field: "resource_type_id_and_name", size: 32, min_doc_count: 1 } + terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 } } } }, diff --git a/app/models/resource_type.rb b/app/models/resource_type.rb index 12112f19f..cb33924b6 100644 --- a/app/models/resource_type.rb +++ b/app/models/resource_type.rb @@ -53,7 +53,9 @@ def self.get_data(_options = {}) { "id" => "output-management-plan", "title" => "OutputManagementPlan" }, { "id" => "peer-review", "title" => "PeerReview" }, { "id" => "physical-object", "title" => "PhysicalObject" }, + { "id" => "poster", "title" => "Poster" }, { "id" => "preprint", "title" => "Preprint" }, + { "id" => "presentation", "title" => "Presentation" }, { "id" => "project", "title" => "Project" }, { "id" => "report", "title" => "Report" }, { "id" => "service", "title" => "Service" }, diff --git a/config/initializers/constants.rb b/config/initializers/constants.rb index 7c4c7d8a8..2e6b86d0f 100644 --- a/config/initializers/constants.rb +++ b/config/initializers/constants.rb @@ -75,7 +75,9 @@ class IdentifierError < RuntimeError; end "OutputManagementPlan" => "Output Management Plan", "PeerReview" => "Peer Review", "PhysicalObject" => "Physical Object", + "Poster" => "Poster", "Preprint" => "Preprint", + "Presentation" => "Presentation", "Project" => "Project", "Report" => "Report", "Service" => "Service", From 748b12d95822d777f7f0f91a0120da0bc853ae45 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 18 Feb 2026 12:25:12 -0500 Subject: [PATCH 29/34] Fixes for aggregates/facets. Reindex required. --- app/models/doi.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index d9885d4ab..57c18da85 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -712,7 +712,13 @@ def as_indexed_json(_options = {}) DOI_AGGREGATION_DEFINITIONS = { # number of resourceTypeGeneral increased from 34 to 34 in schema 4.6 - resource_types: { terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 } }, + resource_types: { terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 }, + aggs: { + resource_types: { + terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 } + } + } + }, open_licenses: { filter: { terms: { "rights_list.rightsIdentifier": [ @@ -727,12 +733,7 @@ def as_indexed_json(_options = {}) "cc0-1.0", "cc-pdm-1.0" ] - } }, - aggs: { - resource_types: { - terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 } - } - } + }} }, states: { terms: { field: "aasm_state", size: 3, min_doc_count: 1 } }, published: { From f2f57f6894140721f18dccd48054c1104f0ff54a Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 18 Feb 2026 12:28:13 -0500 Subject: [PATCH 30/34] Appease rubocop --- app/models/doi.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index 57c18da85..a4a5b66bc 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -712,7 +712,7 @@ def as_indexed_json(_options = {}) DOI_AGGREGATION_DEFINITIONS = { # number of resourceTypeGeneral increased from 34 to 34 in schema 4.6 - resource_types: { terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 }, + resource_types: { terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 }, aggs: { resource_types: { terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 } @@ -733,7 +733,7 @@ def as_indexed_json(_options = {}) "cc0-1.0", "cc-pdm-1.0" ] - }} + } } }, states: { terms: { field: "aasm_state", size: 3, min_doc_count: 1 } }, published: { From 8a415f50eaf763a86a334841a1735499e55a7e75 Mon Sep 17 00:00:00 2001 From: Kelly Stathis Date: Wed, 18 Feb 2026 10:01:53 -0800 Subject: [PATCH 31/34] add 4.7 changes to openapi.yaml --- openapi.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index be1ff9613..73eee2e65 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -687,7 +687,9 @@ paths: - output-management-plan - peer-review - physical-object + - poster - preprint + - presentation - project - report - service @@ -2518,6 +2520,8 @@ components: type: string schemeType: type: string + relationTypeInformation: + type: string relatedItems: description: '[DataCite Metadata Schema: RelatedItem](https://datacite-metadata-schema.readthedocs.io/en/4/properties/relateditem/)' type: array @@ -2541,6 +2545,8 @@ components: type: string schemeType: type: string + relationTypeInformation: + type: string creators: type: array items: @@ -3429,6 +3435,7 @@ components: - Collects - IsTranslationOf - HasTranslation + - Other resourceTypeGeneral: description: '[DataCite Metadata Schema: resourceTypeGeneral](https://datacite-metadata-schema.readthedocs.io/en/4/appendices/appendix-1/resourceTypeGeneral/)' type: string @@ -3454,7 +3461,9 @@ components: - OutputManagementPlan - PeerReview - PhysicalObject + - Poster - Preprint + - Presentation - Project - Report - Service @@ -3511,7 +3520,9 @@ components: - LSID - PMID - PURL + - RAiD - RRID + - SWHID - UPC - URL - URN @@ -3650,6 +3661,7 @@ components: - obsoletes - is-collected-by - collects + - other - is-authored-by - is-authored-at - is-funded-by From 87827871055de00e937406ce3fa897f0023ad156 Mon Sep 17 00:00:00 2001 From: Kelly Stathis Date: Wed, 18 Feb 2026 10:02:20 -0800 Subject: [PATCH 32/34] add changes from 4.6 to relation-type-id in openapi.yaml --- openapi.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 73eee2e65..704e89f3b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -3661,6 +3661,8 @@ components: - obsoletes - is-collected-by - collects + - is-translation-of + - has-translation - other - is-authored-by - is-authored-at From 9ec070abd62c8ee64cf012c66fd8f078bb5cb076 Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Wed, 18 Feb 2026 14:19:47 -0500 Subject: [PATCH 33/34] Fixing the resource_type agg broke the open_licenses agg. I restored open_licenses to what it was before and it seems to work, although it is a little funky since it uses the resource_types agg. --- app/models/doi.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index a4a5b66bc..06980f8ce 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -733,7 +733,12 @@ def as_indexed_json(_options = {}) "cc0-1.0", "cc-pdm-1.0" ] - } } + } }, + aggs: { + resource_types: { + terms: { field: "resource_type_id_and_name", size: 34, min_doc_count: 1 } + } + } }, states: { terms: { field: "aasm_state", size: 3, min_doc_count: 1 } }, published: { From 0c2872649161ea44aa3c20cda383165884c71f5d Mon Sep 17 00:00:00 2001 From: Suzanne Vogt Date: Fri, 20 Feb 2026 14:06:35 -0500 Subject: [PATCH 34/34] Addresses 1 really minor coderrabit review comment. --- spec/requests/datacite_dois/datacite_dois_spec.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/spec/requests/datacite_dois/datacite_dois_spec.rb b/spec/requests/datacite_dois/datacite_dois_spec.rb index f7ff7e9aa..7b2880516 100755 --- a/spec/requests/datacite_dois/datacite_dois_spec.rb +++ b/spec/requests/datacite_dois/datacite_dois_spec.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "pp" - require "rails_helper" include Passwordable