commonmeta-ruby 3.4.4 → 3.5
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -14,8 +14,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
14
14
|
expect(subject.url).to eq("https://iphylo.blogspot.com/2023/05/ten-years-and-million-links.html")
|
15
15
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "f3629c86-06e0-42c0-844a-266b03a91ef1", "alternateIdentifierType" => "UUID" }])
|
16
16
|
expect(subject.type).to eq("Article")
|
17
|
-
expect(subject.
|
18
|
-
expect(subject.
|
17
|
+
expect(subject.contributors.length).to eq(1)
|
18
|
+
expect(subject.contributors.first).to eq("id" => "https://orcid.org/0000-0002-7101-9767", "familyName" => "Page", "givenName" => "Roderic", "type" => "Person", "contributorRoles" => ["Author"])
|
19
19
|
expect(subject.titles).to eq([{ "title" => "Ten years and a million links" }])
|
20
20
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
21
21
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -38,8 +38,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
38
38
|
expect(subject.url).to eq("https://blog.front-matter.io/posts/does-it-compose")
|
39
39
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "5bb66e92-5cb9-4659-8aca-20e486b695c9", "alternateIdentifierType" => "UUID" }])
|
40
40
|
expect(subject.type).to eq("Article")
|
41
|
-
expect(subject.
|
42
|
-
expect(subject.
|
41
|
+
expect(subject.contributors.length).to eq(1)
|
42
|
+
expect(subject.contributors.first).to eq("id" => "https://orcid.org/0000-0003-1419-2405", "familyName" => "Fenner", "givenName" => "Martin", "type" => "Person", "contributorRoles" => ["Author"])
|
43
43
|
expect(subject.titles).to eq([{ "title" => "Does it compose?" }])
|
44
44
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
45
45
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -62,8 +62,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
62
62
|
expect(subject.url).to eq("https://blog.front-matter.io/posts/differences-between-orcid-and-datacite-metadata")
|
63
63
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "8a4de443-3347-4b82-b57d-e3c82b6485fc", "alternateIdentifierType" => "UUID" }])
|
64
64
|
expect(subject.type).to eq("Article")
|
65
|
-
expect(subject.
|
66
|
-
expect(subject.
|
65
|
+
expect(subject.contributors.length).to eq(1)
|
66
|
+
expect(subject.contributors.first).to eq("id" => "https://orcid.org/0000-0003-1419-2405", "familyName" => "Fenner", "givenName" => "Martin", "type" => "Person", "contributorRoles" => ["Author"])
|
67
67
|
expect(subject.titles).to eq([{ "title" => "Differences between ORCID and DataCite Metadata" }])
|
68
68
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
69
69
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -79,6 +79,31 @@ describe Commonmeta::Metadata, vcr: true do
|
|
79
79
|
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io", "identifierType" => "URL", "title" => "Front Matter", "type" => "Periodical")
|
80
80
|
end
|
81
81
|
|
82
|
+
it "ghost post with related_identifiers and link to peer-reviewed article" do
|
83
|
+
input = "https://rogue-scholar.org/api/posts/2bdebfc5-e02e-42c2-90c5-e873e2d0435d"
|
84
|
+
subject = described_class.new(input: input)
|
85
|
+
expect(subject.valid?).to be true
|
86
|
+
expect(subject.id).to eq("https://doi.org/10.53731/r294649-6f79289-8cw18")
|
87
|
+
expect(subject.url).to eq("https://blog.front-matter.io/posts/nine-simple-ways-to-make-it-easier-to-re-use-your-data")
|
88
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "2bdebfc5-e02e-42c2-90c5-e873e2d0435d", "alternateIdentifierType" => "UUID" }])
|
89
|
+
expect(subject.type).to eq("Article")
|
90
|
+
expect(subject.contributors.length).to eq(1)
|
91
|
+
expect(subject.contributors.first).to eq("id" => "https://orcid.org/0000-0003-1419-2405", "familyName" => "Fenner", "givenName" => "Martin", "type" => "Person", "contributorRoles" => ["Author"])
|
92
|
+
expect(subject.titles).to eq([{ "title" => "Nine simple ways to make it easier to (re)use your data" }])
|
93
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
94
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
95
|
+
expect(subject.date).to eq("published" => "2013-06-25", "updated" => "2023-09-07")
|
96
|
+
expect(subject.descriptions.first["description"]).to start_with("This paper in markdown format was written by Ethan White et al.")
|
97
|
+
expect(subject.publisher).to eq("name" => "Front Matter")
|
98
|
+
expect(subject.related_identifiers).to eq([{"id"=>"https://doi.org/10.4033/iee.2013.6b.6.f", "type"=>"IsPreprintOf"}])
|
99
|
+
expect(subject.subjects).to eq([{ "subject" => "Computer and information sciences" },
|
100
|
+
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
101
|
+
"subject" => "FOS: Computer and information sciences",
|
102
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
103
|
+
expect(subject.language).to eq("en")
|
104
|
+
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io", "identifierType" => "URL", "title" => "Front Matter", "type" => "Periodical")
|
105
|
+
end
|
106
|
+
|
82
107
|
it "ghost post with related_identifiers and funding" do
|
83
108
|
input = "https://rogue-scholar.org/api/posts/e58dc9c8-b870-4db2-8896-238b3246c551"
|
84
109
|
subject = described_class.new(input: input)
|
@@ -87,8 +112,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
87
112
|
expect(subject.url).to eq("https://blog.front-matter.io/posts/tracking-the-growth-of-the-pid-graph")
|
88
113
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "e58dc9c8-b870-4db2-8896-238b3246c551", "alternateIdentifierType" => "UUID" }])
|
89
114
|
expect(subject.type).to eq("Article")
|
90
|
-
expect(subject.
|
91
|
-
expect(subject.
|
115
|
+
expect(subject.contributors.length).to eq(1)
|
116
|
+
expect(subject.contributors.first).to eq("id" => "https://orcid.org/0000-0003-1419-2405", "familyName" => "Fenner", "givenName" => "Martin", "type" => "Person", "contributorRoles" => ["Author"])
|
92
117
|
expect(subject.titles).to eq([{ "title" => "Tracking the Growth of the PID Graph" }])
|
93
118
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
94
119
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -104,6 +129,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
104
129
|
expect(subject.language).to eq("en")
|
105
130
|
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io", "identifierType" => "URL", "title" => "Front Matter", "type" => "Periodical")
|
106
131
|
end
|
132
|
+
|
107
133
|
it "ghost post without doi" do
|
108
134
|
input = "https://rogue-scholar.org/api/posts/c3095752-2af0-40a4-a229-3ceb7424bce2"
|
109
135
|
subject = described_class.new(input: input)
|
@@ -112,9 +138,9 @@ describe Commonmeta::Metadata, vcr: true do
|
|
112
138
|
expect(subject.url).to eq("https://www.ideasurg.pub/residency-visual-abstract")
|
113
139
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "c3095752-2af0-40a4-a229-3ceb7424bce2", "alternateIdentifierType" => "UUID" }])
|
114
140
|
expect(subject.type).to eq("Article")
|
115
|
-
expect(subject.
|
116
|
-
expect(subject.
|
117
|
-
"id" => "https://orcid.org/0000-0003-0449-4469", "type" => "Person")
|
141
|
+
expect(subject.contributors.length).to eq(1)
|
142
|
+
expect(subject.contributors.first).to eq("familyName" => "Sathe", "givenName" => "Tejas S.",
|
143
|
+
"id" => "https://orcid.org/0000-0003-0449-4469", "type" => "Person", "contributorRoles" => ["Author"])
|
118
144
|
expect(subject.titles).to eq([{ "title" => "The Residency Visual Abstract" }])
|
119
145
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
120
146
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -137,8 +163,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
137
163
|
expect(subject.url).to eq("https://www.ideasurg.pub/academic-powerhouse")
|
138
164
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "153d65e1-f0e4-49a6-a969-33d2129800ba", "alternateIdentifierType" => "UUID" }])
|
139
165
|
expect(subject.type).to eq("Article")
|
140
|
-
expect(subject.
|
141
|
-
expect(subject.
|
166
|
+
expect(subject.contributors.length).to eq(1)
|
167
|
+
expect(subject.contributors.first).to eq("familyName" => "Sathe", "givenName" => "Tejas S.", "type" => "Person", "contributorRoles" => ["Author"],
|
142
168
|
"id" => "https://orcid.org/0000-0003-0449-4469")
|
143
169
|
expect(subject.titles).to eq([{ "title" => "How to Build an Academic Powerhouse: Let's Study Who's Doing it" }])
|
144
170
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
@@ -163,8 +189,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
163
189
|
expect(subject.url).to eq("https://syldavia-gazette.org/guinea-worms-chatgpt-neanderthals")
|
164
190
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "0022b9ef-525a-4a79-81ad-13411697f58a", "alternateIdentifierType" => "UUID" }])
|
165
191
|
expect(subject.type).to eq("Article")
|
166
|
-
expect(subject.
|
167
|
-
expect(subject.
|
192
|
+
expect(subject.contributors.length).to eq(1)
|
193
|
+
expect(subject.contributors.first).to eq("familyName" => "Fenner", "givenName" => "Martin", "id" => "https://orcid.org/0000-0003-1419-2405", "type" => "Person", "contributorRoles" => ["Author"])
|
168
194
|
expect(subject.titles).to eq([{ "title" => "Guinea Worms, ChatGPT, Neanderthals, Plagiarism, Tidyverse" }])
|
169
195
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
170
196
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -186,8 +212,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
186
212
|
expect(subject.url).to eq("https://wisspub.net/2023/05/23/eu-mitgliedstaaten-betonen-die-rolle-von-wissenschaftsgeleiteten-open-access-modellen-jenseits-von-apcs")
|
187
213
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "1c578558-1324-4493-b8af-84c49eabc52f", "alternateIdentifierType" => "UUID" }])
|
188
214
|
expect(subject.type).to eq("Article")
|
189
|
-
expect(subject.
|
190
|
-
expect(subject.
|
215
|
+
expect(subject.contributors.length).to eq(1)
|
216
|
+
expect(subject.contributors.first).to eq("familyName" => "Pampel", "givenName" => "Heinz", "id" => "https://orcid.org/0000-0003-3334-2771", "type" => "Person", "contributorRoles" => ["Author"])
|
191
217
|
expect(subject.titles).to eq([{ "title" => "EU-Mitgliedstaaten betonen die Rolle von wissenschaftsgeleiteten Open-Access-Modellen jenseits von APCs" }])
|
192
218
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
193
219
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -209,8 +235,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
209
235
|
expect(subject.id).to eq("https://doi.org/10.59350/hke8v-d1e66")
|
210
236
|
expect(subject.url).to eq("https://svpow.com/2023/06/09/new-paper-curtice-et-al-2023-on-the-first-haplocanthosaurus-from-dry-mesa")
|
211
237
|
expect(subject.type).to eq("Article")
|
212
|
-
expect(subject.
|
213
|
-
expect(subject.
|
238
|
+
expect(subject.contributors.length).to eq(1)
|
239
|
+
expect(subject.contributors.first).to eq("familyName" => "Wedel", "givenName" => "Matt", "type" => "Person", "contributorRoles" => ["Author"])
|
214
240
|
expect(subject.titles).to eq([{ "title" => "New paper: Curtice et al. (2023) on the first Haplocanthosaurus from Dry Mesa" }])
|
215
241
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
216
242
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -234,8 +260,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
234
260
|
expect(subject.id).to eq("https://doi.org/10.59350/tpa8t-j6292")
|
235
261
|
expect(subject.url).to eq("https://www.samuelmoore.org/2023/04/20/how-to-cultivate-good-closures-scaling-small-and-the-limits-of-openness")
|
236
262
|
expect(subject.type).to eq("Article")
|
237
|
-
expect(subject.
|
238
|
-
expect(subject.
|
263
|
+
expect(subject.contributors.length).to eq(1)
|
264
|
+
expect(subject.contributors.first).to eq("familyName" => "Moore", "givenName" => "Samuel", "id" => "https://orcid.org/0000-0002-0504-2897", "type" => "Person", "contributorRoles" => ["Author"])
|
239
265
|
expect(subject.titles).to eq([{ "title" => "How to cultivate good closures: ‘scaling small’ and the limits of openness" }])
|
240
266
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
241
267
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -258,8 +284,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
258
284
|
expect(subject.id).to eq("https://doi.org/10.59350/tfahc-rp566")
|
259
285
|
expect(subject.url).to eq("https://blog.oa.works/nature-features-oa-reports-work-putting-oa-policy-into-practice")
|
260
286
|
expect(subject.type).to eq("Article")
|
261
|
-
expect(subject.
|
262
|
-
expect(subject.
|
287
|
+
expect(subject.contributors.length).to eq(1)
|
288
|
+
expect(subject.contributors.first).to eq("name" => "OA.Works", "type" => "Organization", "contributorRoles" => ["Author"])
|
263
289
|
expect(subject.titles).to eq([{ "title" => "Nature features OA.Report's work putting OA policy into practice!" }])
|
264
290
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
265
291
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -282,8 +308,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
282
308
|
expect(subject.url).to eq("https://upstream.force11.org/the-research-software-alliance-resa")
|
283
309
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "954f8138-0ecd-4090-87c5-cef1297f1470", "alternateIdentifierType" => "UUID" }])
|
284
310
|
expect(subject.type).to eq("Article")
|
285
|
-
expect(subject.
|
286
|
-
expect(subject.
|
311
|
+
expect(subject.contributors.length).to eq(2)
|
312
|
+
expect(subject.contributors.first).to eq("familyName" => "Katz", "givenName" => "Daniel S.", "id" => "https://orcid.org/0000-0001-5934-7525", "type" => "Person", "contributorRoles" => ["Author"])
|
287
313
|
expect(subject.titles).to eq([{ "title" => "The Research Software Alliance (ReSA)" }])
|
288
314
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
289
315
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -308,9 +334,9 @@ describe Commonmeta::Metadata, vcr: true do
|
|
308
334
|
expect(subject.url).to eq("https://citationstyles.org/2020/07/11/seeking-public-comment-on-CSL-1-0-2")
|
309
335
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "efdacb04-bcec-49d7-b689-ab3eab0634bf", "alternateIdentifierType" => "UUID" }])
|
310
336
|
expect(subject.type).to eq("Article")
|
311
|
-
expect(subject.
|
312
|
-
expect(subject.
|
313
|
-
"id" => "https://orcid.org/0000-0001-8249-7388", "type" => "Person")
|
337
|
+
expect(subject.contributors.length).to eq(1)
|
338
|
+
expect(subject.contributors.first).to eq("familyName" => "Karcher", "givenName" => "Sebastian",
|
339
|
+
"id" => "https://orcid.org/0000-0001-8249-7388", "type" => "Person", "contributorRoles" => ["Author"])
|
314
340
|
expect(subject.titles).to eq([{ "title" => "Seeking Public Comment on CSL 1.0.2 Release" }])
|
315
341
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
316
342
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -333,8 +359,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
333
359
|
expect(subject.url).to eq("https://libscie.org/ku-leuven-supports-researchequals")
|
334
360
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "5561f8e4-2ff1-4186-a8d5-8dacb3afe414", "alternateIdentifierType" => "UUID" }])
|
335
361
|
expect(subject.type).to eq("Article")
|
336
|
-
expect(subject.
|
337
|
-
expect(subject.
|
362
|
+
expect(subject.contributors.length).to eq(1)
|
363
|
+
expect(subject.contributors.first).to eq("id" => "https://ror.org/0342dzm54", "name" => "Liberate Science", "type" => "Organization", "contributorRoles" => ["Author"])
|
338
364
|
expect(subject.titles).to eq([{ "title" => "KU Leuven supports ResearchEquals" }])
|
339
365
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
340
366
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -358,8 +384,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
358
384
|
expect(subject.url).to eq("https://lab.sub.uni-goettingen.de/welcome.html")
|
359
385
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "a163e340-5b3c-4736-9ab0-8c54fdff6a3c", "alternateIdentifierType" => "UUID" }])
|
360
386
|
expect(subject.type).to eq("Article")
|
361
|
-
expect(subject.
|
362
|
-
expect(subject.
|
387
|
+
expect(subject.contributors.length).to eq(1)
|
388
|
+
expect(subject.contributors.first).to eq("familyName" => "Göbel", "givenName" => "Mathias", "type" => "Person", "contributorRoles" => ["Author"])
|
363
389
|
expect(subject.titles).to eq([{ "title" => "Welcome to the Lab" }])
|
364
390
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
365
391
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -383,8 +409,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
383
409
|
expect(subject.url).to eq("http://sfmatheson.blogspot.com/2023/01/quintessence-of-dust-2023-restart-why.html")
|
384
410
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "1898d2d7-4d87-4487-96c4-3073cf99e9a5", "alternateIdentifierType" => "UUID" }])
|
385
411
|
expect(subject.type).to eq("Article")
|
386
|
-
expect(subject.
|
387
|
-
expect(subject.
|
412
|
+
expect(subject.contributors.length).to eq(1)
|
413
|
+
expect(subject.contributors.first).to eq("familyName" => "Matheson", "givenName" => "Stephen", "type" => "Person", "contributorRoles" => ["Author"])
|
388
414
|
expect(subject.titles).to eq([{ "title" => "Quintessence of Dust 2023 restart: the why" }])
|
389
415
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
390
416
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -408,8 +434,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
408
434
|
expect(subject.url).to eq("https://flavoursofopen.science/grundlagen-fur-die-entwicklung-einer-open-scholarship-strategie")
|
409
435
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "f3dc29da-0481-4f3b-8110-4c07260fca67", "alternateIdentifierType" => "UUID" }])
|
410
436
|
expect(subject.type).to eq("Article")
|
411
|
-
expect(subject.
|
412
|
-
expect(subject.
|
437
|
+
expect(subject.contributors.length).to eq(1)
|
438
|
+
expect(subject.contributors.first).to eq("familyName" => "Steiner", "givenName" => "Tobias", "id" => "https://orcid.org/0000-0002-3158-3136", "type" => "Person", "contributorRoles" => ["Author"])
|
413
439
|
expect(subject.titles).to eq([{ "title" => "Grundlagen für die Entwicklung einer Open Scholarship-Strategie" }])
|
414
440
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
415
441
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -434,8 +460,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
434
460
|
expect(subject.url).to eq("https://markrubin.substack.com/p/the-preregistration-prescriptiveness")
|
435
461
|
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "2b105b29-acbc-4eae-9ff1-368803f36a4d", "alternateIdentifierType" => "UUID" }])
|
436
462
|
expect(subject.type).to eq("Article")
|
437
|
-
expect(subject.
|
438
|
-
expect(subject.
|
463
|
+
expect(subject.contributors.length).to eq(1)
|
464
|
+
expect(subject.contributors.first).to eq("familyName" => "Rubin", "givenName" => "Mark", "type" => "Person", "contributorRoles" => ["Author"])
|
439
465
|
expect(subject.titles).to eq([{ "title" => "The Preregistration Prescriptiveness Trade-Off and Unknown Unknowns in Science" }])
|
440
466
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
441
467
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -1,67 +1,66 @@
|
|
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
|
-
subject { described_class.new(input: input, from:
|
6
|
+
subject { described_class.new(input: input, from: "npm") }
|
7
7
|
|
8
8
|
let(:input) { "#{fixture_path}cgimp_package.json" }
|
9
9
|
|
10
|
-
context
|
11
|
-
it
|
10
|
+
context "get npm raw" do
|
11
|
+
it "software" do
|
12
12
|
expect(subject.raw).to eq(File.read(input).strip)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
-
context
|
17
|
-
it
|
16
|
+
context "get npm metadata" do
|
17
|
+
it "minimal" do
|
18
18
|
expect(subject.valid?).to be false
|
19
|
-
expect(subject.errors.first).to eq(
|
19
|
+
expect(subject.errors.first).to eq("root is missing required keys: id, url, publisher, date")
|
20
20
|
# expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5438/4k3m-nyvg", "identifierType"=>"DOI"}])
|
21
21
|
# expect(subject.url).to eq("https://blog.datacite.org/eating-your-own-dog-food")
|
22
|
-
expect(subject.type).to eq(
|
23
|
-
expect(subject.
|
24
|
-
expect(subject.titles).to eq([{
|
22
|
+
expect(subject.type).to eq("Software")
|
23
|
+
expect(subject.contributors).to be_empty
|
24
|
+
expect(subject.titles).to eq([{ "title" => "fullstack_app" }])
|
25
25
|
expect(subject.descriptions.empty?).to be(true)
|
26
|
-
expect(subject.license).to eq(
|
27
|
-
|
28
|
-
expect(subject.version).to eq(
|
26
|
+
expect(subject.license).to eq("id" => "ISC",
|
27
|
+
"url" => "https://www.isc.org/downloads/software-support-policy/isc-license/")
|
28
|
+
expect(subject.version).to eq("1.0.0")
|
29
29
|
# expect(subject.dates).to eq([{"date"=>"2016-12-20", "dateType"=>"Issued"}])
|
30
30
|
# expect(subject.publication_year).to eq("2016")
|
31
31
|
end
|
32
32
|
|
33
|
-
it
|
33
|
+
it "minimal with description" do
|
34
34
|
input = "#{fixture_path}cit_package.json"
|
35
|
-
subject = described_class.new(input: input, from:
|
35
|
+
subject = described_class.new(input: input, from: "npm")
|
36
36
|
expect(subject.valid?).to be false
|
37
|
-
expect(subject.errors.first).to eq(
|
37
|
+
expect(subject.errors.first).to eq("root is missing required keys: id, url, publisher, date")
|
38
38
|
# expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5438/4k3m-nyvg", "identifierType"=>"DOI"}])
|
39
39
|
# expect(subject.url).to eq("https://blog.datacite.org/eating-your-own-dog-food")
|
40
|
-
expect(subject.type).to eq(
|
41
|
-
expect(subject.
|
42
|
-
expect(subject.titles).to eq([{
|
43
|
-
expect(subject.descriptions).to eq([{
|
44
|
-
|
45
|
-
expect(subject.version).to eq(
|
40
|
+
expect(subject.type).to eq("Software")
|
41
|
+
expect(subject.contributors).to be_empty
|
42
|
+
expect(subject.titles).to eq([{ "title" => "CITapp" }])
|
43
|
+
expect(subject.descriptions).to eq([{ "description" => "Concealed Information Test app",
|
44
|
+
"descriptionType" => "Abstract" }])
|
45
|
+
expect(subject.version).to eq("1.1.0")
|
46
46
|
# expect(subject.dates).to eq([{"date"=>"2016-12-20", "dateType"=>"Issued"}])
|
47
47
|
# expect(subject.publication_year).to eq("2016")
|
48
48
|
end
|
49
49
|
|
50
|
-
it
|
50
|
+
it "minimal with description" do
|
51
51
|
input = "#{fixture_path}edam_package.json"
|
52
|
-
subject = described_class.new(input: input, from:
|
52
|
+
subject = described_class.new(input: input, from: "npm")
|
53
53
|
expect(subject.valid?).to be false
|
54
|
-
expect(subject.errors.first).to eq(
|
54
|
+
expect(subject.errors.first).to eq("root is missing required keys: id, url, publisher, date")
|
55
55
|
# expect(subject.identifiers).to eq([{"identifier"=>"https://doi.org/10.5438/4k3m-nyvg", "identifierType"=>"DOI"}])
|
56
56
|
# expect(subject.url).to eq("https://blog.datacite.org/eating-your-own-dog-food")
|
57
|
-
expect(subject.type).to eq(
|
58
|
-
expect(subject.
|
59
|
-
|
60
|
-
expect(subject.titles).to eq([{
|
61
|
-
expect(subject.descriptions).to eq([{
|
62
|
-
|
63
|
-
|
64
|
-
expect(subject.version).to eq('1.0.0')
|
57
|
+
expect(subject.type).to eq("Software")
|
58
|
+
expect(subject.contributors).to eq([{ "familyName" => "Brancotte", "givenName" => "Bryan",
|
59
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
60
|
+
expect(subject.titles).to eq([{ "title" => "edam-browser" }])
|
61
|
+
expect(subject.descriptions).to eq([{ "description" => +"The EDAM Browser is a client-side web-based visualization javascript widget. Its goals are to help describing bio-related resources and service with EDAM, and to facilitate and foster community contributions to EDAM.",
|
62
|
+
"descriptionType" => "Abstract" }])
|
63
|
+
expect(subject.version).to eq("1.0.0")
|
65
64
|
# expect(subject.dates).to eq([{"date"=>"2016-12-20", "dateType"=>"Issued"}])
|
66
65
|
# expect(subject.publication_year).to eq("2016")
|
67
66
|
end
|
@@ -1,70 +1,70 @@
|
|
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
6
|
subject { described_class.new(input: input) }
|
7
7
|
|
8
8
|
let(:input) { "#{fixture_path}crossref.ris" }
|
9
9
|
|
10
|
-
context
|
11
|
-
it
|
10
|
+
context "detect format" do
|
11
|
+
it "extension" do
|
12
12
|
# expect(subject.valid?).to be true
|
13
13
|
end
|
14
14
|
|
15
|
-
it
|
15
|
+
it "string" do
|
16
16
|
described_class.new(input: File.read(input).strip)
|
17
17
|
# expect(subject.valid?).to be true
|
18
|
-
expect(subject.id).to eq(
|
18
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
context
|
23
|
-
it
|
22
|
+
context "get ris raw" do
|
23
|
+
it "Crossref DOI" do
|
24
24
|
expect(subject.raw).to eq(File.read(input).strip)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
context
|
29
|
-
it
|
28
|
+
context "get ris metadata" do
|
29
|
+
it "Crossref DOI" do
|
30
30
|
expect(subject.valid?).to be true
|
31
|
-
expect(subject.id).to eq(
|
32
|
-
expect(subject.type).to eq(
|
33
|
-
expect(subject.url).to eq(
|
34
|
-
expect(subject.
|
35
|
-
expect(subject.
|
36
|
-
|
37
|
-
|
38
|
-
expect(subject.titles).to eq([{
|
39
|
-
expect(subject.descriptions.first[
|
40
|
-
expect(subject.date).to eq(
|
41
|
-
expect(subject.container).to eq(
|
42
|
-
|
31
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
32
|
+
expect(subject.type).to eq("JournalArticle")
|
33
|
+
expect(subject.url).to eq("http://elifesciences.org/lookup/doi/10.7554/eLife.01567")
|
34
|
+
expect(subject.contributors.length).to eq(5)
|
35
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
36
|
+
"givenName" => "Martial",
|
37
|
+
"familyName" => "Sankar")
|
38
|
+
expect(subject.titles).to eq([{ "title" => "Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth" }])
|
39
|
+
expect(subject.descriptions.first["description"]).to start_with("Among various advantages, their small size makes model organisms preferred subjects of investigation.")
|
40
|
+
expect(subject.date).to eq("published" => "2014")
|
41
|
+
expect(subject.container).to eq("identifier" => "2050084X", "title" => "eLife",
|
42
|
+
"type" => "Journal", "volume" => "3")
|
43
43
|
end
|
44
44
|
|
45
|
-
it
|
45
|
+
it "DOI does not exist" do
|
46
46
|
input = "#{fixture_path}pure.ris"
|
47
|
-
doi =
|
47
|
+
doi = "10.7554/elife.01567"
|
48
48
|
subject = described_class.new(input: input, doi: doi)
|
49
49
|
expect(subject.valid?).to be false
|
50
|
-
expect(subject.state).to eq(
|
51
|
-
expect(subject.id).to eq(
|
52
|
-
expect(subject.type).to eq(
|
53
|
-
expect(subject.
|
54
|
-
expect(subject.titles).to eq([{
|
55
|
-
expect(subject.descriptions.first[
|
56
|
-
expect(subject.date).to eq(
|
50
|
+
expect(subject.state).to eq("not_found")
|
51
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
52
|
+
expect(subject.type).to eq("Dissertation")
|
53
|
+
expect(subject.contributors).to eq([{ "familyName" => "Toparlar", "givenName" => "Y.", "type" => "Person", "contributorRoles" => ["Author"] }])
|
54
|
+
expect(subject.titles).to eq([{ "title" => "A multiscale analysis of the urban heat island effect" }])
|
55
|
+
expect(subject.descriptions.first["description"]).to start_with("Designing the climates of cities")
|
56
|
+
expect(subject.date).to eq("created" => "2018-04-25", "published" => "2018-04-25")
|
57
57
|
end
|
58
58
|
|
59
|
-
it
|
59
|
+
it "RIS with Dashes" do
|
60
60
|
input = "#{fixture_path}ris_bug.ris"
|
61
|
-
abs =
|
62
|
-
doi =
|
61
|
+
abs = "3D image based subject specific models of the ankle complex can be extremely significant in a wide variety of clinical and biomechanical applications such as evaluating the effect of ligament ruptures, diagnosing and comparing surgical procedures. However, there are very few computational models that can accurately capture the full 3D biomechanical properties of the ankle complex. One such computational model was introduced by our group in 2004 [1], and this model was partially validated with a very limited set of parameters for comparison. In the current study, we have developed an improvised version of this model and validated it on a subject to subject basis for a number of specimens. This is achieved by comparing a wide range of biomechanical parameters between the experiments and the simulation. Once, the model is validated, it can be used for a wide variety of clinical and surgical applications .Some applications include comparing the effects of surface morphology on the kinematics of the ankle joint, diagnosing and evaluation of ankle disorders like ligament tears and reconstruction surgeries. Previous experimental studies conducted to understand and validate the effect of morphological variations to kinematics involved invasive surgical procedures and hence could only be conducted in cadaveric foot. Hence a need for a dynamic model which could predict and recreate the kinematics of an ankle using only CT and, or MRI data was realized. Such a model could help in development and non-invasive testing of subject specific TAR. This thesis focusses on the subject specific validation of rigid body models of four specimens and an one-to-one validation based on Load-displacement curves, Range of Motion, Surface-to-surface interaction and Ligament straining patterns. Post validation of the MBS model in MSC ADAMS, the model is used to investigate the effect of axial loads, total ankle arthrodesis and the effect of varying surface morphologies on the behavior of the ankle joint complex. An in-depth comparative analysis on the use of a numerical model for the development and performance evaluation of an implant derived from the morphological parameters of the ankle joint is also presented."
|
62
|
+
doi = "10.7554/elife.01567"
|
63
63
|
subject = described_class.new(input: input, doi: doi)
|
64
64
|
# expect(subject.valid?).to be true
|
65
|
-
expect(subject.id).to eq(
|
66
|
-
expect(subject.titles).to eq([{
|
67
|
-
expect(subject.descriptions.first[
|
65
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
66
|
+
expect(subject.titles).to eq([{ "title" => "Validation of an Image-based Subject-Specific Dynamic Model of the Ankle Joint Complex and its Applications to the Study of the Effect of Articular Surface Morphology on Ankle Joint Mechanics" }])
|
67
|
+
expect(subject.descriptions.first["description"]).to eq(abs)
|
68
68
|
end
|
69
69
|
end
|
70
70
|
end
|