bolognese 1.10.0 → 2.3.2
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/.github/workflows/build.yml +0 -14
- data/.github/workflows/ci.yml +1 -1
- data/.github/workflows/release.yml +2 -12
- data/CHANGELOG.md +2 -2
- data/Gemfile.lock +69 -53
- data/bolognese.gemspec +6 -4
- data/lib/bolognese/author_utils.rb +17 -4
- data/lib/bolognese/datacite_utils.rb +18 -10
- data/lib/bolognese/metadata.rb +1 -1
- data/lib/bolognese/metadata_utils.rb +3 -2
- data/lib/bolognese/readers/bibtex_reader.rb +2 -2
- data/lib/bolognese/readers/citeproc_reader.rb +7 -1
- data/lib/bolognese/readers/codemeta_reader.rb +2 -2
- data/lib/bolognese/readers/crosscite_reader.rb +4 -1
- data/lib/bolognese/readers/crossref_reader.rb +40 -7
- data/lib/bolognese/readers/datacite_json_reader.rb +4 -1
- data/lib/bolognese/readers/datacite_reader.rb +25 -9
- data/lib/bolognese/readers/npm_reader.rb +1 -1
- data/lib/bolognese/readers/ris_reader.rb +2 -2
- data/lib/bolognese/readers/schema_org_reader.rb +27 -4
- data/lib/bolognese/utils.rb +36 -14
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/bibtex_writer.rb +1 -1
- data/lib/bolognese/writers/codemeta_writer.rb +1 -1
- data/lib/bolognese/writers/csv_writer.rb +1 -1
- data/lib/bolognese/writers/datacite_json_writer.rb +3 -1
- data/lib/bolognese/writers/jats_writer.rb +6 -3
- data/lib/bolognese/writers/ris_writer.rb +2 -2
- data/lib/bolognese/writers/schema_org_writer.rb +6 -2
- data/resources/kernel-4/include/datacite-contributorType-v4.xsd +3 -1
- data/resources/kernel-4/include/datacite-dateType-v4.xsd +3 -1
- data/resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd +5 -2
- data/resources/kernel-4/include/datacite-relationType-v4.xsd +9 -3
- data/resources/kernel-4/include/datacite-resourceType-v4.xsd +7 -1
- data/resources/kernel-4/include/datacite-titleType-v4.xsd +1 -1
- data/resources/kernel-4/metadata.xsd +12 -7
- data/resources/kernel-4.5/include/datacite-contributorType-v4.xsd +35 -0
- data/resources/kernel-4.5/include/datacite-dateType-v4.xsd +25 -0
- data/resources/kernel-4.5/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.5/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4.5/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.5/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4.5/include/datacite-relatedIdentifierType-v4.xsd +34 -0
- data/resources/kernel-4.5/include/datacite-relationType-v4.xsd +53 -0
- data/resources/kernel-4.5/include/datacite-resourceType-v4.xsd +45 -0
- data/resources/kernel-4.5/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.5/include/xml.xsd +286 -0
- data/resources/kernel-4.5/metadata.xsd +711 -0
- data/resources/kernel-4.6/include/datacite-contributorType-v4.xsd +37 -0
- data/resources/kernel-4.6/include/datacite-dateType-v4.xsd +27 -0
- data/resources/kernel-4.6/include/datacite-descriptionType-v4.xsd +19 -0
- data/resources/kernel-4.6/include/datacite-funderIdentifierType-v4.xsd +16 -0
- data/resources/kernel-4.6/include/datacite-nameType-v4.xsd +10 -0
- data/resources/kernel-4.6/include/datacite-numberType-v4.xsd +12 -0
- data/resources/kernel-4.6/include/datacite-relatedIdentifierType-v4.xsd +37 -0
- data/resources/kernel-4.6/include/datacite-relationType-v4.xsd +57 -0
- data/resources/kernel-4.6/include/datacite-resourceType-v4.xsd +49 -0
- data/resources/kernel-4.6/include/datacite-titleType-v4.xsd +14 -0
- data/resources/kernel-4.6/include/xml.xsd +286 -0
- data/resources/kernel-4.6/metadata.xsd +712 -0
- data/spec/author_utils_spec.rb +59 -6
- data/spec/datacite_utils_spec.rb +114 -2
- data/spec/fixtures/citeproc.json +7 -1
- data/spec/fixtures/crossref_schema_4.6_values.xml +183 -0
- data/spec/fixtures/datacite-example-ROR-nameIdentifiers.xml +24 -1
- data/spec/fixtures/datacite-example-full-v4.5.xml +255 -0
- data/spec/fixtures/datacite-example-full-v4.6.xml +114 -0
- data/spec/fixtures/datacite-example-relateditems-with-attributes.xml +61 -0
- data/spec/fixtures/datacite-seriesinformation.xml +7 -2
- data/spec/fixtures/datacite-xml-lang.xml +1 -1
- data/spec/fixtures/datacite.json +9 -3
- data/spec/fixtures/datacite_blank_name_identifier.xml +22 -0
- data/spec/fixtures/datacite_blank_publisher.xml +18 -0
- data/spec/fixtures/datacite_journal_article.xml +64 -0
- data/spec/fixtures/schema_org.json +1 -0
- data/spec/fixtures/schema_org_4.6_attributes.json +108 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_contributors_Translator/supports_Translator_contributorType.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_dates_with_Coverage/inserts_date_with_dateType_Coverage.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers_CSTR/supports_CSTR_relatedIdentifierType.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers_HasTranslation/supports_HasTranslation_relationType.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_identifiers_RRID/supports_RRID_relatedIdentifierType.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type_with_Award/supports_Award_as_resourceTypeGeneral.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_resource_type_with_Project/supports_Project_as_resourceTypeGeneral.yml +71 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml +32 -14
- data/spec/readers/bibtex_reader_spec.rb +2 -0
- data/spec/readers/citeproc_reader_spec.rb +4 -0
- data/spec/readers/codemeta_reader_spec.rb +4 -4
- data/spec/readers/crosscite_reader_spec.rb +2 -0
- data/spec/readers/crossref_reader_spec.rb +72 -41
- data/spec/readers/datacite_json_reader_spec.rb +2 -0
- data/spec/readers/datacite_reader_spec.rb +209 -44
- data/spec/readers/npm_reader_spec.rb +2 -0
- data/spec/readers/ris_reader_spec.rb +3 -0
- data/spec/readers/schema_org_reader_spec.rb +38 -11
- data/spec/spec_helper.rb +1 -0
- data/spec/writers/citation_writer_spec.rb +9 -0
- data/spec/writers/citeproc_writer_spec.rb +9 -0
- data/spec/writers/crosscite_writer_spec.rb +7 -0
- data/spec/writers/datacite_json_writer_spec.rb +22 -0
- data/spec/writers/datacite_writer_spec.rb +155 -5
- data/spec/writers/jats_writer_spec.rb +16 -1
- data/spec/writers/rdf_xml_writer_spec.rb +7 -0
- data/spec/writers/schema_org_writer_spec.rb +49 -0
- data/spec/writers/turtle_writer_spec.rb +18 -0
- metadata +81 -34
|
@@ -31,7 +31,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
31
31
|
expect(subject.publication_year).to eq("2016")
|
|
32
32
|
expect(subject.related_identifiers.length).to eq(3)
|
|
33
33
|
expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5438/55e5-t5c0", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
|
|
34
|
-
expect(subject.publisher).to eq("DataCite")
|
|
34
|
+
expect(subject.publisher).to eq({"name"=>"DataCite"})
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
it "BlogPosting with new DOI" do
|
|
@@ -59,7 +59,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
59
59
|
expect(subject.publication_year).to eq("2016")
|
|
60
60
|
expect(subject.related_identifiers.length).to eq(3)
|
|
61
61
|
expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5438/55e5-t5c0", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
|
|
62
|
-
expect(subject.publisher).to eq("DataCite")
|
|
62
|
+
expect(subject.publisher).to eq({"name"=>"DataCite"})
|
|
63
63
|
end
|
|
64
64
|
|
|
65
65
|
it "zenodo" do
|
|
@@ -104,7 +104,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
104
104
|
expect(subject.titles).to eq([{"title"=>"Hydrological and meteorological investigations in a lake near Kangerlussuaq, west Greenland"}])
|
|
105
105
|
expect(subject.creators.size).to eq(8)
|
|
106
106
|
expect(subject.creators.first).to eq("nameType" => "Personal", "name"=>"Johansson, Emma", "givenName"=>"Emma", "familyName"=>"Johansson")
|
|
107
|
-
expect(subject.publisher).to eq("PANGAEA")
|
|
107
|
+
expect(subject.publisher).to eq({"name"=>"PANGAEA"})
|
|
108
108
|
expect(subject.publication_year).to eq("2014")
|
|
109
109
|
end
|
|
110
110
|
|
|
@@ -169,7 +169,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
169
169
|
expect(subject.publication_year).to eq("2016")
|
|
170
170
|
expect(subject.related_identifiers.length).to eq(3)
|
|
171
171
|
expect(subject.related_identifiers.last).to eq("relatedIdentifier"=>"10.5438/55e5-t5c0", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
|
|
172
|
-
expect(subject.publisher).to eq("DataCite")
|
|
172
|
+
expect(subject.publisher).to eq({"name"=>"DataCite", "publisherIdentifier"=>"https://ror.org/04wxnsj81"})
|
|
173
173
|
end
|
|
174
174
|
|
|
175
175
|
it "GTEx dataset" do
|
|
@@ -189,7 +189,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
189
189
|
expect(subject.dates).to eq([{"date"=>"2017", "dateType"=>"Issued"}])
|
|
190
190
|
expect(subject.publication_year).to eq("2017")
|
|
191
191
|
expect(subject.container).to eq("title"=>"GTEx", "type"=>"DataRepository")
|
|
192
|
-
expect(subject.publisher).to eq("GTEx")
|
|
192
|
+
expect(subject.publisher).to eq({"name"=>"GTEx"})
|
|
193
193
|
expect(subject.funding_references.length).to eq(7)
|
|
194
194
|
expect(subject.funding_references.first).to eq("funderIdentifier"=>"https://doi.org/10.13039/100000052", "funderIdentifierType"=>"Crossref Funder ID", "funderName"=>"Common Fund of the Office of the Director of the NIH")
|
|
195
195
|
end
|
|
@@ -209,7 +209,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
209
209
|
expect(subject.subjects).to eq([{"subject"=>"topmed"}, {"subject"=>"whole genome sequencing"}])
|
|
210
210
|
expect(subject.dates).to eq([{"date"=>"2017-11-30", "dateType"=>"Issued"}])
|
|
211
211
|
expect(subject.publication_year).to eq("2017")
|
|
212
|
-
expect(subject.publisher).to eq("TOPMed")
|
|
212
|
+
expect(subject.publisher).to eq({"name"=>"TOPMed"})
|
|
213
213
|
expect(subject.related_identifiers).to eq([{"relatedIdentifier"=>"10.23725/2g4s-qv04", "relatedIdentifierType"=>"DOI", "relationType"=>"References", "resourceTypeGeneral"=>"Dataset"}])
|
|
214
214
|
expect(subject.funding_references).to eq([{"funderIdentifier"=>"https://doi.org/10.13039/100000050", "funderIdentifierType"=>"Crossref Funder ID", "funderName"=>"National Heart, Lung, and Blood Institute (NHLBI)"}])
|
|
215
215
|
end
|
|
@@ -240,7 +240,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
240
240
|
{"subject"=>"Sierra (mountain range)"}])
|
|
241
241
|
expect(subject.dates).to eq([{"date"=>"2013", "dateType"=>"Issued"}, {"date"=>"2014-10-17", "dateType"=>"Updated"}])
|
|
242
242
|
expect(subject.publication_year).to eq("2013")
|
|
243
|
-
expect(subject.publisher).to eq("UC Merced")
|
|
243
|
+
expect(subject.publisher).to eq({"name"=>"UC Merced"})
|
|
244
244
|
expect(subject.funding_references).to eq([{"funderName"=>"National Science Foundation, Division of Earth Sciences, Critical Zone Observatories"}])
|
|
245
245
|
expect(subject.geo_locations).to eq([{"geoLocationPlace"=>"Providence Creek (Lower, Upper and P301)", "geoLocationPoint"=>{"pointLatitude"=>"37.047756", "pointLongitude"=>"-119.221094"}}])
|
|
246
246
|
end
|
|
@@ -258,7 +258,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
258
258
|
expect(subject.titles).to eq([{"title"=>"Registry of all stations from the Tara Oceans Expedition (2009-2013)"}])
|
|
259
259
|
expect(subject.dates).to eq([{"date"=>"2015-02-03", "dateType"=>"Issued"}])
|
|
260
260
|
expect(subject.publication_year).to eq("2015")
|
|
261
|
-
expect(subject.publisher).to eq("PANGAEA")
|
|
261
|
+
expect(subject.publisher).to eq({"name"=>"PANGAEA"})
|
|
262
262
|
expect(subject.geo_locations).to eq([{"geoLocationBox"=>{"eastBoundLongitude"=>"174.9006", "northBoundLatitude"=>"79.6753", "southBoundLatitude"=>"-64.3088", "westBoundLongitude"=>"-168.5182"}}])
|
|
263
263
|
end
|
|
264
264
|
|
|
@@ -280,7 +280,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
280
280
|
expect(subject.subjects).to eq([{"subject"=>"topmed"}, {"subject"=>"whole genome sequencing"}])
|
|
281
281
|
expect(subject.dates).to eq([{"date"=>"2017-11-30", "dateType"=>"Issued"}])
|
|
282
282
|
expect(subject.publication_year).to eq("2017")
|
|
283
|
-
expect(subject.publisher).to eq("TOPMed")
|
|
283
|
+
expect(subject.publisher).to eq({"name"=>"TOPMed"})
|
|
284
284
|
expect(subject.funding_references).to eq([{"funderIdentifier"=>"https://doi.org/10.13039/100000050", "funderIdentifierType"=>"Crossref Funder ID", "funderName"=>"National Heart, Lung, and Blood Institute (NHLBI)"}])
|
|
285
285
|
end
|
|
286
286
|
|
|
@@ -299,7 +299,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
299
299
|
expect(subject.dates).to eq([{"date"=>"2019-01-09", "dateType"=>"Issued"}, {"date"=>"2019-01-09", "dateType"=>"Created"}, {"date"=>"2019-01-09", "dateType"=>"Updated"}])
|
|
300
300
|
expect(subject.publication_year).to eq("2019")
|
|
301
301
|
expect(subject.id).to eq("https://doi.org/10.23698/aida/drov")
|
|
302
|
-
expect(subject.publisher).to eq("AIDA")
|
|
302
|
+
expect(subject.publisher).to eq({"name"=>"AIDA"})
|
|
303
303
|
expect(subject.rights_list).to eq([{"rights"=>"Restricted access", "rightsUri"=>"https://datasets.aida.medtech4health.se/10.23698/aida/drov#license"}])
|
|
304
304
|
expect(subject.id).to eq("https://doi.org/10.23698/aida/drov")
|
|
305
305
|
end
|
|
@@ -332,7 +332,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
332
332
|
expect(subject.descriptions.first["description"]).to start_with("The dataset contains a sample of metadata describing papers")
|
|
333
333
|
expect(subject.dates).to eq([{"date"=>"2013-04-03", "dateType"=>"Issued"}])
|
|
334
334
|
expect(subject.publication_year).to eq("2013")
|
|
335
|
-
expect(subject.publisher).to eq("Zenodo")
|
|
335
|
+
expect(subject.publisher).to eq({"name"=>"Zenodo"})
|
|
336
336
|
expect(subject.funding_references).to eq([{"awardNumber"=>"246686",
|
|
337
337
|
"awardTitle"=>"Open Access Infrastructure for Research in Europe",
|
|
338
338
|
"awardUri"=>"info:eu-repo/grantAgreement/EC/FP7/246686/",
|
|
@@ -340,5 +340,32 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
340
340
|
"funderIdentifierType"=>"Crossref Funder ID",
|
|
341
341
|
"funderName"=>"European Commission"}])
|
|
342
342
|
end
|
|
343
|
+
|
|
344
|
+
it "Schema 4.6 attributes" do
|
|
345
|
+
input = fixture_path + 'schema_org_4.6_attributes.json'
|
|
346
|
+
subject = Bolognese::Metadata.new(input: input)
|
|
347
|
+
|
|
348
|
+
expect(subject.related_identifiers).to eq(
|
|
349
|
+
[
|
|
350
|
+
{"relatedIdentifier"=>"10.1234/translated-version", "relatedIdentifierType"=>"DOI", "relationType"=>"HasTranslation"},
|
|
351
|
+
{"relatedIdentifier"=>"10.1234/other-version", "relatedIdentifierType"=>"DOI", "relationType"=>"IsTranslationOf"},
|
|
352
|
+
]
|
|
353
|
+
)
|
|
354
|
+
expect(subject.dates).to eq(
|
|
355
|
+
[
|
|
356
|
+
{"date"=>"2023-01-01", "dateType"=>"Issued"},
|
|
357
|
+
{"date"=>"2023-01-01", "dateType"=>"Created"},
|
|
358
|
+
{"date"=>"2023-01-01", "dateType"=>"Updated"},
|
|
359
|
+
{"date"=>"2020-01-01", "dateType"=>"Coverage"}
|
|
360
|
+
]
|
|
361
|
+
)
|
|
362
|
+
expect(subject.contributors).to eq(
|
|
363
|
+
[
|
|
364
|
+
{"name"=>"Doe, Jane", "givenName"=>"Jane", "familyName"=>"Doe", "nameType"=>"Personal", "affiliation"=>[{"name"=>"ExampleAffiliation", "affiliationIdentifier"=>"https://ror.org/04wxnsj81", "affiliationIdentifierScheme"=>"ROR"}], "nameIdentifiers"=>[{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}]},
|
|
365
|
+
{"name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith", "nameType"=>"Personal", "affiliation"=>[{"name"=>"ExampleAffiliation", "affiliationIdentifier"=>"https://ror.org/04wxnsj81", "affiliationIdentifierScheme"=>"ROR"}]},
|
|
366
|
+
{"name"=>"Ross, Cody", "givenName"=>"Cody", "familyName"=>"Ross", "nameType"=>"Personal", "affiliation"=>[{"name"=>"ExampleAffiliation", "affiliationIdentifier"=>"https://ror.org/04wxnsj81", "affiliationIdentifierScheme"=>"ROR"}], "nameIdentifiers"=>[{"nameIdentifier"=>"https://orcid.org/0000-0003-1419-2405", "schemeUri"=>"https://orcid.org", "nameIdentifierScheme"=>"ORCID"}], "contributorType"=>"Translator"},
|
|
367
|
+
]
|
|
368
|
+
)
|
|
369
|
+
end
|
|
343
370
|
end
|
|
344
371
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -48,5 +48,14 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
48
48
|
expect(subject.locale).to eq("en-US")
|
|
49
49
|
expect(subject.citation).to eq("Clark, D. (2019). <i>Exploring the \"Many analysts, one dataset\" project from COS</i>. Gigantum, Inc. https://doi.org/10.34747/g6yb-3412")
|
|
50
50
|
end
|
|
51
|
+
|
|
52
|
+
it "journal article with container title" do
|
|
53
|
+
input = fixture_path + "datacite_journal_article.xml"
|
|
54
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
|
55
|
+
expect(subject.types["citeproc"]).to eq("article-journal")
|
|
56
|
+
expect(subject.style).to eq("apa")
|
|
57
|
+
expect(subject.locale).to eq("en-US")
|
|
58
|
+
expect(subject.citation).to eq('Feldman, H. L. (1995). Science and Uncertainty in Mass Exposure Litigation. <i>Texas Law Review</i>. https://doi.org/10.60843/5egy-vc42')
|
|
59
|
+
end
|
|
51
60
|
end
|
|
52
61
|
end
|
|
@@ -286,5 +286,14 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
286
286
|
expect(json["DOI"]).to eq("10.34747/g6yb-3412")
|
|
287
287
|
expect(json["issued"]).to eq("date-parts"=>[[2019]])
|
|
288
288
|
end
|
|
289
|
+
|
|
290
|
+
it "from Schema 4.6 with Translator contributor" do
|
|
291
|
+
input = fixture_path + 'datacite-example-full-v4.6.xml'
|
|
292
|
+
subject = Bolognese::Metadata.new(input: input)
|
|
293
|
+
json = JSON.parse(subject.citeproc)
|
|
294
|
+
expect(json["translator"]).to eq([
|
|
295
|
+
{"family"=>"Doe", "given"=>"Jane"},
|
|
296
|
+
])
|
|
297
|
+
end
|
|
289
298
|
end
|
|
290
299
|
end
|
|
@@ -46,6 +46,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
46
46
|
expect(crosscite.dig("descriptions", 0, "description")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
|
47
47
|
expect(crosscite.fetch("creators").count).to eq(5)
|
|
48
48
|
expect(crosscite.fetch("creators").first).to eq("nameType"=>"Personal", "name"=>"Sankar, Martial", "givenName"=>"Martial", "familyName"=>"Sankar")
|
|
49
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"{eLife} Sciences Organisation, Ltd."})
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
it "BlogPosting Citeproc JSON" do
|
|
@@ -57,6 +58,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
57
58
|
expect(crosscite.fetch("titles")).to eq([{"title"=>"Eating your own Dog Food"}])
|
|
58
59
|
expect(crosscite.dig("descriptions", 0, "description")).to start_with("Eating your own dog food")
|
|
59
60
|
expect(crosscite.fetch("creators")).to eq([{"familyName"=>"Fenner", "givenName"=>"Martin", "name"=>"Fenner, Martin"}])
|
|
61
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
60
62
|
end
|
|
61
63
|
|
|
62
64
|
it "rdataone" do
|
|
@@ -67,6 +69,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
67
69
|
expect(crosscite["creators"].length).to eq(3)
|
|
68
70
|
expect(crosscite["creators"].last).to eq("nameType" => "Organizational", "name"=>"University Of California, Santa Barbara", "nameIdentifiers" => [], "affiliation" => [])
|
|
69
71
|
expect(crosscite["version"]).to eq("2.0.0")
|
|
72
|
+
expect(crosscite["publisher"]).to eq({"name"=>"https://cran.r-project.org"})
|
|
70
73
|
end
|
|
71
74
|
|
|
72
75
|
it "rdataone codemeta v2" do
|
|
@@ -77,6 +80,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
77
80
|
expect(crosscite["creators"].length).to eq(3)
|
|
78
81
|
expect(crosscite["creators"].last).to eq("nameType" => "Organizational", "name"=>"University Of California, Santa Barbara", "nameIdentifiers" => [], "affiliation" => [])
|
|
79
82
|
expect(crosscite["version"]).to eq("2.0.0")
|
|
83
|
+
expect(crosscite["publisher"]).to eq({"name"=>"https://cran.r-project.org"})
|
|
80
84
|
end
|
|
81
85
|
|
|
82
86
|
it "datacite database attributes" do
|
|
@@ -91,6 +95,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
91
95
|
expect(crosscite.fetch("publication_year")).to eq("2011")
|
|
92
96
|
expect(crosscite.fetch("provider_id")).to eq("dryad")
|
|
93
97
|
expect(crosscite.fetch("client_id")).to eq("dryad.dryad")
|
|
98
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"Dryad"})
|
|
94
99
|
end
|
|
95
100
|
|
|
96
101
|
it "maremma" do
|
|
@@ -106,6 +111,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
106
111
|
[{"nameIdentifier"=>"https://orcid.org/0000-0003-0077-4738",
|
|
107
112
|
"nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
|
|
108
113
|
"nameType"=>"Personal"}])
|
|
114
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
109
115
|
end
|
|
110
116
|
|
|
111
117
|
it "with data citation schema.org" do
|
|
@@ -117,6 +123,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
117
123
|
expect(crosscite.fetch("related_identifiers").count).to eq(3)
|
|
118
124
|
expect(crosscite.fetch("related_identifiers").first).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Text")
|
|
119
125
|
expect(crosscite.fetch("related_identifiers").last).to eq("relatedIdentifier"=>"10.5438/55e5-t5c0", "relatedIdentifierType"=>"DOI", "relationType"=>"References")
|
|
126
|
+
expect(crosscite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
120
127
|
end
|
|
121
128
|
end
|
|
122
129
|
end
|
|
@@ -18,6 +18,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
18
18
|
"rightsIdentifierScheme"=>"SPDX",
|
|
19
19
|
"rightsUri"=>"https://creativecommons.org/licenses/by/3.0/legalcode",
|
|
20
20
|
"schemeUri"=>"https://spdx.org/licenses/"}])
|
|
21
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"eLife Sciences Publications, Ltd"})
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
it "with ORCID ID" do
|
|
@@ -28,6 +29,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
28
29
|
expect(datacite.fetch("types")).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"JournalArticle", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
|
|
29
30
|
expect(datacite.fetch("creators").length).to eq(7)
|
|
30
31
|
expect(datacite.fetch("creators").first).to eq("nameType"=>"Personal", "name"=>"Thanassi, Wendy", "givenName"=>"Wendy", "familyName"=>"Thanassi", "affiliation" => [{"name"=>"Department of Medicine, Veterans Affairs Palo Alto Health Care System, 3801 Miranda Avenue MC-, Palo Alto, CA 94304-1207, USA"}, {"name"=>"Occupational Health Strategic Health Care Group, Office of Public Health, Veterans Health Administration, Washington, DC 20006, USA"}, {"name"=>"Division of Emergency Medicine, Stanford University School of Medicine, Stanford, CA 94304, USA"}, {"name"=>"War Related Illness and Injury Study Center (WRIISC) and Mental Illness Research Education and Clinical Center (MIRECC), Department of Veterans Affairs, Palo Alto, CA 94304, USA"}])
|
|
32
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"Hindawi Limited"})
|
|
31
33
|
end
|
|
32
34
|
|
|
33
35
|
it "Crossref DOI" do
|
|
@@ -39,6 +41,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
39
41
|
expect(datacite.dig("descriptions", 0, "description")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
|
40
42
|
expect(datacite.fetch("creators").length).to eq(5)
|
|
41
43
|
expect(datacite.fetch("creators").first).to eq("nameType"=>"Personal", "name"=>"Sankar, Martial", "givenName"=>"Martial", "familyName"=>"Sankar")
|
|
44
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"{eLife} Sciences Organisation, Ltd."})
|
|
42
45
|
end
|
|
43
46
|
|
|
44
47
|
it "BlogPosting Citeproc JSON" do
|
|
@@ -49,6 +52,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
49
52
|
expect(datacite.fetch("titles")).to eq([{"title"=>"Eating your own Dog Food"}])
|
|
50
53
|
expect(datacite.dig("descriptions", 0, "description")).to start_with("Eating your own dog food")
|
|
51
54
|
expect(datacite.fetch("creators")).to eq([{"familyName"=>"Fenner", "givenName"=>"Martin", "name"=>"Fenner, Martin"}])
|
|
55
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
52
56
|
end
|
|
53
57
|
|
|
54
58
|
it "rdataone" do
|
|
@@ -60,6 +64,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
60
64
|
expect(datacite.fetch("creators").first).to eq("affiliation"=>[{"name"=>"NCEAS"}], "nameType"=>"Personal", "name" => "Jones, Matt",
|
|
61
65
|
"nameIdentifiers" => [{"nameIdentifier"=>"https://orcid.org/0000-0003-0077-4738", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "givenName"=>"Matt", "familyName"=>"Jones")
|
|
62
66
|
expect(datacite.fetch("version")).to eq("2.0.0")
|
|
67
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"https://cran.r-project.org"})
|
|
63
68
|
end
|
|
64
69
|
|
|
65
70
|
it "maremma" do
|
|
@@ -75,6 +80,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
75
80
|
[{"nameIdentifier"=>"https://orcid.org/0000-0003-0077-4738",
|
|
76
81
|
"nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}],
|
|
77
82
|
"nameType"=>"Personal"}])
|
|
83
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
78
84
|
end
|
|
79
85
|
|
|
80
86
|
it "with data citation schema.org" do
|
|
@@ -85,6 +91,22 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
85
91
|
expect(datacite.fetch("titles")).to eq([{"title"=>"Eating your own Dog Food"}])
|
|
86
92
|
expect(datacite.fetch("relatedIdentifiers").count).to eq(3)
|
|
87
93
|
expect(datacite.fetch("relatedIdentifiers").first).to eq("relatedIdentifier"=>"10.5438/0000-00ss", "relatedIdentifierType"=>"DOI", "relationType"=>"IsPartOf", "resourceTypeGeneral"=>"Text")
|
|
94
|
+
expect(datacite.fetch("publisher")).to eq({"name"=>"DataCite"})
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
it "DataCite DOI with Schema 4.5 publisher attributes" do
|
|
98
|
+
input = fixture_path + "datacite-example-full-v4.5.xml"
|
|
99
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
|
100
|
+
datacite = JSON.parse(subject.datacite_json)
|
|
101
|
+
expect(datacite.fetch("publisher")).to eq(
|
|
102
|
+
{
|
|
103
|
+
"name" => "Example Publisher",
|
|
104
|
+
"publisherIdentifier" => "https://ror.org/04z8jg394",
|
|
105
|
+
"publisherIdentifierScheme" => "ROR",
|
|
106
|
+
"schemeUri" => "https://ror.org/",
|
|
107
|
+
"lang" => "en",
|
|
108
|
+
},
|
|
109
|
+
)
|
|
88
110
|
end
|
|
89
111
|
end
|
|
90
112
|
end
|
|
@@ -17,6 +17,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
17
17
|
expect(datacite.dig("rightsList", "rights")).to eq("rightsURI"=>"https://creativecommons.org/licenses/by/3.0/legalcode", "rightsIdentifier"=>"cc-by-3.0", "rightsIdentifierScheme"=>"SPDX", "schemeURI"=>"https://spdx.org/licenses/", "__content__"=>"Creative Commons Attribution 3.0 Unported")
|
|
18
18
|
expect(datacite.dig("fundingReferences", "fundingReference").count).to eq(4)
|
|
19
19
|
expect(datacite.dig("fundingReferences", "fundingReference").last).to eq("funderName"=>"University of Lausanne", "funderIdentifier" => {"funderIdentifierType"=>"Crossref Funder ID", "__content__"=>"https://doi.org/10.13039/501100006390"})
|
|
20
|
+
expect(datacite.dig("publisher")).to eq("eLife Sciences Publications, Ltd")
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
it "with ORCID ID" do
|
|
@@ -31,6 +32,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
31
32
|
"givenName" => "Beatriz",
|
|
32
33
|
"affiliation" => ["War Related Illness and Injury Study Center (WRIISC) and Mental Illness Research Education and Clinical Center (MIRECC), Department of Veterans Affairs, Palo Alto, CA 94304, USA", "Department of Psychiatry and Behavioral Sciences, Stanford University School of Medicine, Stanford, CA 94304, USA"],
|
|
33
34
|
"nameIdentifier" => {"nameIdentifierScheme"=>"ORCID", "schemeURI"=>"https://orcid.org", "__content__"=>"https://orcid.org/0000-0003-2043-4925"})
|
|
35
|
+
expect(datacite.dig("publisher")).to eq("Hindawi Limited")
|
|
34
36
|
end
|
|
35
37
|
|
|
36
38
|
it "with editor" do
|
|
@@ -39,6 +41,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
39
41
|
expect(subject.valid?).to be true
|
|
40
42
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
41
43
|
expect(datacite.dig("contributors", "contributor")).to eq("contributorName"=>{"__content__"=>"Janbon, Guilhem", "nameType"=>"Personal"}, "contributorType"=>"Editor", "familyName"=>"Janbon", "givenName"=>"Guilhem")
|
|
44
|
+
expect(datacite.dig("publisher")).to eq("Public Library of Science (PLoS)")
|
|
42
45
|
end
|
|
43
46
|
|
|
44
47
|
it "Crossref DOI" do
|
|
@@ -52,6 +55,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
52
55
|
expect(datacite.dig("descriptions", "description", 1, "__content__")).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
|
53
56
|
expect(datacite.dig("creators", "creator").count).to eq(5)
|
|
54
57
|
expect(datacite.dig("creators", "creator").first).to eq("creatorName"=>{"__content__"=>"Sankar, Martial", "nameType"=>"Personal"}, "familyName"=>"Sankar", "givenName"=>"Martial")
|
|
58
|
+
expect(datacite.dig("publisher")).to eq("{eLife} Sciences Organisation, Ltd.")
|
|
55
59
|
end
|
|
56
60
|
|
|
57
61
|
it "BlogPosting Citeproc JSON" do
|
|
@@ -64,6 +68,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
64
68
|
expect(datacite.dig("descriptions", "description").first).to eq("__content__"=>"DataCite Blog", "descriptionType"=>"SeriesInformation")
|
|
65
69
|
expect(datacite.dig("descriptions", "description", 1, "__content__")).to start_with("Eating your own dog food")
|
|
66
70
|
expect(datacite.dig("creators", "creator")).to eq("creatorName"=>"Fenner, Martin", "familyName"=>"Fenner", "givenName"=>"Martin")
|
|
71
|
+
expect(datacite.dig("publisher")).to eq("DataCite")
|
|
67
72
|
end
|
|
68
73
|
|
|
69
74
|
it "rdataone" do
|
|
@@ -88,6 +93,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
88
93
|
"__content__"=>"https://orcid.org/0000-0002-2192-403X"}},
|
|
89
94
|
{"creatorName"=>{"__content__"=>"University Of California, Santa Barbara", "nameType"=>"Organizational"}}])
|
|
90
95
|
expect(datacite.fetch("version")).to eq("2.0.0")
|
|
96
|
+
expect(datacite.dig("publisher")).to eq("https://cran.r-project.org")
|
|
91
97
|
end
|
|
92
98
|
|
|
93
99
|
it "rdataone and codemeta_v2" do
|
|
@@ -112,6 +118,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
112
118
|
"__content__"=>"https://orcid.org/0000-0002-2192-403X"}},
|
|
113
119
|
{"creatorName"=>{"__content__"=>"University Of California, Santa Barbara", "nameType"=>"Organizational"}}])
|
|
114
120
|
expect(datacite.fetch("version")).to eq("2.0.0")
|
|
121
|
+
expect(datacite.dig("publisher")).to eq("https://cran.r-project.org")
|
|
115
122
|
end
|
|
116
123
|
|
|
117
124
|
it "maremma" do
|
|
@@ -121,6 +128,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
121
128
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
122
129
|
expect(datacite.dig("titles", "title")).to eq("Maremma: a Ruby library for simplified network calls")
|
|
123
130
|
expect(datacite.dig("creators", "creator")).to eq("affiliation"=>"DataCite", "creatorName"=> {"__content__"=>"Fenner, Martin", "nameType"=>"Personal"}, "givenName"=>"Martin", "familyName"=>"Fenner", "nameIdentifier"=>{"__content__"=>"https://orcid.org/0000-0003-0077-4738", "nameIdentifierScheme"=>"ORCID", "schemeURI"=>"https://orcid.org"})
|
|
131
|
+
expect(datacite.dig("publisher")).to eq("DataCite")
|
|
124
132
|
end
|
|
125
133
|
|
|
126
134
|
it "with version" do
|
|
@@ -146,7 +154,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
146
154
|
expect(subject.dates).to eq([{"date"=>"2015-08-19", "dateType"=>"Issued"}])
|
|
147
155
|
expect(subject.publication_year).to eq("2015")
|
|
148
156
|
expect(subject.version_info).to eq("v0.3.2")
|
|
149
|
-
expect(subject.publisher).to eq("Zenodo")
|
|
157
|
+
expect(subject.publisher).to eq({"name"=>"Zenodo"})
|
|
150
158
|
expect(subject.agency).to eq("datacite")
|
|
151
159
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
|
152
160
|
expect(subject.datacite).to include("<version>v0.3.2</version>")
|
|
@@ -168,7 +176,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
168
176
|
"schemeUri"=>"https://spdx.org/licenses/"}])
|
|
169
177
|
expect(subject.dates).to eq([{"date"=>"2017-06-28", "dateType"=>"Created"}, {"date"=>"2017-06-28", "dateType"=>"Updated"}, {"date"=>"2017", "dateType"=>"Issued"}])
|
|
170
178
|
expect(subject.publication_year).to eq("2017")
|
|
171
|
-
expect(subject.publisher).to eq("Figshare")
|
|
179
|
+
expect(subject.publisher).to eq({"name"=>"Figshare"})
|
|
172
180
|
expect(subject.subjects).to eq([{"subject"=>"Information Systems"},
|
|
173
181
|
{"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
|
174
182
|
"subject"=>"FOS: Computer and information sciences",
|
|
@@ -194,7 +202,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
194
202
|
"schemeUri"=>"https://spdx.org/licenses/"}])
|
|
195
203
|
expect(subject.dates).to eq([{"date"=>"2017-06-28", "dateType"=>"Created"}, {"date"=>"2017-06-28", "dateType"=>"Updated"}, {"date"=>"2017", "dateType"=>"Issued"}])
|
|
196
204
|
expect(subject.publication_year).to eq("2017")
|
|
197
|
-
expect(subject.publisher).to eq("Figshare")
|
|
205
|
+
expect(subject.publisher).to eq({"name"=>"Figshare"})
|
|
198
206
|
expect(subject.subjects).to eq([{"subject"=>"Information Systems"},
|
|
199
207
|
{"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
|
200
208
|
"subject"=>"FOS: Computer and information sciences",
|
|
@@ -223,12 +231,13 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
223
231
|
expect(subject.related_identifiers.length).to eq(1)
|
|
224
232
|
expect(subject.related_identifiers.last).to eq("relatedIdentifier" => "10.1371/journal.ppat.1000446",
|
|
225
233
|
"relatedIdentifierType" => "DOI","relationType"=>"Cites")
|
|
226
|
-
expect(subject.publisher).to eq("Dryad")
|
|
234
|
+
expect(subject.publisher).to eq({"name"=>"Dryad"})
|
|
227
235
|
expect(subject.agency).to eq("datacite")
|
|
228
236
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
|
229
237
|
|
|
230
238
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
231
239
|
expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4")
|
|
240
|
+
expect(datacite.dig("publisher")).to eq("Dryad")
|
|
232
241
|
end
|
|
233
242
|
|
|
234
243
|
it "Affiliation" do
|
|
@@ -248,13 +257,154 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
248
257
|
"schemeUri"=>"https://spdx.org/licenses/"}])
|
|
249
258
|
expect(subject.dates).to eq([{"date"=>"2014-10-17", "dateType"=>"Updated"}, {"date"=>"2016-03-14T17:02:02Z", "dateType"=>"Available"}, {"date"=>"2013", "dateType"=>"Issued"}])
|
|
250
259
|
expect(subject.publication_year).to eq("2013")
|
|
251
|
-
expect(subject.publisher).to eq("UC Merced")
|
|
260
|
+
expect(subject.publisher).to eq({"name"=>"UC Merced"})
|
|
252
261
|
expect(subject.agency).to eq("datacite")
|
|
253
262
|
expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
|
|
254
263
|
|
|
255
264
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
256
265
|
expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4")
|
|
257
266
|
expect(datacite.dig("creators", "creator", 0, "affiliation")).to eq(["UC Merced", "NSF"])
|
|
267
|
+
expect(datacite.dig("publisher")).to eq("UC Merced")
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
it "Schema 4.5 publisher with attributes" do
|
|
271
|
+
input = fixture_path + 'datacite-example-full-v4.5.xml'
|
|
272
|
+
doi = "10.82433/B09Z-4K37"
|
|
273
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite", regenerate: true)
|
|
274
|
+
expect(subject.valid?).to be true
|
|
275
|
+
|
|
276
|
+
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
277
|
+
expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4")
|
|
278
|
+
expect(datacite.dig("publisher")).to eq(
|
|
279
|
+
{
|
|
280
|
+
"__content__" => "Example Publisher",
|
|
281
|
+
"publisherIdentifier" => "https://ror.org/04z8jg394",
|
|
282
|
+
"publisherIdentifierScheme" => "ROR",
|
|
283
|
+
"schemeURI" => "https://ror.org/",
|
|
284
|
+
"xml:lang" => "en",
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
it "Schema 4.6" do
|
|
290
|
+
input = fixture_path + 'datacite-example-full-v4.6.xml'
|
|
291
|
+
doi = "10.82433/B09Z-4K37"
|
|
292
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite", regenerate: true)
|
|
293
|
+
expect(subject.valid?).to be true
|
|
294
|
+
|
|
295
|
+
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
296
|
+
expect(datacite.fetch("xsi:schemaLocation", "").split(" ").first).to eq("http://datacite.org/schema/kernel-4")
|
|
297
|
+
expect(datacite.dig("contributors", "contributor").count).to eq(2)
|
|
298
|
+
expect(datacite.dig("contributors", "contributor")).to include(
|
|
299
|
+
{
|
|
300
|
+
"contributorType"=>"Translator",
|
|
301
|
+
"contributorName"=>{
|
|
302
|
+
"nameType"=>"Personal",
|
|
303
|
+
"__content__"=>"Doe, Jane"
|
|
304
|
+
},
|
|
305
|
+
"givenName"=>"Jane",
|
|
306
|
+
"familyName"=>"Doe",
|
|
307
|
+
"nameIdentifier"=>{
|
|
308
|
+
"nameIdentifierScheme"=>"ORCID",
|
|
309
|
+
"schemeURI"=>"https://orcid.org",
|
|
310
|
+
"__content__"=>"https://orcid.org/0000-0003-1419-2405"
|
|
311
|
+
},
|
|
312
|
+
"affiliation"=>{
|
|
313
|
+
"affiliationIdentifier"=>"https://ror.org/04wxnsj81",
|
|
314
|
+
"affiliationIdentifierScheme"=>"ROR",
|
|
315
|
+
"schemeURI"=>"https://ror.org",
|
|
316
|
+
"__content__"=>"ExampleAffiliation"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
)
|
|
320
|
+
expect(datacite.dig("dates", "date").count).to eq(5)
|
|
321
|
+
expect(datacite.dig("dates", "date")).to include(
|
|
322
|
+
{
|
|
323
|
+
"dateType"=>"Coverage",
|
|
324
|
+
"__content__"=>"2020-01-01"
|
|
325
|
+
}
|
|
326
|
+
)
|
|
327
|
+
expect(datacite.dig("resourceType")).to eq(
|
|
328
|
+
{
|
|
329
|
+
"__content__"=>"Research Project",
|
|
330
|
+
"resourceTypeGeneral"=>"Project"
|
|
331
|
+
}
|
|
332
|
+
)
|
|
333
|
+
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier").count).to eq(4)
|
|
334
|
+
expect(datacite.dig("relatedIdentifiers", "relatedIdentifier")).to eq(
|
|
335
|
+
[
|
|
336
|
+
{
|
|
337
|
+
"relatedIdentifierType"=>"RRID",
|
|
338
|
+
"relationType"=>"References",
|
|
339
|
+
"__content__"=>"RRID:AB_90755"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"relatedIdentifierType"=>"CSTR",
|
|
343
|
+
"relationType"=>"References",
|
|
344
|
+
"__content__"=>"CSTR:AB_12345"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"relatedIdentifierType"=>"DOI",
|
|
348
|
+
"relationType"=>"HasTranslation",
|
|
349
|
+
"__content__"=>"10.1234/translated-version"
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"relatedIdentifierType"=>"DOI",
|
|
353
|
+
"relationType"=>"IsTranslationOf",
|
|
354
|
+
"__content__"=>"10.1234/other-version"
|
|
355
|
+
}
|
|
356
|
+
]
|
|
357
|
+
)
|
|
358
|
+
end
|
|
359
|
+
|
|
360
|
+
it "Geolocations" do
|
|
361
|
+
input = fixture_path + 'datacite-example-full-v4.5.xml'
|
|
362
|
+
doi = "10.82433/B09Z-4K37"
|
|
363
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite", regenerate: true)
|
|
364
|
+
expect(subject.valid?).to be true
|
|
365
|
+
|
|
366
|
+
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
|
367
|
+
expect(datacite.dig("geoLocations", "geoLocation", "geoLocationPlace")).to eq("Vancouver, British Columbia, Canada")
|
|
368
|
+
expect(datacite.dig("geoLocations", "geoLocation", "geoLocationPoint")).to eq(
|
|
369
|
+
{
|
|
370
|
+
"pointLatitude" => "49.2827",
|
|
371
|
+
"pointLongitude" => "-123.1207",
|
|
372
|
+
}
|
|
373
|
+
)
|
|
374
|
+
expect(datacite.dig("geoLocations", "geoLocation", "geoLocationBox")).to eq(
|
|
375
|
+
{
|
|
376
|
+
"westBoundLongitude" => "-123.27",
|
|
377
|
+
"eastBoundLongitude" => "-123.02",
|
|
378
|
+
"southBoundLatitude" => "49.195",
|
|
379
|
+
"northBoundLatitude" => "49.315",
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
expect(datacite.dig("geoLocations", "geoLocation", "geoLocationPolygon")).to eq(
|
|
383
|
+
{
|
|
384
|
+
"polygonPoint" => [
|
|
385
|
+
{
|
|
386
|
+
"pointLatitude" => "41.991",
|
|
387
|
+
"pointLongitude" => "-71.032",
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
"pointLatitude" => "42.893",
|
|
391
|
+
"pointLongitude" => "-69.622",
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"pointLatitude" => "41.991",
|
|
395
|
+
"pointLongitude" => "-68.211",
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
"pointLatitude" => "41.090",
|
|
399
|
+
"pointLongitude" => "-69.622",
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"pointLatitude" => "41.991",
|
|
403
|
+
"pointLongitude" => "-71.032",
|
|
404
|
+
},
|
|
405
|
+
]
|
|
406
|
+
}
|
|
407
|
+
)
|
|
258
408
|
end
|
|
259
409
|
|
|
260
410
|
it "with data citation schema.org" do
|