commonmeta-ruby 3.2.12 → 3.2.14

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.
@@ -20,14 +20,14 @@ describe Commonmeta::Metadata, vcr: true do
20
20
  'type' => 'Organization' }])
21
21
  expect(subject.titles).to eq([{ 'title' => 'Ruby CFF Library' }])
22
22
  expect(subject.descriptions.first['description']).to start_with('This library provides a Ruby interface to manipulate Citation File Format files')
23
- expect(subject.subjects).to eq([{ 'subject' => 'ruby' },
24
- { 'subject' => 'credit' },
25
- { 'subject' => 'software citation' },
26
- { 'subject' => 'research software' },
27
- { 'subject' => 'software sustainability' },
28
- { 'subject' => 'metadata' },
29
- { 'subject' => 'citation file format' },
30
- { 'subject' => 'cff' }])
23
+ expect(subject.subjects).to eq([{ 'subject' => 'Ruby' },
24
+ { 'subject' => 'Credit' },
25
+ { 'subject' => 'Software citation' },
26
+ { 'subject' => 'Research software' },
27
+ { 'subject' => 'Software sustainability' },
28
+ { 'subject' => 'Metadata' },
29
+ { 'subject' => 'Citation file format' },
30
+ { 'subject' => 'Cff' }])
31
31
  expect(subject.version).to eq('1.0.1')
32
32
  expect(subject.date).to eq('published' => '2022-11-05')
33
33
  expect(subject.publisher).to eq('name' => 'GitHub')
@@ -69,15 +69,15 @@ describe Commonmeta::Metadata, vcr: true do
69
69
  'type' => 'Person' }])
70
70
  expect(subject.titles).to eq([{ 'title' => 'cffconvert' }])
71
71
  expect(subject.descriptions.first['description']).to start_with('Command line program to validate and convert CITATION.cff files')
72
- expect(subject.subjects).to eq([{ 'subject' => 'bibliography' },
73
- { 'subject' => 'bibtex' },
74
- { 'subject' => 'cff' },
75
- { 'subject' => 'citation' },
76
- { 'subject' => 'citation.cff' },
77
- { 'subject' => 'codemeta' },
78
- { 'subject' => 'endnote' },
79
- { 'subject' => 'ris' },
80
- { 'subject' => 'citation file format' }])
72
+ expect(subject.subjects).to eq([{ 'subject' => 'Bibliography' },
73
+ { 'subject' => 'Bibtex' },
74
+ { 'subject' => 'Cff' },
75
+ { 'subject' => 'Citation' },
76
+ { 'subject' => 'Citation.cff' },
77
+ { 'subject' => 'Codemeta' },
78
+ { 'subject' => 'Endnote' },
79
+ { 'subject' => 'Ris' },
80
+ { 'subject' => 'Citation file format' }])
81
81
  expect(subject.version).to eq('2.0.0')
82
82
  expect(subject.date).to eq('published' => '2021-09-22')
83
83
  expect(subject.publisher).to eq('name' => 'GitHub')
@@ -98,14 +98,14 @@ describe Commonmeta::Metadata, vcr: true do
98
98
  'id' => 'https://orcid.org/0000-0002-9538-7919', 'type' => 'Person' }, { 'name' => 'The Ruby Citation File Format Developers', 'type' => 'Organization' }])
99
99
  expect(subject.titles).to eq([{ 'title' => 'Ruby CFF Library' }])
100
100
  expect(subject.descriptions.first['description']).to start_with('This library provides a Ruby interface to manipulate Citation File Format files')
101
- expect(subject.subjects).to eq([{ 'subject' => 'ruby' },
102
- { 'subject' => 'credit' },
103
- { 'subject' => 'software citation' },
104
- { 'subject' => 'research software' },
105
- { 'subject' => 'software sustainability' },
106
- { 'subject' => 'metadata' },
107
- { 'subject' => 'citation file format' },
108
- { 'subject' => 'cff' }])
101
+ expect(subject.subjects).to eq([{ 'subject' => 'Ruby' },
102
+ { 'subject' => 'Credit' },
103
+ { 'subject' => 'Software citation' },
104
+ { 'subject' => 'Research software' },
105
+ { 'subject' => 'Software sustainability' },
106
+ { 'subject' => 'Metadata' },
107
+ { 'subject' => 'Citation file format' },
108
+ { 'subject' => 'Cff' }])
109
109
  expect(subject.version).to eq('1.0.1')
