commonmeta-ruby 3.2.13 → 3.2.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bac0bef429dfb0d6b215f3e9224dea78c3bae41ecc96dc9aa8c74fb45f14adc9
4
- data.tar.gz: fe9f8e4628fb8ea120f858d24fc803e8183693104be98ffc96c3b608c76ef2ea
3
+ metadata.gz: b549fc46c70c5962ee3c971968771a6e5f13124eb89b03aab36228afc94c01fe
4
+ data.tar.gz: 1545d0de4e821265cc19bb744456d025f6bc14ea52c19cbae2585a1d501501a4
5
5
  SHA512:
6
- metadata.gz: 14422b80a42b7c9093f9ca564486005248f9b2cfcde00a3d7a8f880844e50a62501bf0a516a83fff0a05ee123fe5aa7a990d3f2bc7c1f2d6b1fe25742b0c6dd4
7
- data.tar.gz: 2ed255c095195200bbf1ca9c9c5d9207541a3196df57c3e951c11610ce3e56d19ca2d1f19f446481f66beda29bc7cf5b1a25f6ac611f0102b16f0f02e29c3cbd
6
+ metadata.gz: 3d7a785d1fdbf3bd226a64f489ef12e37cb474fe0334c894e98c0a86b90fba23d02d937eed3bc4f4e710791209556ab2ece950e50491d48874e128e95f62c44e
7
+ data.tar.gz: cad955e4ba4066a42ff821f03437cfe09fb926c283785050d34682cc95e676d89d608f03ca63c18574d012e5fcad168c5f289cd7d465f525846c877e91368635
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- commonmeta-ruby (3.2.13)
4
+ commonmeta-ruby (3.2.14)
5
5
  activesupport (>= 4.2.5, < 8.0)
6
6
  addressable (~> 2.8.1, < 2.8.2)
7
7
  base32-url (>= 0.7.0, < 1)
@@ -89,7 +89,7 @@ module Commonmeta
89
89
  def insert_group_title(xml)
90
90
  return xml if subjects.blank?
91
91
 
92
- xml.group_title(subjects.first["subject"].titleize)
92
+ xml.group_title(subjects.first["subject"])
93
93
  end
94
94
 
95
95
  def insert_crossref_creators(xml)
@@ -264,8 +264,8 @@ module Commonmeta
264
264
  "item_number_type" => alternate_identifier["alternateIdentifierType"] ? alternate_identifier["alternateIdentifierType"].downcase : nil,
265
265
  }.compact
266
266
 
267
- # convert UUIDs into base32 encoded strings, as item_number can only be 32 characters long (UUIDv4 is 36 characters long)
268
- alternate_identifier["alternateIdentifier"] = Base32::URL.encode_uuid(alternate_identifier["alternateIdentifier"], split: 7, checksum: true) if alternate_identifier["alternateIdentifierType"] == "UUID"
267
+ # strip hyphen from UUIDs, as item_number can only be 32 characters long (UUIDv4 is 36 characters long)
268
+ alternate_identifier["alternateIdentifier"] = alternate_identifier["alternateIdentifier"].gsub('-','') if alternate_identifier["alternateIdentifierType"] == "UUID"
269
269
 
270
270
  xml.item_number(alternate_identifier["alternateIdentifier"], attributes)
271
271
  end
@@ -54,7 +54,7 @@ module Commonmeta
54
54
  end
55
55
  language = meta.fetch("language", nil) || meta.dig("blog", "language")
56
56
  state = id.present? || read_options.present? ? "findable" : "not_found"
57
- subjects = Array.wrap(meta.fetch("tags", nil)).reduce([]) do |sum, subject|
57
+ subjects = Array.wrap(meta.dig("blog", "category")).reduce([]) do |sum, subject|
58
58
  sum += name_to_fos(subject)
59
59
 
60
60
  sum
@@ -208,7 +208,7 @@ module Commonmeta
208
208
 
209
209
  # handle keywords as array and as comma-separated string
210
210
  subjects = meta.fetch('keywords', nil)
211
- subjects = subjects.to_s.downcase.split(', ') if subjects.is_a?(String)
211
+ subjects = subjects.to_s.split(', ') if subjects.is_a?(String)
212
212
  subjects = Array.wrap(subjects).reduce([]) do |sum, subject|
