commonmeta-ruby 3.4.4 → 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 +2 -2
- data/lib/commonmeta/author_utils.rb +103 -71
- data/lib/commonmeta/crossref_utils.rb +31 -25
- data/lib/commonmeta/metadata.rb +2 -8
- data/lib/commonmeta/metadata_utils.rb +4 -3
- data/lib/commonmeta/readers/bibtex_reader.rb +3 -3
- data/lib/commonmeta/readers/cff_reader.rb +7 -6
- data/lib/commonmeta/readers/codemeta_reader.rb +3 -3
- data/lib/commonmeta/readers/crossref_reader.rb +3 -5
- data/lib/commonmeta/readers/crossref_xml_reader.rb +7 -6
- data/lib/commonmeta/readers/csl_reader.rb +3 -4
- data/lib/commonmeta/readers/datacite_reader.rb +3 -5
- data/lib/commonmeta/readers/json_feed_reader.rb +3 -3
- data/lib/commonmeta/readers/npm_reader.rb +2 -2
- data/lib/commonmeta/readers/ris_reader.rb +1 -1
- data/lib/commonmeta/readers/schema_org_reader.rb +3 -3
- data/lib/commonmeta/schema_utils.rb +1 -1
- data/lib/commonmeta/utils.rb +4 -2
- data/lib/commonmeta/version.rb +1 -1
- data/lib/commonmeta/writers/bibtex_writer.rb +1 -1
- data/lib/commonmeta/writers/cff_writer.rb +5 -4
- data/lib/commonmeta/writers/codemeta_writer.rb +4 -2
- data/lib/commonmeta/writers/csv_writer.rb +4 -2
- data/lib/commonmeta/writers/datacite_writer.rb +1 -1
- data/lib/commonmeta/writers/jats_writer.rb +9 -5
- data/lib/commonmeta/writers/ris_writer.rb +2 -1
- data/lib/commonmeta/writers/schema_org_writer.rb +6 -3
- data/resources/{commonmeta_v0.9.3.json → commonmeta_v0.10.json} +62 -46
- data/spec/author_utils_spec.rb +16 -16
- data/spec/cli_spec.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/missing_contributor.yml +307 -0
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_datacite_metadata/SoftwareSourceCode.yml +76 -0
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_funding.yml +36 -36
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_link_to_peer-reviewed_article.yml +4911 -0
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/book_oup.yml +107 -0
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article_plos.yml +407 -0
- data/spec/metadata_spec.rb +2 -2
- data/spec/readers/bibtex_reader_spec.rb +5 -5
- data/spec/readers/cff_reader_spec.rb +127 -127
- data/spec/readers/codemeta_reader_spec.rb +11 -11
- data/spec/readers/crossref_reader_spec.rb +831 -835
- data/spec/readers/crossref_xml_reader_spec.rb +899 -901
- data/spec/readers/csl_reader_spec.rb +33 -33
- data/spec/readers/datacite_reader_spec.rb +106 -103
- data/spec/readers/json_feed_reader_spec.rb +64 -38
- data/spec/readers/npm_reader_spec.rb +32 -33
- data/spec/readers/ris_reader_spec.rb +36 -36
- data/spec/readers/schema_org_reader_spec.rb +284 -284
- data/spec/writers/codemeta_writer_spec.rb +19 -20
- data/spec/writers/crossref_xml_writer_spec.rb +73 -37
- data/spec/writers/datacite_writer_spec.rb +1 -1
- metadata +8 -3
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "spec_helper"
|
4
4
|
|
5
5
|
describe Commonmeta::Metadata, vcr: true do
|
6
|
-
context
|
6
|
+
context "write metadata as codemeta" do
|
7
7
|
# it "SoftwareSourceCode DataCite JSON" do
|
8
8
|
# input = fixture_path + "datacite_software.json"
|
9
9
|
# subject = Commonmeta::Metadata.new(input: input, from: "datacite")
|
@@ -19,29 +19,28 @@ describe Commonmeta::Metadata, vcr: true do
|
|
19
19
|
# expect(json["publisher"]).to eq("KNB Data Repository")
|
20
20
|
# end
|
21
21
|
|
22
|
-
it
|
23
|
-
input =
|
24
|
-
subject = described_class.new(input: input, from:
|
25
|
-
expect(subject.valid?).to be true
|
22
|
+
it "SoftwareSourceCode DataCite" do
|
23
|
+
input = "https://doi.org/10.5063/f1m61h5x"
|
24
|
+
subject = described_class.new(input: input, from: "datacite")
|
25
|
+
# expect(subject.valid?).to be true
|
26
26
|
json = JSON.parse(subject.codemeta)
|
27
|
-
expect(json[
|
28
|
-
expect(json[
|
29
|
-
expect(json[
|
30
|
-
expect(json[
|
31
|
-
|
32
|
-
|
33
|
-
expect(json[
|
34
|
-
expect(json[
|
35
|
-
expect(json['publisher']).to eq('KNB Data Repository')
|
27
|
+
expect(json["@context"]).to eq("https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld")
|
28
|
+
expect(json["@id"]).to eq("https://doi.org/10.5063/f1m61h5x")
|
29
|
+
expect(json["@type"]).to eq("SoftwareSourceCode")
|
30
|
+
expect(json["authors"]).to eq("@type" => "Organization",
|
31
|
+
"name" => "Jones, Matthew B.; Slaughter, Peter; Nahf, Rob; Boettiger, Carl ; Jones, Chris; Read, Jordan; Walker, Lauren; Hart, Edmund; Chamberlain, Scott")
|
32
|
+
expect(json["name"]).to eq("dataone: R interface to the DataONE network of data repositories")
|
33
|
+
expect(json["datePublished"]).to eq("2016")
|
34
|
+
expect(json["publisher"]).to eq("KNB Data Repository")
|
36
35
|
end
|
37
36
|
|
38
|
-
it
|
39
|
-
input =
|
40
|
-
subject = described_class.new(input: input, from:
|
37
|
+
it "SoftwareSourceCode DataCite check codemeta v2" do
|
38
|
+
input = "https://doi.org/10.5063/f1m61h5x"
|
39
|
+
subject = described_class.new(input: input, from: "datacite")
|
41
40
|
expect(subject.valid?).to be true
|
42
41
|
json = JSON.parse(subject.codemeta)
|
43
|
-
expect(json[
|
44
|
-
expect(json[
|
42
|
+
expect(json["agents"].nil?).to be(true)
|
43
|
+
expect(json["title"].nil?).to be(true)
|
45
44
|
end
|
46
45
|
end
|
47
46
|
end
|
@@ -26,6 +26,42 @@ describe Commonmeta::Metadata, vcr: true do
|
|
26
26
|
"volume" => "426")
|
27
27
|
end
|
28
28
|
|
29
|
+
it "journal article plos" do
|
30
|
+
input = "https://doi.org/10.1371/journal.pone.0000030"
|
31
|
+
subject = described_class.new(input: input)
|
32
|
+
expect(subject.valid?).to be true
|
33
|
+
expect(subject.id).to eq("https://doi.org/10.1371/journal.pone.0000030")
|
34
|
+
expect(subject.url).to eq("https://dx.plos.org/10.1371/journal.pone.0000030")
|
35
|
+
expect(subject.type).to eq("JournalArticle")
|
36
|
+
expect(subject.contributors.length).to eq(6)
|
37
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
38
|
+
"givenName" => "Markus", "familyName" => "Ralser")
|
39
|
+
expect(subject.contributors.last).to eq({ "familyName" => "Janbon",
|
40
|
+
"givenName" => "Guilhem", "type" => "Person", "contributorRoles" => ["Editor"] })
|
41
|
+
expect(subject.titles).to eq([{ "title" => "Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes" }])
|
42
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
43
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
44
|
+
expect(subject.date).to eq("published" => "2006-12-20", "updated" => "2021-08-06")
|
45
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/340",
|
46
|
+
"name" => "Public Library of Science (PLoS)")
|
47
|
+
expect(subject.references.length).to eq(73)
|
48
|
+
expect(subject.references.last).to eq("containerTitle" => "N Engl J Med", "contributor" => "KB Hammond",
|
49
|
+
"doi" => "https://doi.org/10.1056/nejm199109123251104",
|
50
|
+
"firstPage" => "769",
|
51
|
+
"key" => "ref73",
|
52
|
+
"publicationYear" => "1991",
|
53
|
+
"title" => "Efficacy of statewide neonatal screening for cystic fibrosis by assay of trypsinogen concentrations.", "volume" => "325")
|
54
|
+
expect(subject.container).to eq("firstPage" => "e30", "identifier" => "1932-6203",
|
55
|
+
"identifierType" => "ISSN", "issue" => "1", "title" => "PLoS ONE", "type" => "Journal", "volume" => "1")
|
56
|
+
crossref_xml = Hash.from_xml(subject.crossref_xml).dig("doi_batch", "body", "journal",
|
57
|
+
"journal_article")
|
58
|
+
expect(Array.wrap(crossref_xml.dig("contributors", "person_name")).length).to eq(6)
|
59
|
+
expect(Array.wrap(crossref_xml.dig("contributors",
|
60
|
+
"person_name")).first).to eq("contributor_role"=>"author", "given_name"=>"Markus", "sequence"=>"first", "surname"=>"Ralser")
|
61
|
+
expect(crossref_xml.dig("titles",
|
62
|
+
"title")).to eq("Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes")
|
63
|
+
end
|
64
|
+
|
29
65
|
it "posted_content" do
|
30
66
|
subject = described_class.new(input: "10.1101/2020.12.01.406702", depositor: "test", email: "info@example.org", registrant: "test")
|
31
67
|
expect(subject.valid?).to be true
|
@@ -64,10 +100,10 @@ describe Commonmeta::Metadata, vcr: true do
|
|
64
100
|
expect(subject.url).to eq("https://blog.front-matter.io/posts/editorial-by-more-than-200-call-for-emergency-action-to-limit-global-temperature-increases-restore-biodiversity-and-protect-health")
|
65
101
|
expect(subject.type).to eq("Article")
|
66
102
|
expect(subject.titles).to eq([{ "title" => "Editorial by more than 200 health journals: Call for emergency action to limit global temperature increases, restore biodiversity, and protect health" }])
|
67
|
-
expect(subject.
|
68
|
-
|
69
|
-
|
70
|
-
|
103
|
+
expect(subject.contributors).to eq([{ "familyName" => "Fenner",
|
104
|
+
"givenName" => "Martin",
|
105
|
+
"id" => "https://orcid.org/0000-0003-1419-2405",
|
106
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
71
107
|
expect(subject.subjects).to eq([{ "subject" => "News" }])
|
72
108
|
expect(subject.language).to eq("en")
|
73
109
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
@@ -85,10 +121,10 @@ describe Commonmeta::Metadata, vcr: true do
|
|
85
121
|
expect(subject.url).to eq("https://blog.front-matter.io/posts/dryad-interview-jen-gibson")
|
86
122
|
expect(subject.type).to eq("Article")
|
87
123
|
expect(subject.titles).to eq([{ "title" => "Dryad: Interview with Jen Gibson" }])
|
88
|
-
expect(subject.
|
89
|
-
|
90
|
-
|
91
|
-
|
124
|
+
expect(subject.contributors).to eq([{ "familyName" => "Fenner",
|
125
|
+
"givenName" => "Martin",
|
126
|
+
"id" => "https://orcid.org/0000-0003-1419-2405",
|
127
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
92
128
|
expect(subject.subjects).to eq([{ "subject" => "Interview" }])
|
93
129
|
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io/", "identifierType" => "URL",
|
94
130
|
"title" => "Front Matter", "type" => "Periodical")
|
@@ -126,10 +162,10 @@ describe Commonmeta::Metadata, vcr: true do
|
|
126
162
|
expect(subject.url).to eq("https://donnywinston.com/posts/implementing-the-fair-principles-through-fair-enabling-artifacts-and-services")
|
127
163
|
expect(subject.type).to eq("Article")
|
128
164
|
expect(subject.titles).to eq([{ "title" => "Implementing the FAIR Principles Through FAIR-Enabling Artifacts and Services" }])
|
129
|
-
expect(subject.
|
130
|
-
|
131
|
-
|
132
|
-
|
165
|
+
expect(subject.contributors).to eq([{ "familyName" => "Winston",
|
166
|
+
"givenName" => "Donny",
|
167
|
+
"id" => "https://orcid.org/0000-0002-8424-0604",
|
168
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
133
169
|
expect(subject.subjects).to eq([])
|
134
170
|
expect(subject.container).to eq("identifier" => "https://www.polyneme.xyz",
|
135
171
|
"identifierType" => "URL", "type" => "Periodical")
|
@@ -153,10 +189,10 @@ describe Commonmeta::Metadata, vcr: true do
|
|
153
189
|
expect(subject.url).to eq("https://upstream.force11.org/deep-dive-into-ethics-of-contributor-roles")
|
154
190
|
expect(subject.type).to eq("Article")
|
155
191
|
expect(subject.titles).to eq([{ "title" => "Deep dive into ethics of Contributor Roles: report of a FORCE11 workshop" }])
|
156
|
-
expect(subject.
|
157
|
-
expect(subject.
|
158
|
-
|
159
|
-
|
192
|
+
expect(subject.contributors.length).to eq(4)
|
193
|
+
expect(subject.contributors.first).to eq("familyName" => "Hosseini",
|
194
|
+
"givenName" => "Mohammad",
|
195
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
160
196
|
expect(subject.subjects).to eq([{ "subject" => "News" }])
|
161
197
|
expect(subject.language).to eq("en")
|
162
198
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
@@ -179,8 +215,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
179
215
|
expect(subject.url).to eq("https://upstream.force11.org/attempts-at-automating-journal-subject-classification")
|
180
216
|
expect(subject.type).to eq("Article")
|
181
217
|
expect(subject.titles).to eq([{ "title" => "Attempts at automating journal subject classification" }])
|
182
|
-
expect(subject.
|
183
|
-
expect(subject.
|
218
|
+
expect(subject.contributors.length).to eq(1)
|
219
|
+
expect(subject.contributors.first).to eq("familyName" => "Datta", "givenName" => "Esha", "id" => "https://orcid.org/0000-0001-9165-2757", "type" => "Person", "contributorRoles" => ["Author"])
|
184
220
|
expect(subject.subjects).to eq([{ "subject" => "Humanities" },
|
185
221
|
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
186
222
|
"subject" => "FOS: Humanities",
|
@@ -208,8 +244,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
208
244
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "954f8138-0ecd-4090-87c5-cef1297f1470", "alternateIdentifierType" => "UUID" }])
|
209
245
|
expect(subject.type).to eq("Article")
|
210
246
|
expect(subject.titles).to eq([{ "title" => "The Research Software Alliance (ReSA)" }])
|
211
|
-
expect(subject.
|
212
|
-
expect(subject.
|
247
|
+
expect(subject.contributors.length).to eq(2)
|
248
|
+
expect(subject.contributors.first).to eq("familyName" => "Katz", "givenName" => "Daniel S.", "id" => "https://orcid.org/0000-0001-5934-7525", "type" => "Person", "contributorRoles" => ["Author"])
|
213
249
|
expect(subject.subjects).to eq([{ "subject" => "Humanities" },
|
214
250
|
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
215
251
|
"subject" => "FOS: Humanities",
|
@@ -239,8 +275,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
239
275
|
expect(subject.url).to eq("https://wisspub.net/2023/05/23/eu-mitgliedstaaten-betonen-die-rolle-von-wissenschaftsgeleiteten-open-access-modellen-jenseits-von-apcs")
|
240
276
|
expect(subject.type).to eq("Article")
|
241
277
|
expect(subject.titles).to eq([{ "title" => "EU-Mitgliedstaaten betonen die Rolle von wissenschaftsgeleiteten Open-Access-Modellen jenseits von APCs" }])
|
242
|
-
expect(subject.
|
243
|
-
expect(subject.
|
278
|
+
expect(subject.contributors.length).to eq(1)
|
279
|
+
expect(subject.contributors.first).to eq("familyName" => "Pampel", "givenName" => "Heinz", "id" => "https://orcid.org/0000-0003-3334-2771", "type" => "Person", "contributorRoles" => ["Author"])
|
244
280
|
expect(subject.subjects).to eq([{ "subject" => "Social sciences" },
|
245
281
|
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
246
282
|
"subject" => "FOS: Social sciences",
|
@@ -267,8 +303,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
267
303
|
expect(subject.url).to eq("https://libscie.org/ku-leuven-supports-researchequals")
|
268
304
|
expect(subject.type).to eq("Article")
|
269
305
|
expect(subject.titles).to eq([{ "title" => "KU Leuven supports ResearchEquals" }])
|
270
|
-
expect(subject.
|
271
|
-
expect(subject.
|
306
|
+
expect(subject.contributors.length).to eq(1)
|
307
|
+
expect(subject.contributors.first).to eq("id" => "https://ror.org/0342dzm54", "name" => "Liberate Science", "type" => "Organization", "contributorRoles" => ["Author"])
|
272
308
|
expect(subject.subjects).to eq([{ "subject" => "Social sciences" },
|
273
309
|
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
274
310
|
"subject" => "FOS: Social sciences",
|
@@ -294,10 +330,10 @@ describe Commonmeta::Metadata, vcr: true do
|
|
294
330
|
expect(subject.url).to eq("https://blog.front-matter.io/posts/differences-between-orcid-and-datacite-metadata")
|
295
331
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "8a4de443-3347-4b82-b57d-e3c82b6485fc", "alternateIdentifierType" => "UUID" }])
|
296
332
|
expect(subject.type).to eq("Article")
|
297
|
-
expect(subject.
|
298
|
-
expect(subject.
|
299
|
-
|
300
|
-
|
333
|
+
expect(subject.contributors.length).to eq(1)
|
334
|
+
expect(subject.contributors.first).to eq("familyName" => "Fenner",
|
335
|
+
"givenName" => "Martin",
|
336
|
+
"id" => "https://orcid.org/0000-0003-1419-2405", "type" => "Person", "contributorRoles" => ["Author"])
|
301
337
|
expect(subject.titles).to eq([{ "title" => "Differences between ORCID and DataCite Metadata" }])
|
302
338
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
303
339
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -310,13 +346,13 @@ describe Commonmeta::Metadata, vcr: true do
|
|
310
346
|
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
311
347
|
expect(subject.language).to eq("en")
|
312
348
|
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io", "identifierType" => "URL", "title" => "Front Matter", "type" => "Periodical")
|
313
|
-
expect(subject.references).to eq([{"doi"=>"https://doi.org/10.5281/ZENODO.30799", "key"=>"ref1", "publicationYear"=>"2015", "title"=>"D2.1: Artefact, Contributor, And Organisation Relationship Data Schema"}])
|
314
|
-
expect(subject.related_identifiers).to eq([{"id"=>"https://doi.org/10.5438/bc11-cqw1", "type"=>"IsIdenticalTo"}])
|
349
|
+
expect(subject.references).to eq([{ "doi" => "https://doi.org/10.5281/ZENODO.30799", "key" => "ref1", "publicationYear" => "2015", "title" => "D2.1: Artefact, Contributor, And Organisation Relationship Data Schema" }])
|
350
|
+
expect(subject.related_identifiers).to eq([{ "id" => "https://doi.org/10.5438/bc11-cqw1", "type" => "IsIdenticalTo" }])
|
315
351
|
# puts subject.crossref_xml
|
316
352
|
crossref_xml = Hash.from_xml(subject.crossref_xml).dig("doi_batch", "body", "posted_content")
|
317
353
|
expect(Array.wrap(crossref_xml.dig("contributors", "person_name")).length).to eq(1)
|
318
354
|
expect(Array.wrap(crossref_xml.dig("contributors",
|
319
|
-
"person_name")).first).to eq({"ORCID"=>"https://orcid.org/0000-0003-1419-2405", "contributor_role"=>"author", "given_name"=>"Martin", "sequence"=>"first", "surname"=>"Fenner"})
|
355
|
+
"person_name")).first).to eq({ "ORCID" => "https://orcid.org/0000-0003-1419-2405", "contributor_role" => "author", "given_name" => "Martin", "sequence" => "first", "surname" => "Fenner" })
|
320
356
|
expect(crossref_xml.dig("titles",
|
321
357
|
"title")).to eq("Differences between ORCID and DataCite Metadata")
|
322
358
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "8a4de44333474b82b57de3c82b6485fc", "item_number_type" => "uuid")
|
@@ -332,15 +368,15 @@ describe Commonmeta::Metadata, vcr: true do
|
|
332
368
|
expect(subject.url).to eq("https://blog.front-matter.io/posts/tracking-the-growth-of-the-pid-graph")
|
333
369
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "e58dc9c8-b870-4db2-8896-238b3246c551", "alternateIdentifierType" => "UUID" }])
|
334
370
|
expect(subject.type).to eq("Article")
|
335
|
-
expect(subject.
|
336
|
-
expect(subject.
|
371
|
+
expect(subject.contributors.length).to eq(1)
|
372
|
+
expect(subject.contributors.first).to eq("id" => "https://orcid.org/0000-0003-1419-2405", "familyName" => "Fenner", "givenName" => "Martin", "type" => "Person", "contributorRoles" => ["Author"])
|
337
373
|
expect(subject.titles).to eq([{ "title" => "Tracking the Growth of the PID Graph" }])
|
338
374
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
339
375
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
340
376
|
expect(subject.date).to eq("published" => "2019-07-01", "updated" => "2023-09-07")
|
341
377
|
expect(subject.descriptions.first["description"]).to start_with("The connections between scholarly resources generated by persistent identifiers (PIDs)")
|
342
378
|
expect(subject.publisher).to eq("name" => "Front Matter")
|
343
|
-
expect(subject.funding_references).to eq([{ "awardNumber" => "777523", "funderIdentifier"=>"http://doi.org/10.13039/501100000780", "funderName" => "European Commission" }])
|
379
|
+
expect(subject.funding_references).to eq([{ "awardNumber" => "777523", "funderIdentifier" => "http://doi.org/10.13039/501100000780", "funderName" => "European Commission" }])
|
344
380
|
expect(subject.related_identifiers).to eq([{ "id" => "https://doi.org/10.5438/bv9z-dc66", "type" => "IsIdenticalTo" }])
|
345
381
|
expect(subject.subjects).to eq([{ "subject" => "Computer and information sciences" },
|
346
382
|
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
@@ -352,7 +388,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
352
388
|
crossref_xml = Hash.from_xml(subject.crossref_xml).dig("doi_batch", "body", "posted_content")
|
353
389
|
expect(Array.wrap(crossref_xml.dig("contributors", "person_name")).length).to eq(1)
|
354
390
|
expect(Array.wrap(crossref_xml.dig("contributors",
|
355
|
-
"person_name")).first).to eq({"ORCID"=>"https://orcid.org/0000-0003-1419-2405", "contributor_role"=>"author", "given_name"=>"Martin", "sequence"=>"first", "surname"=>"Fenner"})
|
391
|
+
"person_name")).first).to eq({ "ORCID" => "https://orcid.org/0000-0003-1419-2405", "contributor_role" => "author", "given_name" => "Martin", "sequence" => "first", "surname" => "Fenner" })
|
356
392
|
expect(crossref_xml.dig("titles",
|
357
393
|
"title")).to eq("Tracking the Growth of the PID Graph")
|
358
394
|
expect(crossref_xml.dig("item_number")).to eq("__content__" => "e58dc9c8b8704db28896238b3246c551", "item_number_type" => "uuid")
|
@@ -367,8 +403,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
367
403
|
expect(subject.url).to eq("https://lab.sub.uni-goettingen.de/welcome.html")
|
368
404
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "a163e340-5b3c-4736-9ab0-8c54fdff6a3c", "alternateIdentifierType" => "UUID" }])
|
369
405
|
expect(subject.type).to eq("Article")
|
370
|
-
expect(subject.
|
371
|
-
expect(subject.
|
406
|
+
expect(subject.contributors.length).to eq(1)
|
407
|
+
expect(subject.contributors.first).to eq("familyName" => "Göbel", "givenName" => "Mathias", "type" => "Person", "contributorRoles" => ["Author"])
|
372
408
|
expect(subject.titles).to eq([{ "title" => "Welcome to the Lab" }])
|
373
409
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
374
410
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -116,7 +116,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
116
116
|
expect(subject.valid?).to be true
|
117
117
|
datacite = JSON.parse(subject.datacite)
|
118
118
|
expect(datacite.fetch('titles')).to eq([{ 'title' => 'Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes' }])
|
119
|
-
expect(datacite.fetch('creators').length).to eq(
|
119
|
+
expect(datacite.fetch('creators').length).to eq(6)
|
120
120
|
expect(datacite.fetch('creators').first).to eq('familyName' => 'Ralser',
|
121
121
|
'givenName' => 'Markus',
|
122
122
|
'name' => 'Ralser, Markus',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commonmeta-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: '3.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -655,7 +655,7 @@ files:
|
|
655
655
|
- lib/commonmeta/xml_converter.rb
|
656
656
|
- resources/2008/09/xsd.xsl
|
657
657
|
- resources/cff.json
|
658
|
-
- resources/commonmeta_v0.
|
658
|
+
- resources/commonmeta_v0.10.json
|
659
659
|
- resources/crossref/AccessIndicators.xsd
|
660
660
|
- resources/crossref/JATS-journalpublishing1-3d2-mathml3-elements.xsd
|
661
661
|
- resources/crossref/JATS-journalpublishing1-3d2-mathml3.xsd
|
@@ -843,6 +843,7 @@ files:
|
|
843
843
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/journal_issue.yml
|
844
844
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/mEDRA.yml
|
845
845
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/markup.yml
|
846
|
+
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/missing_contributor.yml
|
846
847
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/missing_creator.yml
|
847
848
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/multiple_issn.yml
|
848
849
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/multiple_titles.yml
|
@@ -856,6 +857,7 @@ files:
|
|
856
857
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/yet_another_book.yml
|
857
858
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/yet_another_book_chapter.yml
|
858
859
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_raw/journal_article.yml
|
860
|
+
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_datacite_metadata/SoftwareSourceCode.yml
|
859
861
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_datacite_metadata/dissertation.yml
|
860
862
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_datacite_metadata/funding_references.yml
|
861
863
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_datacite_metadata/subject_scheme.yml
|
@@ -875,6 +877,7 @@ files:
|
|
875
877
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_organizational_author.yml
|
876
878
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers.yml
|
877
879
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_funding.yml
|
880
|
+
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_link_to_peer-reviewed_article.yml
|
878
881
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_without_doi.yml
|
879
882
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/jekyll_post.yml
|
880
883
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/jekyll_post_with_anonymous_author.yml
|
@@ -923,8 +926,10 @@ files:
|
|
923
926
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite.yml
|
924
927
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_codemeta/SoftwareSourceCode_DataCite_check_codemeta_v2.yml
|
925
928
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/another_schema_org_from_front-matter.yml
|
929
|
+
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/book_oup.yml
|
926
930
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article.yml
|
927
931
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article_from_datacite.yml
|
932
|
+
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article_plos.yml
|
928
933
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_feed_item_from_rogue_scholar_with_anonymous_author.yml
|
929
934
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_feed_item_from_rogue_scholar_with_doi.yml
|
930
935
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/json_feed_item_from_rogue_scholar_with_organizational_author.yml
|