110
110
  expect(subject.date).to eq('published' => '2022-11-05')
111
111
  expect(subject.publisher).to eq('name' => 'GitHub')
@@ -127,14 +127,14 @@ describe Commonmeta::Metadata, vcr: true do
127
127
  'id' => 'https://orcid.org/0000-0002-9538-7919', 'type' => 'Person' }, { 'name' => 'The Ruby Citation File Format Developers', 'type' => 'Organization' }])
128
128
  expect(subject.titles).to eq([{ 'title' => 'Ruby CFF Library' }])
129
129
  expect(subject.descriptions.first['description']).to start_with('This library provides a Ruby interface to manipulate Citation File Format files')
130
- expect(subject.subjects).to eq([{ 'subject' => 'ruby' },
131
- { 'subject' => 'credit' },
132
- { 'subject' => 'software citation' },
133
- { 'subject' => 'research software' },
134
- { 'subject' => 'software sustainability' },
135
- { 'subject' => 'metadata' },
136
- { 'subject' => 'citation file format' },
137
- { 'subject' => 'cff' }])
130
+ expect(subject.subjects).to eq([{ 'subject' => 'Ruby' },
131
+ { 'subject' => 'Credit' },
132
+ { 'subject' => 'Software citation' },
133
+ { 'subject' => 'Research software' },
134
+ { 'subject' => 'Software sustainability' },
135
+ { 'subject' => 'Metadata' },
136
+ { 'subject' => 'Citation file format' },
137
+ { 'subject' => 'Cff' }])
138
138
  expect(subject.version).to eq('1.0.1')
139
139
  expect(subject.date).to eq('published' => '2022-11-05')
140
140
  expect(subject.publisher).to eq('name' => 'GitHub')
@@ -28,8 +28,8 @@ describe Commonmeta::Metadata, vcr: true do
28
28
  'type' => 'Person' }])
29
29
  expect(subject.titles).to eq([{ 'title' => 'Maremma: a Ruby library for simplified network calls' }])
30
30
  expect(subject.descriptions.first['description']).to start_with('Ruby utility library for network requests')
31
- expect(subject.subjects).to eq([{ 'subject' => 'faraday' }, { 'subject' => 'excon' },
32
- { 'subject' => 'net/http' }])
31
+ expect(subject.subjects).to eq([{ 'subject' => 'Faraday' }, { 'subject' => 'Excon' },
32
+ { 'subject' => 'Net/http' }])
33
33
  expect(subject.date).to eq('created' => '2015-11-28',
34
34
  'published' => '2017-02-24',
35
35
  'updated' => '2017-02-24')
@@ -57,8 +57,8 @@ describe Commonmeta::Metadata, vcr: true do
57
57
  'type' => 'Organization' }])
58
58
  expect(subject.titles).to eq([{ 'title' => 'R Interface to the DataONE REST API' }])
59
59
  expect(subject.descriptions.first['description']).to start_with('Provides read and write access to data and metadata')
60
- expect(subject.subjects).to eq([{ 'subject' => 'data sharing' }, { 'subject' => 'data repository' },
61
- { 'subject' => 'dataone' }])
60
+ expect(subject.subjects).to eq([{ 'subject' => 'Data sharing' }, { 'subject' => 'Data repository' },
61
+ { 'subject' => 'Dataone' }])
62
62
  expect(subject.version).to eq('2.0.0')
63
63
  expect(subject.date).to eq('created' => '2016-05-27',
64
64
  'published' => '2016-05-27',
@@ -82,8 +82,8 @@ describe Commonmeta::Metadata, vcr: true do
82
82
  'type' => 'Person' }])
83
83
  expect(subject.titles).to eq([{ 'title' => 'Maremma: a Ruby library for simplified network calls' }])
84
84
  expect(subject.descriptions.first['description']).to start_with('Simplifies network calls')
85
- expect(subject.subjects).to eq([{ 'subject' => 'faraday' }, { 'subject' => 'excon' },
86
- { 'subject' => 'net/http' }])
85
+ expect(subject.subjects).to eq([{ 'subject' => 'Faraday' }, { 'subject' => 'Excon' },
86
+ { 'subject' => 'Net/http' }])
87
87
  expect(subject.date).to eq('created' => '2015-11-28',
88
88
  'published' => '2017-02-24',
89
89
  'updated' => '2017-02-24')