213
213
  sum += name_to_fos(subject)
214
214
  sum
@@ -1253,6 +1253,9 @@ module Commonmeta
1253
1253
  end
1254
1254
 
1255
1255
  def name_to_fos(name)
1256
+ # make sure name is capitalized
1257
+ name = name.capitalize
1258
+
1256
1259
  # first find subject in Fields of Science (OECD)
1257
1260
  fos = JSON.load(File.read(File.expand_path("../../resources/oecd/fos-mappings.json",
1258
1261
  __dir__))).fetch("fosFields")
@@ -1261,7 +1264,7 @@ module Commonmeta
1261
1264
 
1262
1265
  if subject
1263
1266
  return [{
1264
- "subject" => sanitize(name).downcase,
1267
+ "subject" => sanitize(name),
1265
1268
  },
1266
1269
  {
1267
1270
  "subject" => "FOS: " + subject["fosLabel"],
@@ -1282,7 +1285,7 @@ module Commonmeta
1282
1285
 
1283
1286
  if subject
1284
1287
  [{
1285
- "subject" => sanitize(name).downcase,
1288
+ "subject" => sanitize(name),
1286
1289
  },
1287
1290
  {
1288
1291
  "subject" => "FOS: " + subject["fosLabel"],
@@ -1290,7 +1293,7 @@ module Commonmeta
1290
1293
  "schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf",
1291
1294
  }]
1292
1295
  else
1293
- [{ "subject" => sanitize(name).downcase }]
1296
+ [{ "subject" => sanitize(name) }]
1294
1297
  end
1295
1298
  end
1296
1299
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commonmeta
4
- VERSION = '3.2.13'
4
+ VERSION = '3.2.14'
5
5
  end
@@ -17,7 +17,7 @@ module Commonmeta
17
17
  keywords: if subjects.present?
18
18
  Array.wrap(subjects).map do |k|
19
19
  parse_attributes(k, content: 'subject', first: true)
20
- end.join(', ')
20
+ end.join(', ').capitalize
21
21
  end,
22
22
  language: language,
23
23
  title: parse_attributes(titles, content: 'title', first: true),
@@ -15,7 +15,7 @@ module Commonmeta
15
15
  'UR' => url,
16
16
  'AB' => parse_attributes(descriptions, content: 'description', first: true),
17
17
  'KW' => Array.wrap(subjects).map do |k|
18
- parse_attributes(k, content: 'subject', first: true)
18
+ parse_attributes(k, content: 'subject', first: true).capitalize
19
19
  end.presence,
20
20
  'PY' => date['published'] && date['published'].split('-').first,
21
21
  'PB' => publisher['name'],
@@ -19,7 +19,7 @@ module Commonmeta
19
19
  'keywords' => if subjects.present?
20
20
  Array.wrap(subjects).map do |k|
21
21
  parse_attributes(k, content: 'subject', first: true)
22
- end.join(', ')
22
+ end.join(', ').capitalize
23
23
  end,
24
24
  'inLanguage' => language,
25
25
  'contentSize' => Array.wrap(sizes).unwrap,
@@ -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
@@ -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&#x27;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 (&lt;20 L)')
155
+ expect(bibtex[:keywords]).to start_with('Animalia, bottles or small containers/aquaria (&lt;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
@@ -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 - medical competence')
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 - datacite')
98
- expect(ris[9]).to eq('KW - FOS: Computer and information sciences')
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 - phylogeny')
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 - datacite')
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 - feature')
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 - faraday')
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/Aquaria (&lt;20 L)')
199
+ expect(ris[9]).to eq('KW - Bottles or small containers/aquaria (&lt;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, Parasites')
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('data sharing, data repository, dataone')
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('KAT12 International Institutions, Relations, Conditions, Internationale Politik und Internationale Organisationen, Wirtschaftssysteme und wirtschaftliche Entwicklung, International politics and organisations, Economic systems and development')
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, Bottles or small containers/Aquaria (&lt;20 L)')
142
+ expect(json['keywords']).to include('Animalia, bottles or small containers/aquaria (&lt;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('gtex, annotation, phenotype, gene regulation, transcriptomics')
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('topmed, whole genome sequencing')
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.13
4
+ version: 3.2.14
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-16 00:00:00.000000000 Z
11
+ date: 2023-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport