bolognese 2.3.2 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/author_utils.rb +1 -1
- data/lib/bolognese/datacite_utils.rb +2 -2
- data/lib/bolognese/readers/crossref_reader.rb +3 -4
- data/lib/bolognese/version.rb +1 -1
- data/spec/author_utils_spec.rb +5 -5
- data/spec/datacite_utils_spec.rb +42 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/another_book.yml +5 -45
- data/spec/readers/codemeta_reader_spec.rb +1 -1
- data/spec/readers/datacite_reader_spec.rb +7 -7
- data/spec/readers/schema_org_reader_spec.rb +1 -1
- data/spec/writers/citation_writer_spec.rb +1 -1
- data/spec/writers/crosscite_writer_spec.rb +2 -2
- data/spec/writers/datacite_writer_spec.rb +2 -2
- data/spec/writers/schema_org_writer_spec.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b752f8f05f74d5be1c782812a9359ad7957ee6a024799d220dce7133e83da5e5
|
|
4
|
+
data.tar.gz: 9dbfa358d928c646ce329877765867911f78125ba3cf22311dc1955b53914c9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '04985fba7e3b5c1985e767037d6a6d20a87291bc76cfc556cd4a1b76d92f5e5178be593f475c6f406419306f1f69d6c5e948454f8acce2e0b19a493fe3e5c7e0'
|
|
7
|
+
data.tar.gz: eaa39f50bd69319f7218bf5db4759c670612983c0d5b83d1044fb442863aa750c9e3084721614d8e752b262567bc9be753fd9f3996f381c290c8a10de6cabad9
|
data/Gemfile.lock
CHANGED
|
@@ -69,7 +69,7 @@ module Bolognese
|
|
|
69
69
|
|
|
70
70
|
xml.contributors do
|
|
71
71
|
Array.wrap(contributors).each do |con|
|
|
72
|
-
xml.contributor("contributorType" => con["contributorType"]
|
|
72
|
+
xml.contributor("contributorType" => con["contributorType"]) do
|
|
73
73
|
insert_person(xml, con, "contributor")
|
|
74
74
|
end
|
|
75
75
|
end
|
|
@@ -128,7 +128,7 @@ module Bolognese
|
|
|
128
128
|
def insert_resource_type(xml)
|
|
129
129
|
return xml unless types.is_a?(Hash) && (types["schemaOrg"].present? || types["resourceTypeGeneral"])
|
|
130
130
|
|
|
131
|
-
xml.resourceType(types["resourceType"]
|
|
131
|
+
xml.resourceType(types["resourceType"],
|
|
132
132
|
'resourceTypeGeneral' => types["resourceTypeGeneral"] || Metadata::SO_TO_DC_TRANSLATIONS[types["schemaOrg"]] || "Other")
|
|
133
133
|
end
|
|
134
134
|
|
|
@@ -282,18 +282,17 @@ module Bolognese
|
|
|
282
282
|
end
|
|
283
283
|
end.compact
|
|
284
284
|
|
|
285
|
-
contributor_type = CR_TO_DC_CONTRIBUTOR_TYPES[a["contributor_role"]]
|
|
286
|
-
|
|
287
285
|
{ "nameType" => "Personal",
|
|
288
286
|
"nameIdentifiers" => name_identifiers,
|
|
289
287
|
"name" => [family_name, given_name].compact.join(", "),
|
|
290
288
|
"givenName" => given_name,
|
|
291
289
|
"familyName" => family_name,
|
|
292
290
|
"affiliation" => affiliation.presence,
|
|
293
|
-
"contributorType" =>
|
|
291
|
+
"contributorType" => contributor_role == 'author' ? nil : CR_TO_DC_CONTRIBUTOR_TYPES[a["contributor_role"]] }.compact
|
|
294
292
|
else
|
|
295
293
|
{ "nameType" => "Organizational",
|
|
296
|
-
"name" => a["name"] || a["__content__"]
|
|
294
|
+
"name" => a["name"] || a["__content__"],
|
|
295
|
+
"contributorType" => contributor_role == 'author' ? nil : CR_TO_DC_CONTRIBUTOR_TYPES[a["contributor_role"]] }.compact
|
|
297
296
|
end
|
|
298
297
|
end
|
|
299
298
|
end
|
data/lib/bolognese/version.rb
CHANGED
data/spec/author_utils_spec.rb
CHANGED
|
@@ -89,7 +89,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
89
89
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
|
90
90
|
meta = Maremma.from_xml(subject.raw).fetch("resource", {})
|
|
91
91
|
response = subject.get_authors(meta.dig("creators", "creator"))
|
|
92
|
-
expect(response).to eq([{"name" => "Enos, Ryan (Harvard University); Fowler, Anthony (University
|
|
92
|
+
expect(response).to eq([{"name" => "Enos, Ryan (Harvard University); Fowler, Anthony (University of Chicago); Vavreck, Lynn (UCLA)", "nameIdentifiers" => [], "affiliation" => []}])
|
|
93
93
|
end
|
|
94
94
|
|
|
95
95
|
it "hyper-authorship" do
|
|
@@ -104,7 +104,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
104
104
|
it "is organization" do
|
|
105
105
|
author = {"email"=>"info@ucop.edu", "creatorName"=> { "__content__" => "University of California, Santa Barbara", "nameType" => "Organizational" }, "role"=>{"namespace"=>"http://www.ngdc.noaa.gov/metadata/published/xsd/schema/resources/Codelist/gmxCodelists.xml#CI_RoleCode", "roleCode"=>"copyrightHolder"} }
|
|
106
106
|
response = subject.get_one_author(author)
|
|
107
|
-
expect(response).to eq("nameType"=>"Organizational", "name"=>"University
|
|
107
|
+
expect(response).to eq("nameType"=>"Organizational", "name"=>"University of California, Santa Barbara", "nameIdentifiers" => [], "affiliation" => [])
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
it "name with affiliation" do
|
|
@@ -164,13 +164,13 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
164
164
|
input = fixture_path + 'datacite-example-ROR-nameIdentifiers.xml'
|
|
165
165
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
|
166
166
|
expect(subject.creators[2]).to eq("nameType"=>"Organizational", "name"=>"Gump South Pacific Research Station", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/04sk0et52", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[])
|
|
167
|
-
expect(subject.creators[3]).to eq("nameType"=>"Organizational", "name"=>"University
|
|
168
|
-
expect(subject.creators[4]).to eq("nameType"=>"Organizational", "name"=>"University
|
|
167
|
+
expect(subject.creators[3]).to eq("nameType"=>"Organizational", "name"=>"University of Vic", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/006zjws59", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[])
|
|
168
|
+
expect(subject.creators[4]).to eq("nameType"=>"Organizational", "name"=>"University of Kivu", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/01qfhxr31", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[])
|
|
169
169
|
expect(subject.creators[5]).to eq("nameType"=>"Organizational", "name"=>"សាកលវិទ្យាល័យកម្ពុជា", "nameIdentifiers"=> [{"nameIdentifier"=>"http://ror.org/025e3rc84", "nameIdentifierScheme"=>"RORS"}], "affiliation"=>[])
|
|
170
170
|
expect(subject.creators[6]).to eq("nameType"=>"Organizational", "name"=>"جامعة زاخۆ", "nameIdentifiers"=> [{"nameIdentifier"=>"05sd1pz50", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"RORS"}], "affiliation"=>[])
|
|
171
171
|
expect(subject.creators[9]).to eq("nameType"=>"Organizational", "name"=>"Gump South Pacific Research Station", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/04sk0et52", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[])
|
|
172
172
|
expect(subject.contributors.first).to eq("nameType"=>"Organizational", "name"=>" Nawroz University ", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/04gp75d48", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}], "affiliation"=>[], "contributorType"=>"Producer")
|
|
173
|
-
expect(subject.contributors.last).to eq("nameType"=>"Organizational", "name"=>"University
|
|
173
|
+
expect(subject.contributors.last).to eq("nameType"=>"Organizational", "name"=>"University of Greenland (https://www.uni.gl/)", "nameIdentifiers"=> [{"nameIdentifier"=>"https://ror.org/00t5j6b61", "schemeUri"=>"https://ror.org", "nameIdentifierScheme"=>"ROR"}],"affiliation"=>[], "contributorType"=>"Sponsor")
|
|
174
174
|
end
|
|
175
175
|
|
|
176
176
|
context "affiliationIdentifier/nameIdentifier" do
|
data/spec/datacite_utils_spec.rb
CHANGED
|
@@ -249,6 +249,48 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
249
249
|
end
|
|
250
250
|
end
|
|
251
251
|
|
|
252
|
+
context "insert_resource_type when resourceType is available, but using schemaOrg (via SO_TO_DC_TRANSLATIONS) when resourceTypeGeneral is unavailable" do
|
|
253
|
+
it "supports schemaOrg value as resourceTypeGeneral" do
|
|
254
|
+
# Mock the `types` hash to include the necessary values
|
|
255
|
+
subject.instance_variable_set(:@types, {
|
|
256
|
+
"schemaOrg" => "BlogPosting",
|
|
257
|
+
"resourceType" => "This dataset contains all projects funded by the European Union under the fifth framework programme for research and technological development (FP5) from 1998 to 2002."
|
|
258
|
+
})
|
|
259
|
+
|
|
260
|
+
# Generate XML using the insert_resource_type method
|
|
261
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_resource_type(xml) }.to_xml
|
|
262
|
+
|
|
263
|
+
response = Maremma.from_xml(xml)
|
|
264
|
+
|
|
265
|
+
# Expect `Text` in resourceTypeGeneral (via SO_TP_DC_TRANSLATIONS) and `This dataset contains all projects funded...` as the content
|
|
266
|
+
expect(response["resourceType"]).to eq(
|
|
267
|
+
"resourceTypeGeneral" => "Text",
|
|
268
|
+
"__content__" => "This dataset contains all projects funded by the European Union under the fifth framework programme for research and technological development (FP5) from 1998 to 2002."
|
|
269
|
+
)
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
context "insert_resource_type when resourceType is available, 'OTHER' when schemaOrg has no valid translations, and 'resourceTypeGeneral is unavailable" do
|
|
274
|
+
it "supports Other as resourceTypeGeneral" do
|
|
275
|
+
# Mock the `types` hash to include the necessary values
|
|
276
|
+
subject.instance_variable_set(:@types, {
|
|
277
|
+
"schemaOrg" => "Invalid_SO_Value",
|
|
278
|
+
"resourceType" => "This dataset contains all projects funded by the European Union under the fifth framework programme for research and technological development (FP5) from 1998 to 2002."
|
|
279
|
+
})
|
|
280
|
+
|
|
281
|
+
# Generate XML using the insert_resource_type method
|
|
282
|
+
xml = Nokogiri::XML::Builder.new(:encoding => 'UTF-8') { |xml| subject.insert_resource_type(xml) }.to_xml
|
|
283
|
+
|
|
284
|
+
response = Maremma.from_xml(xml)
|
|
285
|
+
|
|
286
|
+
# Expect `Text` in resourceTypeGeneral (via SO_TP_DC_TRANSLATIONS) and `This dataset contains all projects funded...` as the content
|
|
287
|
+
expect(response["resourceType"]).to eq(
|
|
288
|
+
"resourceTypeGeneral" => "Other",
|
|
289
|
+
"__content__" => "This dataset contains all projects funded by the European Union under the fifth framework programme for research and technological development (FP5) from 1998 to 2002."
|
|
290
|
+
)
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
252
294
|
# Test case to insert Coverage DateType (new dateType in DataCite 4.6).
|
|
253
295
|
context "insert_dates with Coverage" do
|
|
254
296
|
it "inserts date with dateType Coverage" do
|
|
@@ -91,48 +91,8 @@ http_interactions:
|
|
|
91
91
|
- close
|
|
92
92
|
body:
|
|
93
93
|
encoding: ASCII-8BIT
|
|
94
|
-
string:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
\ <crm-item name=\"publisher-name\" type=\"string\">International Ocean
|
|
100
|
-
Discovery Program (IODP)</crm-item>\r\n <crm-item name=\"prefix-name\"
|
|
101
|
-
type=\"string\">International Ocean Discovery Program Texas</crm-item>\r\n
|
|
102
|
-
\ <crm-item name=\"member-id\" type=\"number\">1029</crm-item>\r\n <crm-item
|
|
103
|
-
name=\"citation-id\" type=\"number\">23807285</crm-item>\r\n <crm-item
|
|
104
|
-
name=\"book-id\" type=\"number\">284099</crm-item>\r\n <crm-item name=\"series-id\"
|
|
105
|
-
type=\"number\">283327</crm-item>\r\n <crm-item name=\"deposit-timestamp\"
|
|
106
|
-
type=\"number\">20061017201744</crm-item>\r\n <crm-item name=\"owner-prefix\"
|
|
107
|
-
type=\"string\">10.2973</crm-item>\r\n <crm-item name=\"last-update\"
|
|
108
|
-
type=\"date\">2009-02-02T21:19:43Z</crm-item>\r\n <crm-item name=\"created\"
|
|
109
|
-
type=\"date\">2006-10-17T19:50:37Z</crm-item>\r\n <crm-item name=\"citedby-count\"
|
|
110
|
-
type=\"number\">21</crm-item>\r\n <doi_record>\r\n <crossref
|
|
111
|
-
xmlns=\"http://www.crossref.org/xschema/1.0\" xsi:schemaLocation=\"http://www.crossref.org/xschema/1.0
|
|
112
|
-
http://doi.crossref.org/schemas/unixref1.0.xsd\">\r\n <book book_type=\"monograph\">\r\n
|
|
113
|
-
\ <book_metadata language=\"en\">\r\n <contributors>\r\n
|
|
114
|
-
\ <person_name sequence=\"first\" contributor_role=\"editor\">\r\n
|
|
115
|
-
\ <given_name>B.</given_name>\r\n <surname>Taylor</surname>\r\n
|
|
116
|
-
\ </person_name>\r\n <person_name sequence=\"additional\"
|
|
117
|
-
contributor_role=\"editor\">\r\n <given_name>P.</given_name>\r\n
|
|
118
|
-
\ <surname>Huchon</surname>\r\n </person_name>\r\n
|
|
119
|
-
\ <person_name sequence=\"additional\" contributor_role=\"editor\">\r\n
|
|
120
|
-
\ <given_name>A.</given_name>\r\n <surname>Klaus</surname>\r\n
|
|
121
|
-
\ </person_name>\r\n <organization sequence=\"additional\"
|
|
122
|
-
contributor_role=\"editor\">et al.</organization>\r\n </contributors>\r\n
|
|
123
|
-
\ <titles>\r\n <title>Proceedings of the Ocean
|
|
124
|
-
Drilling Program, 180 Initial Reports</title>\r\n </titles>\r\n
|
|
125
|
-
\ <series_metadata>\r\n <titles>\r\n <title>Proceedings
|
|
126
|
-
of the Ocean Drilling Program</title>\r\n </titles>\r\n </series_metadata>\r\n
|
|
127
|
-
\ <volume>180</volume>\r\n <publication_date
|
|
128
|
-
media_type=\"online\">\r\n <month>02</month>\r\n <day>04</day>\r\n
|
|
129
|
-
\ <year>2000</year>\r\n </publication_date>\r\n
|
|
130
|
-
\ <publisher>\r\n <publisher_name>Ocean Drilling
|
|
131
|
-
Program</publisher_name>\r\n </publisher>\r\n <doi_data>\r\n
|
|
132
|
-
\ <doi>10.2973/odp.proc.ir.180.2000</doi>\r\n <resource>http://www-odp.tamu.edu/publications/180_IR/180TOC.HTM</resource>\r\n
|
|
133
|
-
\ </doi_data>\r\n </book_metadata>\r\n </book>\r\n
|
|
134
|
-
\ </crossref>\r\n </doi_record>\r\n </query>\r\n </body>\r\n
|
|
135
|
-
\ </query_result>\r\n</crossref_result>"
|
|
136
|
-
http_version:
|
|
137
|
-
recorded_at: Wed, 09 Jun 2021 12:57:05 GMT
|
|
138
|
-
recorded_with: VCR 3.0.3
|
|
94
|
+
string: !binary |-
|
|
95
|
+
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPGNyb3NzcmVmX3Jlc3VsdCB4bWxucz0iaHR0cDovL3d3dy5jcm9zc3JlZi5vcmcvcXJzY2hlbWEvMy4wIiB2ZXJzaW9uPSIzLjAiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhzaTpzY2hlbWFMb2NhdGlvbj0iaHR0cDovL3d3dy5jcm9zc3JlZi5vcmcvcXJzY2hlbWEvMy4wIGh0dHA6Ly93d3cuY3Jvc3NyZWYub3JnL3NjaGVtYXMvY3Jvc3NyZWZfcXVlcnlfb3V0cHV0My4wLnhzZCI+CiAgPHF1ZXJ5X3Jlc3VsdD4KICAgIDxoZWFkPgogICAgICA8ZG9pX2JhdGNoX2lkPm5vbmU8L2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gICAgICAgICA8c3VybmFtZT5IdWNob248L3N1cm5hbWU+CiAgICAgICAgICAgICAgICAgIDwvcGVyc29uX25hbWU+CiAgICAgICAgICAgICAgICAgIDxwZXJzb25fbmFtZSBzZXF1ZW5jZT0iYWRkaXRpb25hbCIgY29udHJpYnV0b3Jfcm9sZT0iZWRpdG9yIj4KICAgICAgICAgICAgICAgICAgICA8Z2l2ZW5fbmFtZT5BLjwvZ2l2ZW5fbmFtZT4KICAgICAgICAgICAgICAgICAgICA8c3VybmFtZT5LbGF1czwvc3VybmFtZT4KICAgICAgICAgICAgICAgICAgPC9wZXJzb25fbmFtZT4KICAgICAgICAgICAgICAgICAgPG9yZ2FuaXphdGlvbiBzZXF1ZW5jZT0iYWRkaXRpb25hbCIgY29udHJpYnV0b3Jfcm9sZT0iZWRpdG9yIj5ldCBhbC48L29yZ2FuaXphdGlvbj4KICAgICAgICAgICAgICAgIDwvY29udHJpYnV0b3JzPgogICAgICAgICAgICAgICAgPHRpdGxlcz4KICAgICAgICAgICAgICAgICAgPHRpdGxlPlByb2NlZWRpbmdzIG9mIHRoZSBPY2VhbiBEcmlsbGluZyBQcm9ncmFtLCAxODAgSW5pdGlhbCBSZXBvcnRzPC90aXRsZT4KICAgICAgICAgICAgICAgIDwvdGl0bGVzPgogICAgICAgICAgICAgICAgPHNlcmllc19tZXRhZGF0YT4KICAgICAgICAgICAgICAgICAgPHRpdGxlcz4KICAgICAgICAgICAgICAgICAgICA8dGl0bGU+UHJvY2VlZGluZ3Mgb2YgdGhlIE9jZWFuIERyaWxsaW5nIFByb2dyYW08L3RpdGxlPgogICAgICAgICAgICAgICAgICA8L3RpdGxlcz4KICAgICAgICAgICAgICAgIDwvc2VyaWVzX21ldGFkYXRhPgogICAgICAgICAgICAgICAgPHZvbHVtZT4xODA8L3ZvbHVtZT4KICAgICAgICAgICAgICAgIDxwdWJsaWNhdGlvbl9kYXRlIG1lZGlhX3R5cGU9Im9ubGluZSI+CiAgICAgICAgICAgICAgICAgIDxtb250aD4wMjwvbW9udGg+CiAgICAgICAgICAgICAgICAgIDxkYXk+MDQ8L2RheT4KICAgICAgICAgICAgICAgICAgPHllYXI+MjAwMDwveWVhcj4KICAgICAgICAgICAgICAgIDwvcHVibGljYXRpb25fZGF0ZT4KICAgICAgICAgICAgICAgIDxwdWJsaXNoZXI+CiAgICAgICAgICAgICAgICAgIDxwdWJsaXNoZXJfbmFtZT5PY2VhbiBEcmlsbGluZyBQcm9ncmFtPC9wdWJsaXNoZXJfbmFtZT4KICAgICAgICAgICAgICAgIDwvcHVibGlzaGVyPgogICAgICAgICAgICAgICAgPGRvaV9kYXRhPgogICAgICAgICAgICAgICAgIDxkb2k+MTAuMjk3My9vZHAucHJvYy5pci4xODAuMjAwMDwvZG9pPgogICAgICAgICAgICAgICAgICA8cmVzb3VyY2U+aHR0cDovL3d3dy1vZHAudGFtdS5lZHUvcHVibGljYXRpb25zLzE4MF9JUi8xODBUT0MuSFRNPC9yZXNvdXJjZT4KICAgICAgICAgICAgICAgIDwvZG9pX2RhdGE+CiAgICAgICAgICAgICAgPC9ib29rX21ldGFkYXRhPgogICAgICAgICAgICA8L2Jvb2s+CiAgICAgICAgICA8L2Nyb3NzcmVmPgogICAgICAgIDwvZG9pX3JlY29yZD4KICAgICAgPC9xdWVyeT4KICAgIDwvYm9keT4KICA8L3F1ZXJ5X3Jlc3VsdD4KPC9jcm9zc3JlZl9yZXN1bHQ+
|
|
96
|
+
http_version:
|
|
97
|
+
recorded_at: Thu, 29 May 2025 02:56:56 GMT
|
|
98
|
+
recorded_with: VCR 3.0.33
|
|
@@ -67,7 +67,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
67
67
|
"nameIdentifierScheme"=>"ORCID",
|
|
68
68
|
"schemeUri"=>"https://orcid.org"}],
|
|
69
69
|
"nameType"=>"Personal"},
|
|
70
|
-
{"name"=>"University
|
|
70
|
+
{"name"=>"University of California, Santa Barbara",
|
|
71
71
|
"nameType"=>"Organizational",
|
|
72
72
|
"nameIdentifiers" => [], "affiliation" => []}])
|
|
73
73
|
expect(subject.titles).to eq([{"title"=>"R Interface to the DataONE REST API"}])
|
|
@@ -619,7 +619,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
619
619
|
expect(subject.valid?).to be true
|
|
620
620
|
expect(subject.id).to eq("https://doi.org/10.7910/dvn/eqtqyo")
|
|
621
621
|
expect(subject.types["schemaOrg"]).to eq("Dataset")
|
|
622
|
-
expect(subject.creators).to eq([{"name" => "Enos, Ryan (Harvard University); Fowler, Anthony (University
|
|
622
|
+
expect(subject.creators).to eq([{"name" => "Enos, Ryan (Harvard University); Fowler, Anthony (University of Chicago); Vavreck, Lynn (UCLA)", "nameIdentifiers" => [], "affiliation" => []}])
|
|
623
623
|
end
|
|
624
624
|
|
|
625
625
|
it "author with scheme" do
|
|
@@ -935,7 +935,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
935
935
|
expect(subject.types["resourceType"]).to eq("Simulation Tool")
|
|
936
936
|
expect(subject.types["resourceTypeGeneral"]).to eq("Software")
|
|
937
937
|
expect(subject.creators.length).to eq(5)
|
|
938
|
-
expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Patiñ
|
|
938
|
+
expect(subject.creators.first).to eq("nameType"=>"Personal", "name"=>"Patiño, Carlos", "givenName"=>"Carlos", "familyName"=>"Patiño", "nameIdentifiers" => [], "affiliation" => [])
|
|
939
939
|
expect(subject.titles).to eq([{"title"=>"LAMMPS Data-File Generator"}])
|
|
940
940
|
expect(subject.dates).to eq([{"date"=>"2018-07-18", "dateType"=>"Valid"}, {"date"=>"2018-07-18", "dateType"=>"Accepted"}, {"date"=>"2018", "dateType"=>"Issued"}])
|
|
941
941
|
expect(subject.publication_year).to eq("2018")
|
|
@@ -1061,7 +1061,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
1061
1061
|
expect(subject.types["schemaOrg"]).to eq("Dataset")
|
|
1062
1062
|
expect(subject.types["resourceType"]).to eq("Disclosure")
|
|
1063
1063
|
expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
|
|
1064
|
-
expect(subject.creators).to eq([{"name"=>"
|
|
1064
|
+
expect(subject.creators).to eq([{"name"=>"anonymous", "nameIdentifiers" => [], "affiliation" => []}])
|
|
1065
1065
|
expect(subject.titles).to eq([{"title"=>"Messung der Bildunschaerfe in H.264-codierten Bildern und Videosequenzen"}])
|
|
1066
1066
|
expect(subject.dates).to eq([{"date"=>"2017", "dateType"=>"Issued"}])
|
|
1067
1067
|
expect(subject.publication_year).to eq("2017")
|
|
@@ -1085,9 +1085,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
1085
1085
|
"nameIdentifiers"=>
|
|
1086
1086
|
[{"nameIdentifier"=>"https://orcid.org/0000-0002-0077-5338",
|
|
1087
1087
|
"nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
|
|
1088
|
-
"name"=>"Van
|
|
1088
|
+
"name"=>"Van der A, Ronald",
|
|
1089
1089
|
"givenName"=>"Ronald",
|
|
1090
|
-
"familyName"=>"Van
|
|
1090
|
+
"familyName"=>"Van der A",
|
|
1091
1091
|
"affiliation"=>[{"name"=>"Royal Netherlands Meteorological Institute (KNMI)"}]},
|
|
1092
1092
|
{"nameType"=>"Personal",
|
|
1093
1093
|
"name"=>"Allaart, Marc",
|
|
@@ -1164,7 +1164,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
1164
1164
|
expect(subject.types["ris"]).to eq("RPRT")
|
|
1165
1165
|
expect(subject.types["citeproc"]).to eq("article-journal")
|
|
1166
1166
|
expect(subject.creators.length).to eq(5)
|
|
1167
|
-
expect(subject.creators.first).to eq("
|
|
1167
|
+
expect(subject.creators.first).to eq("name"=>"lina patel", "nameIdentifiers" => [], "affiliation" => [])
|
|
1168
1168
|
expect(subject.titles).to eq([{"title"=>"Referee report. For: Gates - add article keywords to the metatags [version 2; referees: 1 approved]"}])
|
|
1169
1169
|
expect(subject.publication_year).to eq("2018")
|
|
1170
1170
|
expect(subject.publisher).to eq({"name"=>"Gates Open Research"})
|
|
@@ -1381,7 +1381,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
1381
1381
|
expect(subject.types["resourceTypeGeneral"]).to eq("Dataset")
|
|
1382
1382
|
expect(subject.types["ris"]).to eq("DATA")
|
|
1383
1383
|
expect(subject.types["citeproc"]).to eq("dataset")
|
|
1384
|
-
expect(subject.creators.first).to eq("familyName"=>"
|
|
1384
|
+
expect(subject.creators.first).to eq("familyName"=>"den Heijer", "givenName"=>"C", "name"=>"den Heijer, C", "nameType"=>"Personal", "nameIdentifiers" => [], "affiliation" => [])
|
|
1385
1385
|
expect(subject.titles).to eq([{"lang"=>"en", "title"=>"Meteo measurements at the Sand Motor"}])
|
|
1386
1386
|
expect(subject.publication_year).to eq("2017")
|
|
1387
1387
|
expect(subject.publisher).to eq({"name"=>"4TU.Centre for Research Data"})
|
|
@@ -131,7 +131,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
131
131
|
expect(subject.types).to eq("bibtex"=>"misc", "citeproc"=>"dataset", "resourceTypeGeneral"=>"Dataset", "ris"=>"DATA", "schemaOrg"=>"Dataset")
|
|
132
132
|
expect(subject.titles).to eq([{"title"=>"Summary data ankylosing spondylitis GWAS"}])
|
|
133
133
|
expect(subject.container).to eq("identifier"=>"https://dataverse.harvard.edu", "identifierType"=>"URL", "title"=>"Harvard Dataverse", "type"=>"DataRepository")
|
|
134
|
-
expect(subject.creators).to eq([{"name" => "International Genetics
|
|
134
|
+
expect(subject.creators).to eq([{"name" => "International Genetics of Ankylosing Spondylitis Consortium (IGAS)", "nameIdentifiers"=>[], "affiliation" => []}])
|
|
135
135
|
expect(subject.subjects).to eq([{"subject"=>"Medicine, Health and Life Sciences"},
|
|
136
136
|
{"subject"=>"Genome-Wide Association Studies"},
|
|
137
137
|
{"subject"=>"Ankylosing spondylitis"}])
|
|
@@ -38,7 +38,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
38
38
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
|
39
39
|
expect(subject.style).to eq("apa")
|
|
40
40
|
expect(subject.locale).to eq("en-US")
|
|
41
|
-
expect(subject.citation).to eq("Lab
|
|
41
|
+
expect(subject.citation).to eq("Lab for Exosphere and Near Space Environment Studies. (2019). <i>lenses-lab/LYAO_RT-2018JA026426: Original Release</i> (Version 1.0.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.2598836")
|
|
42
42
|
end
|
|
43
43
|
|
|
44
44
|
it "interactive resource without dates" do
|
|
@@ -67,7 +67,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
67
67
|
crosscite = JSON.parse(subject.crosscite)
|
|
68
68
|
expect(crosscite["titles"]).to eq([{"title"=>"R Interface to the DataONE REST API"}])
|
|
69
69
|
expect(crosscite["creators"].length).to eq(3)
|
|
70
|
-
expect(crosscite["creators"].last).to eq("nameType" => "Organizational", "name"=>"University
|
|
70
|
+
expect(crosscite["creators"].last).to eq("nameType" => "Organizational", "name"=>"University of California, Santa Barbara", "nameIdentifiers" => [], "affiliation" => [])
|
|
71
71
|
expect(crosscite["version"]).to eq("2.0.0")
|
|
72
72
|
expect(crosscite["publisher"]).to eq({"name"=>"https://cran.r-project.org"})
|
|
73
73
|
end
|
|
@@ -78,7 +78,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
78
78
|
crosscite = JSON.parse(subject.crosscite)
|
|
79
79
|
expect(crosscite["titles"]).to eq([{"title"=>"R Interface to the DataONE REST API"}])
|
|
80
80
|
expect(crosscite["creators"].length).to eq(3)
|
|
81
|
-
expect(crosscite["creators"].last).to eq("nameType" => "Organizational", "name"=>"University
|
|
81
|
+
expect(crosscite["creators"].last).to eq("nameType" => "Organizational", "name"=>"University of California, Santa Barbara", "nameIdentifiers" => [], "affiliation" => [])
|
|
82
82
|
expect(crosscite["version"]).to eq("2.0.0")
|
|
83
83
|
expect(crosscite["publisher"]).to eq({"name"=>"https://cran.r-project.org"})
|
|
84
84
|
end
|
|
@@ -91,7 +91,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
91
91
|
{"nameIdentifierScheme"=>"ORCID",
|
|
92
92
|
"schemeURI"=>"https://orcid.org",
|
|
93
93
|
"__content__"=>"https://orcid.org/0000-0002-2192-403X"}},
|
|
94
|
-
{"creatorName"=>{"__content__"=>"University
|
|
94
|
+
{"creatorName"=>{"__content__"=>"University of California, Santa Barbara", "nameType"=>"Organizational"}}])
|
|
95
95
|
expect(datacite.fetch("version")).to eq("2.0.0")
|
|
96
96
|
expect(datacite.dig("publisher")).to eq("https://cran.r-project.org")
|
|
97
97
|
end
|
|
@@ -116,7 +116,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
116
116
|
{"nameIdentifierScheme"=>"ORCID",
|
|
117
117
|
"schemeURI"=>"https://orcid.org",
|
|
118
118
|
"__content__"=>"https://orcid.org/0000-0002-2192-403X"}},
|
|
119
|
-
{"creatorName"=>{"__content__"=>"University
|
|
119
|
+
{"creatorName"=>{"__content__"=>"University of California, Santa Barbara", "nameType"=>"Organizational"}}])
|
|
120
120
|
expect(datacite.fetch("version")).to eq("2.0.0")
|
|
121
121
|
expect(datacite.dig("publisher")).to eq("https://cran.r-project.org")
|
|
122
122
|
end
|
|
@@ -94,7 +94,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
94
94
|
"@type"=>"Person",
|
|
95
95
|
"@id"=>"https://orcid.org/0000-0002-2192-403X",
|
|
96
96
|
"affiliation"=>{"@type"=>"Organization", "name"=>"NCEAS"}},
|
|
97
|
-
{"name"=>"University
|
|
97
|
+
{"name"=>"University of California, Santa Barbara", "@type"=>"Organization"}])
|
|
98
98
|
expect(json["version"]).to eq("2.0.0")
|
|
99
99
|
expect(json["keywords"]).to eq("data sharing, data repository, DataONE")
|
|
100
100
|
end
|
|
@@ -279,7 +279,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
279
279
|
expect(json["@id"]).to eq("https://doi.org/10.5072/example-polygon")
|
|
280
280
|
expect(json["@type"]).to eq("Dataset")
|
|
281
281
|
expect(json["name"]).to eq("Meteo measurements at the Sand Motor")
|
|
282
|
-
expect(json["author"]).to eq("@type"=>"Person", "familyName"=>"
|
|
282
|
+
expect(json["author"]).to eq("@type"=>"Person", "familyName"=>"den Heijer", "givenName"=>"C", "name"=>"C den Heijer")
|
|
283
283
|
expect(json["includedInDataCatalog"]).to be_nil
|
|
284
284
|
expect(json["spatialCoverage"].dig("geo", "polygon").length).to eq(34)
|
|
285
285
|
expect(json["spatialCoverage"].dig("geo", "polygon")[0].first).to eq(["4.1738852605822", "52.03913926329928"])
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bolognese
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.3.
|
|
4
|
+
version: 2.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Martin Fenner
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2025-06-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: maremma
|
|
@@ -1330,7 +1330,7 @@ homepage: https://github.com/datacite/bolognese
|
|
|
1330
1330
|
licenses:
|
|
1331
1331
|
- MIT
|
|
1332
1332
|
metadata: {}
|
|
1333
|
-
post_install_message:
|
|
1333
|
+
post_install_message:
|
|
1334
1334
|
rdoc_options: []
|
|
1335
1335
|
require_paths:
|
|
1336
1336
|
- lib
|
|
@@ -1346,7 +1346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1346
1346
|
version: '0'
|
|
1347
1347
|
requirements: []
|
|
1348
1348
|
rubygems_version: 3.3.26
|
|
1349
|
-
signing_key:
|
|
1349
|
+
signing_key:
|
|
1350
1350
|
specification_version: 4
|
|
1351
1351
|
summary: Ruby client library for conversion of DOI Metadata
|
|
1352
1352
|
test_files: []
|