@@ -104,8 +104,8 @@ describe Commonmeta::Metadata, vcr: true do
104
104
  'type' => 'Person')
105
105
  expect(subject.titles).to eq([{ 'title' => 'DOI Registrations for Software' }])
106
106
  expect(subject.descriptions.first['description']).to start_with('Analysis of DataCite DOIs registered for software')
107
- expect(subject.subjects).to eq([{ 'subject' => 'doi' }, { 'subject' => 'software' },
108
- { 'subject' => 'codemeta' }])
107
+ expect(subject.subjects).to eq([{ 'subject' => 'Doi' }, { 'subject' => 'Software' },
108
+ { 'subject' => 'Codemeta' }])
109
109
  expect(subject.date).to eq('created' => '2018-03-09',
110
110
  'published' => '2018-05-17',
111
111
  'updated' => '2018-05-17')
@@ -22,7 +22,10 @@ describe Commonmeta::Metadata, vcr: true do
22
22
  expect(subject.date).to eq('published' => '2023-05-31')
23
23
  expect(subject.descriptions.first['description']).to start_with("As trailed on a Twitter thread last week I’ve been working on a manuscript describing the efforts to map taxonomic names to their original descriptions in the taxonomic literature.")
24
24
  expect(subject.publisher).to eq('name' => 'iPhylo')
