commonmeta-ruby 3.2.13 → 3.2.15
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/crossref_utils.rb +3 -3
- data/lib/commonmeta/readers/json_feed_reader.rb +6 -2
- data/lib/commonmeta/readers/schema_org_reader.rb +1 -1
- data/lib/commonmeta/utils.rb +6 -3
- data/lib/commonmeta/version.rb +1 -1
- data/lib/commonmeta/writers/bibtex_writer.rb +1 -1
- data/lib/commonmeta/writers/ris_writer.rb +1 -1
- data/lib/commonmeta/writers/schema_org_writer.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/substack_post_with_broken_reference.yml +1316 -0
- data/spec/readers/cff_reader_spec.rb +33 -33
- data/spec/readers/codemeta_reader_spec.rb +8 -8
- data/spec/readers/json_feed_reader_spec.rb +204 -154
- data/spec/readers/schema_org_reader_spec.rb +38 -38
- data/spec/utils_spec.rb +3 -3
- data/spec/writers/bibtex_writer_spec.rb +3 -3
- data/spec/writers/cff_writer_spec.rb +2 -2
- data/spec/writers/crossref_xml_writer_spec.rb +21 -9
- data/spec/writers/ris_writer_spec.rb +8 -8
- data/spec/writers/schema_org_writer_spec.rb +6 -6
- metadata +3 -2
@@ -27,7 +27,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
27
27
|
'type' => 'Person' }])
|
28
28
|
expect(subject.titles).to eq([{ 'title' => 'Eating your own Dog Food' }])
|
29
29
|
expect(subject.descriptions.first['description']).to start_with('Eating your own dog food')
|
30
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
30
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Feature' }])
|
31
31
|
expect(subject.date).to eq('published' => '2016-12-20T00:00:00Z',
|
32
32
|
'updated' => '2022-08-15T09:06:22Z')
|
33
33
|
expect(subject.references.length).to eq(0)
|
@@ -56,8 +56,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
56
56
|
'type' => 'Person' }])
|
57
57
|
expect(subject.titles).to eq([{ 'title' => 'Eating your own Dog Food' }])
|
58
58
|
expect(subject.descriptions.first['description']).to start_with('Eating your own dog food')
|
59
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
60
|
-
{ 'subject' => '
|
59
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Datacite' }, { 'subject' => 'Doi' },
|
60
|
+
{ 'subject' => 'Metadata' }, { 'subject' => 'Featured' }])
|
61
61
|
expect(subject.date).to eq('created' => '2016-12-20',
|
62
62
|
'published' => '2016-12-20',
|
63
63
|
'updated' => '2016-12-20')
|
@@ -81,7 +81,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
81
81
|
'type' => 'Person' }])
|
82
82
|
expect(subject.titles).to eq([{ 'title' => 'A step forward for software citation: GitHub's enhanced software citation support' }])
|
83
83
|
expect(subject.descriptions.first['description']).to start_with('On August 19, GitHub announced software citation')
|
84
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
84
|
+
expect(subject.subjects).to eq([{ 'subject' => 'News' }])
|
85
85
|
expect(subject.date).to eq('published' => '2021-08-24T16:57:24Z',
|
86
86
|
'updated' => '2022-08-15T19:05:14Z')
|
87
87
|
expect(subject.references.length).to eq(0)
|
@@ -104,18 +104,18 @@ describe Commonmeta::Metadata, vcr: true do
|
|
104
104
|
expect(subject.creators.first).to eq('type' => 'Person', 'givenName' => 'Matthias',
|
105
105
|
'familyName' => 'Staib', 'id' => 'https://orcid.org/0000-0001-9688-838X', 'affiliation' => [{ 'name' => 'University of Zurich, Zurich, Switzerland' }])
|
106
106
|
expect(subject.publisher).to eq('name' => 'Zenodo')
|
107
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
108
|
-
{ 'subject' => '
|
109
|
-
{ 'subject' => '
|
110
|
-
{ 'subject' => '
|
111
|
-
{ 'subject' => '
|
112
|
-
{ 'subject' => '
|
113
|
-
{ 'subject' => '
|
114
|
-
{ 'subject' => '
|
115
|
-
{ 'subject' => '
|
116
|
-
{ 'subject' => '
|
117
|
-
{ 'subject' => '
|
118
|
-
{ 'subject' => '
|
107
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Pupil size response' },
|
108
|
+
{ 'subject' => 'Skin conductance response' },
|
109
|
+
{ 'subject' => 'Electrocardiogram' },
|
110
|
+
{ 'subject' => 'Electromyogram' },
|
111
|
+
{ 'subject' => 'Electrodermal activity' },
|
112
|
+
{ 'subject' => 'Galvanic skin response' },
|
113
|
+
{ 'subject' => 'Psr' },
|
114
|
+
{ 'subject' => 'Scr' },
|
115
|
+
{ 'subject' => 'Ecg' },
|
116
|
+
{ 'subject' => 'Emg' },
|
117
|
+
{ 'subject' => 'Eda' },
|
118
|
+
{ 'subject' => 'Gsr' }])
|
119
119
|
end
|
120
120
|
|
121
121
|
it 'pangaea' do
|
@@ -157,15 +157,15 @@ describe Commonmeta::Metadata, vcr: true do
|
|
157
157
|
expect(subject.creators).to eq([{
|
158
158
|
'name' => 'International Genetics of Ankylosing Spondylitis Consortium (IGAS)'
|
159
159
|
}])
|
160
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
160
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Medicine, health and life sciences' },
|
161
161
|
{ 'subject' => 'genome-wide association studies' },
|
162
|
-
{ 'subject' => '
|
162
|
+
{ 'subject' => 'Ankylosing spondylitis' }])
|
163
163
|
end
|
164
164
|
|
165
165
|
it 'upstream blog' do
|
166
166
|
input = 'https://upstream.force11.org/elife-reviewed-preprints-interview-with-fiona-hutton'
|
167
167
|
subject = described_class.new(input: input, from: 'schema_org')
|
168
|
-
|
168
|
+
expect(subject.valid?).to be true
|
169
169
|
expect(subject.id).to eq('https://doi.org/10.54900/8d7emer-rm2pg72')
|
170
170
|
expect(subject.type).to eq('Article')
|
171
171
|
expect(subject.titles).to eq([{ 'title' => 'eLife Reviewed Preprints: Interview with Fiona Hutton' }])
|
@@ -175,7 +175,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
175
175
|
expect(subject.creators.first).to eq('familyName' => 'Hutton',
|
176
176
|
'givenName' => 'Fiona',
|
177
177
|
'type' => 'Person')
|
178
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
178
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Interviews' }])
|
179
179
|
expect(subject.publisher).to eq('name' => 'Upstream')
|
180
180
|
expect(subject.date).to eq('published' => '2022-11-15T10:29:38Z',
|
181
181
|
'updated' => '2023-01-11T22:58:48Z')
|
@@ -210,8 +210,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
210
210
|
'type' => 'Person' }])
|
211
211
|
expect(subject.titles).to eq([{ 'title' => 'Eating your own Dog Food' }])
|
212
212
|
expect(subject.descriptions.first['description']).to start_with('Eating your own dog food')
|
213
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
214
|
-
{ 'subject' => '
|
213
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Datacite' }, { 'subject' => 'Doi' },
|
214
|
+
{ 'subject' => 'Metadata' }, { 'subject' => 'Featured' }])
|
215
215
|
expect(subject.date).to eq('created' => '2016-12-20',
|
216
216
|
'published' => '2016-12-20',
|
217
217
|
'updated' => '2016-12-20')
|
@@ -235,8 +235,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
235
235
|
'type' => 'Organization' }])
|
236
236
|
expect(subject.titles).to eq([{ 'title' => 'Fully processed, filtered and normalized gene expression matrices (in BED format) for each tissue, which were used as input into FastQTL for eQTL discovery' }])
|
237
237
|
expect(subject.version).to eq('v7')
|
238
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
239
|
-
{ 'subject' => '
|
238
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Gtex' }, { 'subject' => 'Annotation' },
|
239
|
+
{ 'subject' => 'Phenotype' }, { 'subject' => 'Gene regulation' }, { 'subject' => 'Transcriptomics' }])
|
240
240
|
expect(subject.date).to eq('published' => '2017')
|
241
241
|
expect(subject.container).to eq('title' => 'GTEx', 'type' => 'DataRepository')
|
242
242
|
expect(subject.publisher).to eq('name' => 'GTEx')
|
@@ -263,8 +263,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
263
263
|
expect(subject.type).to eq('Dataset')
|
264
264
|
expect(subject.creators).to eq([{ 'name' => 'TOPMed IRC', 'type' => 'Organization' }])
|
265
265
|
expect(subject.titles).to eq([{ 'title' => 'NWD165827.recab.cram' }])
|
266
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
267
|
-
{ 'subject' => '
|
266
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Topmed' },
|
267
|
+
{ 'subject' => 'Whole genome sequencing' }])
|
268
268
|
expect(subject.date).to eq('published' => '2017-11-30')
|
269
269
|
expect(subject.publisher).to eq('name' => 'TOPMed')
|
270
270
|
expect(subject.references).to eq([{ 'doi' => '10.23725/2g4s-qv04',
|
@@ -292,14 +292,14 @@ describe Commonmeta::Metadata, vcr: true do
|
|
292
292
|
expect(subject.creators.first).to eq('familyName' => 'Bales', 'givenName' => 'Roger',
|
293
293
|
'type' => 'Person')
|
294
294
|
expect(subject.titles).to eq([{ 'title' => 'Southern Sierra Critical Zone Observatory (SSCZO), Providence Creek meteorological data, soil moisture and temperature, snow depth and air temperature' }])
|
295
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
296
|
-
{ 'subject' => '
|
297
|
-
{ 'subject' => '
|
298
|
-
{ 'subject' => '
|
299
|
-
{ 'subject' => '
|
300
|
-
{ 'subject' => '
|
301
|
-
{ 'subject' => '
|
302
|
-
{ 'subject' => '
|
295
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Earth sciences' },
|
296
|
+
{ 'subject' => 'Soil moisture' },
|
297
|
+
{ 'subject' => 'Soil temperature' },
|
298
|
+
{ 'subject' => 'Snow depth' },
|
299
|
+
{ 'subject' => 'Air temperature' },
|
300
|
+
{ 'subject' => 'Water balance' },
|
301
|
+
{ 'subject' => 'Nevada' },
|
302
|
+
{ 'subject' => 'Sierra (mountain range)' }])
|
303
303
|
expect(subject.date).to eq('published' => '2013', 'updated' => '2014-10-17')
|
304
304
|
expect(subject.publisher).to eq('name' => 'UC Merced')
|
305
305
|
expect(subject.funding_references).to eq([{ 'funderName' => 'National Science Foundation, Division of Earth Sciences, Critical Zone Observatories' }])
|
@@ -347,8 +347,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
347
347
|
expect(subject.type).to eq('Dataset')
|
348
348
|
expect(subject.creators).to eq([{ 'name' => 'TOPMed', 'type' => 'Organization' }])
|
349
349
|
expect(subject.titles).to eq([{ 'title' => 'NWD100953.recab.cram' }])
|
350
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
351
|
-
{ 'subject' => '
|
350
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Topmed' },
|
351
|
+
{ 'subject' => 'Whole genome sequencing' }])
|
352
352
|
expect(subject.date).to eq('published' => '2017-11-30')
|
353
353
|
expect(subject.publisher).to eq('name' => 'TOPMed')
|
354
354
|
expect(subject.funding_references).to eq([{
|
@@ -367,8 +367,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
367
367
|
# expect(subject.creators).to eq([{"familyName"=>"Lindman", "givenName"=>"Karin", "name"=>"Lindman, Karin", "nameIdentifiers"=>[{"nameIdentifier"=> "https://orcid.org/0000-0003-1298-517X", "nameIdentifierScheme"=>"ORCID", "schemeUri"=>"https://orcid.org"}], "type"=>"Person"}])
|
368
368
|
expect(subject.titles).to eq([{ 'title' => 'Ovary data from the Visual Sweden project DROID' }])
|
369
369
|
expect(subject.version).to eq('1.0')
|
370
|
-
expect(subject.subjects).to eq([{ 'subject' => '
|
371
|
-
{ 'subject' => '
|
370
|
+
expect(subject.subjects).to eq([{ 'subject' => 'Pathology' }, { 'subject' => 'Whole slide imaging' },
|
371
|
+
{ 'subject' => 'Annotated' }])
|
372
372
|
expect(subject.date).to eq('created' => '2019-01-09',
|
373
373
|
'published' => '2019-01-09',
|
374
374
|
'updated' => '2019-01-09')
|
data/spec/utils_spec.rb
CHANGED
@@ -582,7 +582,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
582
582
|
it "name_to_fos match" do
|
583
583
|
name = "Biological sciences"
|
584
584
|
response = subject.name_to_fos(name)
|
585
|
-
expect(response).to eq([{ "subject" => "
|
585
|
+
expect(response).to eq([{ "subject" => "Biological sciences" },
|
586
586
|
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
587
587
|
"subject" => "FOS: Biological sciences",
|
588
588
|
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
@@ -591,7 +591,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
591
591
|
it "name_to_fos for match" do
|
592
592
|
name = "Statistics"
|
593
593
|
response = subject.name_to_fos(name)
|
594
|
-
expect(response).to eq([{ "subject" => "
|
594
|
+
expect(response).to eq([{ "subject" => "Statistics" },
|
595
595
|
{ "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
|
596
596
|
"subject" => "FOS: Mathematics",
|
597
597
|
"subjectScheme" => "Fields of Science and Technology (FOS)" }])
|
@@ -600,7 +600,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
600
600
|
it "name_to_fos no match" do
|
601
601
|
name = "Random tag"
|
602
602
|
response = subject.name_to_fos(name)
|
603
|
-
expect(response).to eq([{ "subject" => "
|
603
|
+
expect(response).to eq([{ "subject" => "Random tag" }])
|
604
604
|
end
|
605
605
|
|
606
606
|
it "hsh_to_fos match" do
|
@@ -71,7 +71,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
71
71
|
expect(bibtex[:title]).to eq('Maremma: a Ruby library for simplified network calls')
|
72
72
|
expect(bibtex[:author]).to eq('Fenner, Martin')
|
73
73
|
expect(bibtex[:publisher]).to eq('DataCite')
|
74
|
-
expect(bibtex[:keywords]).to eq('
|
74
|
+
expect(bibtex[:keywords]).to eq('Faraday, excon, net/http')
|
75
75
|
expect(bibtex[:year]).to eq('2017')
|
76
76
|
expect(bibtex[:copyright]).to eq('MIT')
|
77
77
|
end
|
@@ -128,7 +128,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
128
128
|
expect(bibtex[:title]).to eq('Eating your own Dog Food')
|
129
129
|
expect(bibtex[:author]).to eq('Fenner, Martin')
|
130
130
|
expect(bibtex[:publisher]).to eq('Front Matter')
|
131
|
-
expect(bibtex[:keywords]).to eq('
|
131
|
+
expect(bibtex[:keywords]).to eq('Feature')
|
132
132
|
expect(bibtex[:year]).to eq('2016')
|
133
133
|
end
|
134
134
|
|
@@ -152,7 +152,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
152
152
|
expect(bibtex[:bibtex_type].to_s).to eq('misc')
|
153
153
|
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.1594/pangaea.721193')
|
154
154
|
expect(bibtex[:doi]).to eq('10.1594/pangaea.721193')
|
155
|
-
expect(bibtex[:keywords]).to start_with('Animalia,
|
155
|
+
expect(bibtex[:keywords]).to start_with('Animalia, bottles or small containers/aquaria (<20 l)')
|
156
156
|
expect(bibtex[:year]).to eq('2007')
|
157
157
|
expect(bibtex[:copyright]).to eq('CC-BY-3.0')
|
158
158
|
end
|
@@ -73,8 +73,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
73
73
|
expect(json['abstract']).to eq('This library provides a Ruby interface to manipulate Citation File Format files')
|
74
74
|
expect(json['date-released']).to eq('2022-11-05')
|
75
75
|
expect(json['repository-code']).to eq('https://github.com/citation-file-format/ruby-cff')
|
76
|
-
expect(json['keywords']).to eq(['
|
77
|
-
'
|
76
|
+
expect(json['keywords']).to eq(['Ruby', 'Credit', 'Software citation', 'Research software',
|
77
|
+
'Software sustainability', 'Metadata', 'Citation file format', 'Cff'])
|
78
78
|
expect(json['license']).to eq('Apache-2.0')
|
79
79
|
expect(json['references']).to eq('identifiers' => [{ 'type' => 'doi',
|
80
80
|
'value' => '10.5281/zenodo.1003149' }])
|
@@ -68,7 +68,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
68
68
|
"givenName" => "Martin",
|
69
69
|
"id" => "https://orcid.org/0000-0003-1419-2405",
|
70
70
|
"type" => "Person" }])
|
71
|
-
expect(subject.subjects).to eq([{ "subject" => "
|
71
|
+
expect(subject.subjects).to eq([{ "subject" => "News" }])
|
72
72
|
expect(subject.language).to eq("en")
|
73
73
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
74
74
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -89,7 +89,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
89
89
|
"givenName" => "Martin",
|
90
90
|
"id" => "https://orcid.org/0000-0003-1419-2405",
|
91
91
|
"type" => "Person" }])
|
92
|
-
expect(subject.subjects).to eq([{ "subject" => "
|
92
|
+
expect(subject.subjects).to eq([{ "subject" => "Interview" }])
|
93
93
|
expect(subject.container).to eq("identifier" => "https://blog.front-matter.io/", "identifierType" => "URL",
|
94
94
|
"title" => "Front Matter", "type" => "Periodical")
|
95
95
|
expect(subject.language).to eq("en")
|
@@ -157,7 +157,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
157
157
|
expect(subject.creators.first).to eq("familyName" => "Hosseini",
|
158
158
|
"givenName" => "Mohammad",
|
159
159
|
"type" => "Person")
|
160
|
-
expect(subject.subjects).to eq([{ "subject" => "
|
160
|
+
expect(subject.subjects).to eq([{ "subject" => "News" }])
|
161
161
|
expect(subject.language).to eq("en")
|
162
162
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
163
163
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -181,7 +181,10 @@ describe Commonmeta::Metadata, vcr: true do
|
|
181
181
|
expect(subject.titles).to eq([{ "title" => "Attempts at automating journal subject classification" }])
|
182
182
|
expect(subject.creators.length).to eq(1)
|
183
183
|
expect(subject.creators.first).to eq("familyName" => "Datta", "givenName" => "Esha", "id" => "https://orcid.org/0000-0001-9165-2757", "type" => "Person")
|
184
|
-
expect(subject.subjects).to eq([{
|
184
|
+
expect(subject.subjects).to eq([{"subject"=>"Humanities"},
|
185
|
+
{"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
186
|
+
"subject"=>"FOS: Humanities",
|
187
|
+
"subjectScheme"=>"Fields of Science and Technology (FOS)"}])
|
185
188
|
expect(subject.language).to eq("en")
|
186
189
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
187
190
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -191,7 +194,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
191
194
|
"person_name")).first).to eq("ORCID" => "https://orcid.org/0000-0001-9165-2757", "contributor_role" => "author", "given_name" => "Esha", "sequence" => "first", "surname" => "Datta")
|
192
195
|
expect(crossref_xml.dig("titles",
|
193
196
|
"title")).to eq("Attempts at automating journal subject classification")
|
194
|
-
expect(crossref_xml.dig('item_number')).to eq("__content__"=>"
|
197
|
+
expect(crossref_xml.dig('item_number')).to eq("__content__"=>"5d14ffacb9ac4e20bdc0d9248df4e80d", "item_number_type"=>"uuid")
|
198
|
+
expect(crossref_xml.dig('group_title')).to eq('Humanities')
|
195
199
|
end
|
196
200
|
|
197
201
|
it "json_feed_item with references" do
|
@@ -206,7 +210,10 @@ describe Commonmeta::Metadata, vcr: true do
|
|
206
210
|
expect(subject.titles).to eq([{ "title" => "The Research Software Alliance (ReSA)" }])
|
207
211
|
expect(subject.creators.length).to eq(2)
|
208
212
|
expect(subject.creators.first).to eq("familyName"=>"Katz", "givenName"=>"Daniel S.", "id"=>"https://orcid.org/0000-0001-5934-7525", "type"=>"Person")
|
209
|
-
expect(subject.subjects).to eq([{
|
213
|
+
expect(subject.subjects).to eq([{"subject"=>"Humanities"},
|
214
|
+
{"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
215
|
+
"subject"=>"FOS: Humanities",
|
216
|
+
"subjectScheme"=>"Fields of Science and Technology (FOS)"}])
|
210
217
|
expect(subject.language).to eq("en")
|
211
218
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
212
219
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -219,7 +226,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
219
226
|
"title")).to eq("The Research Software Alliance (ReSA)")
|
220
227
|
expect(crossref_xml.dig("citation_list", "citation").length).to eq(11)
|
221
228
|
expect(crossref_xml.dig("citation_list", "citation").last).to eq("doi"=>"10.5281/zenodo.3699950", "key"=>"ref11")
|
222
|
-
expect(crossref_xml.dig('item_number')).to eq("__content__"=>"
|
229
|
+
expect(crossref_xml.dig('item_number')).to eq("__content__"=>"954f81380ecd409087c5cef1297f1470", "item_number_type"=>"uuid")
|
230
|
+
expect(crossref_xml.dig('group_title')).to eq('Humanities')
|
223
231
|
end
|
224
232
|
|
225
233
|
it "json_feed_item from rogue scholar with doi" do
|
@@ -233,7 +241,10 @@ describe Commonmeta::Metadata, vcr: true do
|
|
233
241
|
expect(subject.titles).to eq([{ "title" => "EU-Mitgliedstaaten betonen die Rolle von wissenschaftsgeleiteten Open-Access-Modellen jenseits von APCs" }])
|
234
242
|
expect(subject.creators.length).to eq(1)
|
235
243
|
expect(subject.creators.first).to eq("familyName"=>"Pampel", "givenName"=>"Heinz", "id"=>"https://orcid.org/0000-0003-3334-2771", "type"=>"Person")
|
236
|
-
expect(subject.subjects).to eq([{"subject"=>"
|
244
|
+
expect(subject.subjects).to eq([{"subject"=>"Engineering and technology"},
|
245
|
+
{"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
246
|
+
"subject"=>"FOS: Engineering and technology",
|
247
|
+
"subjectScheme"=>"Fields of Science and Technology (FOS)"}])
|
237
248
|
expect(subject.language).to eq("de")
|
238
249
|
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
239
250
|
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
@@ -243,7 +254,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
243
254
|
"person_name")).first).to eq("ORCID"=>"https://orcid.org/0000-0003-3334-2771", "contributor_role"=>"author", "given_name"=>"Heinz", "sequence"=>"first", "surname"=>"Pampel")
|
244
255
|
expect(crossref_xml.dig("titles",
|
245
256
|
"title")).to eq("EU-Mitgliedstaaten betonen die Rolle von wissenschaftsgeleiteten Open-Access-Modellen jenseits von APCs")
|
246
|
-
expect(crossref_xml.dig('item_number')).to eq("__content__"=>"
|
257
|
+
expect(crossref_xml.dig('item_number')).to eq("__content__"=>"1c57855813244493b8af84c49eabc52f", "item_number_type"=>"uuid")
|
258
|
+
expect(crossref_xml.dig('group_title')).to eq('Engineering and technology')
|
247
259
|
end
|
248
260
|
end
|
249
261
|
end
|
@@ -56,7 +56,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
56
56
|
expect(ris[9]).to eq('DO - 10.3205/zma001102')
|
57
57
|
expect(ris[10]).to eq('UR - http://www.egms.de/en/journals/zma/2017-34/zma001102.shtml')
|
58
58
|
expect(ris[11]).to start_with('AB - Objective: Competence orientation')
|
59
|
-
expect(ris[12]).to eq('KW -
|
59
|
+
expect(ris[12]).to eq('KW - Medical competence')
|
60
60
|
expect(ris[22]).to eq('PY - 2017')
|
61
61
|
expect(ris[23]).to eq('PB - German Medical Science GMS Publishing House')
|
62
62
|
expect(ris[24]).to eq('LA - en')
|
@@ -94,8 +94,8 @@ describe Commonmeta::Metadata, vcr: true do
|
|
94
94
|
expect(ris[3]).to eq('DO - 10.5438/4k3m-nyvg')
|
95
95
|
expect(ris[4]).to eq('UR - https://blog.datacite.org/eating-your-own-dog-food/')
|
96
96
|
expect(ris[5]).to eq('AB - Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...')
|
97
|
-
expect(ris[6]).to eq('KW -
|
98
|
-
expect(ris[9]).to eq('KW -
|
97
|
+
expect(ris[6]).to eq('KW - Datacite')
|
98
|
+
expect(ris[9]).to eq('KW - Fos: computer and information sciences')
|
99
99
|
expect(ris[10]).to eq('PY - 2016')
|
100
100
|
expect(ris[11]).to eq('PB - DataCite')
|
101
101
|
expect(ris[12]).to eq('LA - en')
|
@@ -114,7 +114,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
114
114
|
expect(ris[4]).to eq('DO - 10.5438/4k3m-nyvg')
|
115
115
|
expect(ris[5]).to eq('UR - https://blog.datacite.org/eating-your-own-dog-food')
|
116
116
|
expect(ris[6]).to eq('AB - Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...')
|
117
|
-
expect(ris[7]).to eq('KW -
|
117
|
+
expect(ris[7]).to eq('KW - Phylogeny')
|
118
118
|
expect(ris[14]).to eq('PY - 2016')
|
119
119
|
expect(ris[15]).to eq('PB - DataCite')
|
120
120
|
expect(ris[16]).to eq('ER - ')
|
@@ -129,7 +129,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
129
129
|
expect(ris[2]).to eq('AU - Fenner, Martin')
|
130
130
|
expect(ris[3]).to eq('DO - 10.5438/4k3m-nyvg')
|
131
131
|
expect(ris[4]).to eq('AB - Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...')
|
132
|
-
expect(ris[5]).to eq('KW -
|
132
|
+
expect(ris[5]).to eq('KW - Datacite')
|
133
133
|
expect(ris[8]).to eq('PY - 2016')
|
134
134
|
expect(ris[9]).to eq('PB - DataCite')
|
135
135
|
expect(ris[10]).to eq('ER - ')
|
@@ -146,7 +146,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
146
146
|
expect(ris[4]).to eq('DO - 10.53731/r79vxn1-97aq74v-ag58n')
|
147
147
|
expect(ris[5]).to eq('UR - https://blog.front-matter.io/posts/eating-your-own-dog-food')
|
148
148
|
expect(ris[6]).to eq('AB - Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for the scholarly outputs we produce. For the most part this is not research data, but rather technical documents such as the DataCite Schema and its documentation (2016). These outputs also include the posts on this blog, where we discuss topics relev')
|
149
|
-
expect(ris[7]).to eq('KW -
|
149
|
+
expect(ris[7]).to eq('KW - Feature')
|
150
150
|
expect(ris[8]).to eq('PY - 2016')
|
151
151
|
expect(ris[9]).to eq('PB - Front Matter')
|
152
152
|
expect(ris[10]).to eq('LA - en')
|
@@ -180,7 +180,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
180
180
|
expect(ris[3]).to eq('DO - 10.5438/qeg0-3gm3')
|
181
181
|
expect(ris[4]).to eq('UR - https://github.com/datacite/maremma')
|
182
182
|
expect(ris[5]).to eq('AB - Ruby utility library for network requests. Based on Faraday and Excon, provides a wrapper for XML/JSON parsing and error handling. All successful responses are returned as hash with key data, all errors in a JSONAPI-friendly hash with key errors.')
|
183
|
-
expect(ris[6]).to eq('KW -
|
183
|
+
expect(ris[6]).to eq('KW - Faraday')
|
184
184
|
expect(ris[9]).to eq('PY - 2017')
|
185
185
|
expect(ris[10]).to eq('PB - DataCite')
|
186
186
|
expect(ris[11]).to eq('ER - ')
|
@@ -196,7 +196,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
196
196
|
expect(ris[5]).to eq('DO - 10.1594/pangaea.721193')
|
197
197
|
expect(ris[6]).to eq('UR - https://doi.pangaea.de/10.1594/PANGAEA.721193')
|
198
198
|
expect(ris[8]).to eq('KW - Animalia')
|
199
|
-
expect(ris[9]).to eq('KW - Bottles or small containers/
|
199
|
+
expect(ris[9]).to eq('KW - Bottles or small containers/aquaria (<20 l)')
|
200
200
|
expect(ris[51]).to eq('PY - 2007')
|
201
201
|
expect(ris[52]).to eq('PB - PANGAEA')
|
202
202
|
expect(ris[53]).to eq('LA - en')
|
@@ -64,7 +64,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
64
64
|
expect(json['@id']).to eq('https://doi.org/10.5061/dryad.8515')
|
65
65
|
expect(json['@type']).to eq('Dataset')
|
66
66
|
expect(json['license']).to eq('https://creativecommons.org/publicdomain/zero/1.0/legalcode')
|
67
|
-
expect(json['keywords']).to eq('Plasmodium, malaria, mitochondrial genome,
|
67
|
+
expect(json['keywords']).to eq('Plasmodium, malaria, mitochondrial genome, parasites')
|
68
68
|
end
|
69
69
|
|
70
70
|
it 'Schema.org JSON Cyark' do
|
@@ -97,7 +97,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
97
97
|
{ '@type' => 'Organization',
|
98
98
|
'name' => 'University of California, Santa Barbara' }])
|
99
99
|
expect(json['version']).to eq('2.0.0')
|
100
|
-
expect(json['keywords']).to eq('
|
100
|
+
expect(json['keywords']).to eq('Data sharing, data repository, dataone')
|
101
101
|
end
|
102
102
|
|
103
103
|
it 'Funding' do
|
@@ -129,7 +129,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
129
129
|
expect(json['@id']).to eq('https://doi.org/10.4232/1.2745')
|
130
130
|
expect(json['@type']).to eq('Dataset')
|
131
131
|
expect(json['name']).to eq('Flash Eurobarometer 54 (Madrid Summit)')
|
132
|
-
expect(json['keywords']).to eq('
|
132
|
+
expect(json['keywords']).to eq('Kat12 international institutions, relations, conditions, internationale politik und internationale organisationen, wirtschaftssysteme und wirtschaftliche entwicklung, international politics and organisations, economic systems and development')
|
133
133
|
end
|
134
134
|
|
135
135
|
it 'subject scheme multiple keywords' do
|
@@ -139,7 +139,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
139
139
|
expect(json['@id']).to eq('https://doi.org/10.1594/pangaea.721193')
|
140
140
|
expect(json['@type']).to eq('Dataset')
|
141
141
|
expect(json['name']).to eq('Seawater carbonate chemistry and processes during experiments with Crassostrea gigas, 2007')
|
142
|
-
expect(json['keywords']).to include('Animalia,
|
142
|
+
expect(json['keywords']).to include('Animalia, bottles or small containers/aquaria (<20 l)')
|
143
143
|
expect(json['license']).to eq('https://creativecommons.org/licenses/by/3.0/legalcode')
|
144
144
|
end
|
145
145
|
|
@@ -224,7 +224,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
224
224
|
expect(json['name']).to eq('Fully processed, filtered and normalized gene expression matrices (in BED format) for each tissue, which were used as input into FastQTL for eQTL discovery')
|
225
225
|
expect(json['version']).to eq('v7')
|
226
226
|
expect(json['author']).to eq('@type' => 'Organization', 'name' => 'The GTEx Consortium')
|
227
|
-
expect(json['keywords']).to eq('
|
227
|
+
expect(json['keywords']).to eq('Gtex, annotation, phenotype, gene regulation, transcriptomics')
|
228
228
|
expect(json['datePublished']).to eq('2017')
|
229
229
|
expect(json['contentUrl']).to eq('https://storage.googleapis.com/gtex_analysis_v7/single_tissue_eqtl_data/GTEx_Analysis_v7_eQTL_expression_matrices.tar.gz')
|
230
230
|
expect(json['schemaVersion']).to eq('http://datacite.org/schema/kernel-4')
|
@@ -275,7 +275,7 @@ describe Commonmeta::Metadata, vcr: true do
|
|
275
275
|
expect(json['additionalType']).to eq('CRAM file')
|
276
276
|
expect(json['name']).to eq('NWD165827.recab.cram')
|
277
277
|
expect(json['author']).to eq('@type' => 'Organization', 'name' => 'TOPMed IRC')
|
278
|
-
expect(json['keywords']).to eq('
|
278
|
+
expect(json['keywords']).to eq('Topmed, whole genome sequencing')
|
279
279
|
expect(json['datePublished']).to eq('2017-11-30')
|
280
280
|
expect(json['contentUrl']).to eq([
|
281
281
|
's3://cgp-commons-public/topmed_open_access/197bc047-e917-55ed-852d-d563cdbc50e4/NWD165827.recab.cram', 'gs://topmed-irc-share/public/NWD165827.recab.cram'
|
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.2.
|
4
|
+
version: 3.2.15
|
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-06-
|
11
|
+
date: 2023-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -1185,6 +1185,7 @@ files:
|
|
1185
1185
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_doi.yml
|
1186
1186
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_without_doi.yml
|
1187
1187
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/jekyll_post.yml
|
1188
|
+
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/substack_post_with_broken_reference.yml
|
1188
1189
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/syldavia_gazette_post_with_references.yml
|
1189
1190
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/upstream_post_with_references.yml
|
1190
1191
|
- spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/wordpress_post.yml
|