25
- expect(subject.subjects).to be_nil
25
+ expect(subject.subjects).to eq([{"subject"=>"Natural sciences"},
26
+ {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
27
+ "subject"=>"FOS: Natural sciences",
28
+ "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
26
29
  expect(subject.language).to eq('en')
27
30
  expect(subject.container).to eq("identifier"=>"https://iphylo.blogspot.com/", "identifierType"=>"URL", "title"=>"iPhylo", "type"=>"Periodical")
28
31
  end
@@ -43,7 +46,10 @@ describe Commonmeta::Metadata, vcr: true do
43
46
  expect(subject.date).to eq('published' => '2023-05-16', 'updated' => '2023-05-16')
44
47
  expect(subject.descriptions.first['description']).to start_with("One question I have increasingly asked myself in the past few years. Meaning Can I run this open source software using Docker containers and a Docker Compose file?")
45
48
  expect(subject.publisher).to eq('name' => 'Front Matter')
46
- expect(subject.subjects).to eq([{"subject"=>"news"}])
49
+ expect(subject.subjects).to eq([{"subject"=>"Engineering and technology"},
50
+ {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
51
+ "subject"=>"FOS: Engineering and technology",
52
+ "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
47
53
  expect(subject.language).to eq('en')
48
54
  expect(subject.container).to eq("identifier"=>"https://blog.front-matter.io", "identifierType"=>"URL", "title"=>"Front Matter", "type"=>"Periodical")
49
55
  end
@@ -64,7 +70,10 @@ describe Commonmeta::Metadata, vcr: true do
64
70
  expect(subject.date).to eq('published' => '2023-04-08')
65
71
  expect(subject.descriptions.first['description']).to start_with("A graphical, user-friendly tool for programs to highlight important data to prospective applicants")
66
72
  expect(subject.publisher).to eq('name' => 'I.D.E.A.S.')
67
- expect(subject.subjects).to be_nil
73
+ expect(subject.subjects).to eq([{"subject"=>"Medical and health sciences"},
74
+ {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
75
+ "subject"=>"FOS: Medical and health sciences",
76
+ "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
68
77
  expect(subject.language).to eq('en')
69
78
  expect(subject.container).to eq("identifier"=>"https://www.ideasurg.pub/", "identifierType"=>"URL", "title"=>"I.D.E.A.S.", "type"=>"Periodical")
70
79
  end
@@ -85,7 +94,10 @@ describe Commonmeta::Metadata, vcr: true do
85
94
  expect(subject.date).to eq('published' => '2023-06-03')
86
95
  expect(subject.descriptions.first['description']).to start_with("A Data Exploration with Public Data from the Academic Surgical Congress")
87
96
  expect(subject.publisher).to eq('name' => 'I.D.E.A.S.')
88
- expect(subject.subjects).to eq([{"subject"=>"pre-print"}])
97
+ expect(subject.subjects).to eq([{"subject"=>"Medical and health sciences"},
98
+ {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
99
+ "subject"=>"FOS: Medical and health sciences",
100
+ "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
89
101
  expect(subject.language).to eq('en')
90
102
  expect(subject.container).to eq("identifier"=>"https://www.ideasurg.pub/", "identifierType"=>"URL", "title"=>"I.D.E.A.S.", "type"=>"Periodical")
91
103
  expect(subject.references).to be_nil
@@ -107,7 +119,7 @@ describe Commonmeta::Metadata, vcr: true do
107
119
  expect(subject.date).to eq('published' => '2023-02-01', 'updated' => '2023-04-13')
108
120
  expect(subject.descriptions.first['description']).to start_with("Guinea worm disease reaches all-time low: only 13* human cases reported in 2022")
109
121
  expect(subject.publisher).to eq('name' => 'Syldavia Gazette')
110
- expect(subject.subjects).to be_nil
122
+ expect(subject.subjects).to eq([{"subject"=>"Humanities"}, {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf", "subject"=>"FOS: Humanities", "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
111
123
  expect(subject.language).to eq('en')
112
124
  expect(subject.container).to eq("identifier"=>"https://syldavia-gazette.org", "identifierType"=>"URL", "title"=>"Syldavia Gazette", "type"=>"Periodical")
113
125
  expect(subject.references.length).to eq(5)
@@ -130,7 +142,10 @@ describe Commonmeta::Metadata, vcr: true do
130
142
  expect(subject.date).to eq('published' => '2023-05-23', 'updated' => '2023-05-23')
131
143
  expect(subject.descriptions.first['description']).to start_with("Die EU-Wissenschaftsministerien haben sich auf ihrer heutigen Sitzung in Brüssel unter dem Titel “Council conclusions on high-quality, transparent, open, trustworthy and equitable scholarly publishing”")
132
144
  expect(subject.publisher).to eq('name' => 'wisspub.net')
133
- expect(subject.subjects).to eq([{"subject"=>"open access"}, {"subject"=>"open access transformation"}, {"subject"=>"open science"}, {"subject"=>"eu"}])
145
+ expect(subject.subjects).to eq([{"subject"=>"Engineering and technology"},
146
+ {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
147
+ "subject"=>"FOS: Engineering and technology",
148
+ "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
134
149
  expect(subject.language).to eq('de')
135
150
  expect(subject.container).to eq("identifier"=>"https://wisspub.net", "identifierType"=>"URL", "title"=>"wisspub.net", "type"=>"Periodical")
136
151
  end
@@ -150,7 +165,10 @@ describe Commonmeta::Metadata, vcr: true do
150
165
  expect(subject.date).to eq('published' => '2023-06-09', 'updated' => '2023-06-09')
151
166
  expect(subject.descriptions.first['description']).to start_with("Haplocanthosaurus tibiae and dorsal vertebrae.")
152
167
  expect(subject.publisher).to eq('name' => 'Sauropod Vertebra Picture of the Week')
153
- expect(subject.subjects).to eq([{"subject"=>"#mte14"}, {"subject"=>"barosaurus"}, {"subject"=>"cervical"}, {"subject"=>"conferences"}, {"subject"=>"diplodocids"}])
168
+ expect(subject.subjects).to eq([{"subject"=>"Natural sciences"},
169
+ {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
170
+ "subject"=>"FOS: Natural sciences",
171
+ "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
154
172
  expect(subject.language).to eq('en')
155
173
  expect(subject.container).to eq("identifier"=>"https://svpow.com", "identifierType"=>"URL", "title"=>"Sauropod Vertebra Picture of the Week", "type"=>"Periodical")
156
174
  expect(subject.references.length).to eq(3)
@@ -173,7 +191,10 @@ describe Commonmeta::Metadata, vcr: true do
173
191
  expect(subject.date).to eq('published' => '2023-04-18', 'updated' => '2023-04-18')
174
192
  expect(subject.descriptions.first['description']).to start_with("Research software is a key part of most research today. As University of Manchester Professor Carole Goble has said, \"software is the ubiquitous instrument of science.\"")
175
193
  expect(subject.publisher).to eq('name' => 'Upstream')
176
- expect(subject.subjects).to eq([{"subject"=>"news"}])
194
+ expect(subject.subjects).to eq([{"subject"=>"Humanities"},
195
+ {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
196
+ "subject"=>"FOS: Humanities",
197
+ "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
177
198
  expect(subject.language).to eq('en')
178
199
  expect(subject.container).to eq("identifier"=>"https://upstream.force11.org", "identifierType"=>"URL", "title"=>"Upstream", "type"=>"Periodical")
179
200
  expect(subject.references.length).to eq(11)
@@ -196,7 +217,10 @@ describe Commonmeta::Metadata, vcr: true do
196
217
  expect(subject.date).to eq('published' => '2020-07-11', 'updated' => '2020-07-11')
197
218
  expect(subject.descriptions.first['description']).to start_with("Over the past few months, Citation Style Language developers have worked to address a backlog of feature requests. This work will be reflected in two upcoming releases.")
198
219
  expect(subject.publisher).to eq('name' => 'Citation Style Language')
199
- expect(subject.subjects).to be_nil
220
+ expect(subject.subjects).to eq([{"subject"=>"Engineering and technology"},
221
+ {"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
222
+ "subject"=>"FOS: Engineering and technology",
223
+ "subjectScheme"=>"Fields of Science and Technology (FOS)"}])
200
224
  expect(subject.language).to eq('en')
201
225
  expect(subject.container).to eq("identifier"=>"https://citationstyles.org/", "identifierType"=>"URL", "title"=>"Citation Style Language", "type"=>"Periodical")
202
226
  end
@@ -208,10 +232,14 @@ describe Commonmeta::Metadata, vcr: true do
208
232
  expect(response).to eq("ca2a7df4-f3b9-487c-82e9-27f54de75ea8")
209
233
  end
210
234
 
235
+ it 'not indexed posts' do
236
+ response = subject.get_json_feed_not_indexed('2023-01-01')
237
+ expect(response).to eq("ab58e412-06eb-42b7-b81a-d340825b9d48")
238
+ end
239
+
211
240
  it 'by blog_id' do
212
- response = subject.get_json_feed_by_blog('tyfqw20').split('\n')
213
- expect(response.length).to eq(25)
214
- expect(response.first).to eq("3e1278f6-e7c0-43e1-bb54-6829e1344c0d")
241
+ response = subject.get_json_feed_by_blog('tyfqw20')
242
+ expect(response).to eq("3e1278f6-e7c0-43e1-bb54-6829e1344c0d")
215
243
  end
216
244
  end
217
245
  end
@@ -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' => 'feature' }])
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' => 'datacite' }, { 'subject' => 'doi' },
60
- { 'subject' => 'metadata' }, { 'subject' => 'featured' }])
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' => 'news' }])
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' => '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' }])
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' => 'medicine, health and life sciences' },
160
+ expect(subject.subjects).to eq([{ 'subject' => 'Medicine, health and life sciences' },
161
161
  { 'subject' => 'genome-wide association studies' },
162
- { 'subject' => 'ankylosing spondylitis' }])
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
- # expect(subject.valid?).to be true
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' => 'interviews' }])
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' => 'datacite' }, { 'subject' => 'doi' },
214
- { 'subject' => 'metadata' }, { 'subject' => 'featured' }])
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' => 'gtex' }, { 'subject' => 'annotation' },
239
- { 'subject' => 'phenotype' }, { 'subject' => 'gene regulation' }, { 'subject' => 'transcriptomics' }])
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' => 'topmed' },
267
- { 'subject' => 'whole genome sequencing' }])
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' => '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)' }])
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' => 'topmed' },
351
- { 'subject' => 'whole genome sequencing' }])
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' => 'pathology' }, { 'subject' => 'whole slide imaging' },
371
- { 'subject' => 'annotated' }])
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" => "biological sciences" },
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" => "statistics" },
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" => "random tag" }])
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('faraday, excon, net/http')
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('feature')
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, Bottles or small containers/Aquaria (<20 L)')
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(['ruby', 'credit', 'software citation', 'research software',
77
- 'software sustainability', 'metadata', 'citation file format', 'cff'])
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" => "news" }])
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" => "interview" }])
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" => "news" }])
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([{ "subject" => "original research" }])
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__"=>"2x2kzts-edc9rgb-vg6s4j6-z9t0d56", "item_number_type"=>"uuid")
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([{ "subject" => "news" }])
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__"=>"4n9y0kg-3pd8288-fheey4m-qy53g93", "item_number_type"=>"uuid")
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"=>"open access"}, {"subject"=>"open access transformation"}, {"subject"=>"open science"}, {"subject"=>"eu"}])
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__"=>"way2ng-4s48j9v-hbw4rjf-aqh9f33", "item_number_type"=>"uuid")
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