commonmeta-ruby 3.4.4 → 3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/commonmeta/author_utils.rb +103 -71
  4. data/lib/commonmeta/crossref_utils.rb +31 -25
  5. data/lib/commonmeta/metadata.rb +2 -8
  6. data/lib/commonmeta/metadata_utils.rb +4 -3
  7. data/lib/commonmeta/readers/bibtex_reader.rb +3 -3
  8. data/lib/commonmeta/readers/cff_reader.rb +7 -6
  9. data/lib/commonmeta/readers/codemeta_reader.rb +3 -3
  10. data/lib/commonmeta/readers/crossref_reader.rb +3 -5
  11. data/lib/commonmeta/readers/crossref_xml_reader.rb +7 -6
  12. data/lib/commonmeta/readers/csl_reader.rb +3 -4
  13. data/lib/commonmeta/readers/datacite_reader.rb +3 -5
  14. data/lib/commonmeta/readers/json_feed_reader.rb +3 -3
  15. data/lib/commonmeta/readers/npm_reader.rb +2 -2
  16. data/lib/commonmeta/readers/ris_reader.rb +1 -1
  17. data/lib/commonmeta/readers/schema_org_reader.rb +3 -3
  18. data/lib/commonmeta/schema_utils.rb +1 -1
  19. data/lib/commonmeta/utils.rb +4 -2
  20. data/lib/commonmeta/version.rb +1 -1
  21. data/lib/commonmeta/writers/bibtex_writer.rb +1 -1
  22. data/lib/commonmeta/writers/cff_writer.rb +5 -4
  23. data/lib/commonmeta/writers/codemeta_writer.rb +4 -2
  24. data/lib/commonmeta/writers/csv_writer.rb +4 -2
  25. data/lib/commonmeta/writers/datacite_writer.rb +1 -1
  26. data/lib/commonmeta/writers/jats_writer.rb +9 -5
  27. data/lib/commonmeta/writers/ris_writer.rb +2 -1
  28. data/lib/commonmeta/writers/schema_org_writer.rb +6 -3
  29. data/resources/{commonmeta_v0.9.3.json → commonmeta_v0.10.json} +62 -46
  30. data/spec/author_utils_spec.rb +16 -16
  31. data/spec/cli_spec.rb +1 -1
  32. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/missing_contributor.yml +307 -0
  33. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_datacite_metadata/SoftwareSourceCode.yml +76 -0
  34. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_funding.yml +36 -36
  35. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_json_feed_item_metadata/ghost_post_with_related_identifiers_and_link_to_peer-reviewed_article.yml +4911 -0
  36. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/book_oup.yml +107 -0
  37. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article_plos.yml +407 -0
  38. data/spec/metadata_spec.rb +2 -2
  39. data/spec/readers/bibtex_reader_spec.rb +5 -5
  40. data/spec/readers/cff_reader_spec.rb +127 -127
  41. data/spec/readers/codemeta_reader_spec.rb +11 -11
  42. data/spec/readers/crossref_reader_spec.rb +831 -835
  43. data/spec/readers/crossref_xml_reader_spec.rb +899 -901
  44. data/spec/readers/csl_reader_spec.rb +33 -33
  45. data/spec/readers/datacite_reader_spec.rb +106 -103
  46. data/spec/readers/json_feed_reader_spec.rb +64 -38
  47. data/spec/readers/npm_reader_spec.rb +32 -33
  48. data/spec/readers/ris_reader_spec.rb +36 -36
  49. data/spec/readers/schema_org_reader_spec.rb +284 -284
  50. data/spec/writers/codemeta_writer_spec.rb +19 -20
  51. data/spec/writers/crossref_xml_writer_spec.rb +73 -37
  52. data/spec/writers/datacite_writer_spec.rb +1 -1
  53. metadata +8 -3
@@ -1,148 +1,148 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helper'
3
+ require "spec_helper"
4
4
 
5
5
  describe Commonmeta::Metadata, vcr: true do
6
6
  subject { described_class.new(input: input) }
7
7
 
8
- let(:input) { 'https://github.com/citation-file-format/ruby-cff/blob/main/CITATION.cff' }
8
+ let(:input) { "https://github.com/citation-file-format/ruby-cff/blob/main/CITATION.cff" }
9
9
 
10
- context 'get cff metadata' do
11
- it 'ruby-cff' do
10
+ context "get cff metadata" do
11
+ it "ruby-cff" do
12
12
  # expect(subject.valid?).to be true
13
- expect(subject.id).to eq('https://doi.org/10.5281/zenodo.1184077')
14
- expect(subject.url).to eq('https://github.com/citation-file-format/ruby-cff')
15
- expect(subject.type).to eq('Software')
16
- expect(subject.creators).to eq([{ 'affiliation' => [{ 'name' => 'The University of Manchester, UK' }], 'familyName' => 'Haines', 'givenName' => 'Robert',
17
- 'id' => 'https://orcid.org/0000-0002-9538-7919',
18
- 'type' => 'Person' },
19
- { 'name' => 'The Ruby Citation File Format Developers',
20
- 'type' => 'Organization' }])
21
- expect(subject.titles).to eq([{ 'title' => 'Ruby CFF Library' }])
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' }])
31
- expect(subject.version).to eq('1.1.0')
32
- expect(subject.date).to eq('published' => '2023-04-10')
33
- expect(subject.publisher).to eq('name' => 'GitHub')
34
- expect(subject.license).to eq('id' => 'Apache-2.0',
35
- 'url' => 'http://www.apache.org/licenses/LICENSE-2.0')
36
- expect(subject.references).to eq([{ 'doi' => 'https://doi.org/10.5281/zenodo.1003149',
37
- 'key' => 'https://doi.org/10.5281/zenodo.1003149',
38
- 'publicationYear' => '2021' }])
13
+ expect(subject.id).to eq("https://doi.org/10.5281/zenodo.1184077")
14
+ expect(subject.url).to eq("https://github.com/citation-file-format/ruby-cff")
15
+ expect(subject.type).to eq("Software")
16
+ expect(subject.contributors).to eq([{ "affiliation" => [{ "name" => "The University of Manchester, UK" }], "familyName" => "Haines", "givenName" => "Robert",
17
+ "id" => "https://orcid.org/0000-0002-9538-7919",
18
+ "type" => "Person", "contributorRoles" => ["Author"] },
19
+ { "name" => "The Ruby Citation File Format Developers",
20
+ "type" => "Organization", "contributorRoles" => ["Author"] }])
21
+ expect(subject.titles).to eq([{ "title" => "Ruby CFF Library" }])
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" }])
31
+ expect(subject.version).to eq("1.1.0")
32
+ expect(subject.date).to eq("published" => "2023-04-10")
33
+ expect(subject.publisher).to eq("name" => "GitHub")
34
+ expect(subject.license).to eq("id" => "Apache-2.0",
35
+ "url" => "http://www.apache.org/licenses/LICENSE-2.0")
36
+ expect(subject.references).to eq([{ "doi" => "https://doi.org/10.5281/zenodo.1003149",
37
+ "key" => "https://doi.org/10.5281/zenodo.1003149",
38
+ "publicationYear" => "2021" }])
39
39
  end
40
40
 
41
- it 'cff-converter-python' do
42
- input = 'https://github.com/citation-file-format/cff-converter-python/blob/main/CITATION.cff'
41
+ it "cff-converter-python" do
42
+ input = "https://github.com/citation-file-format/cff-converter-python/blob/main/CITATION.cff"
43
43
  subject = described_class.new(input: input)
44
- expect(subject.id).to eq('https://doi.org/10.5281/zenodo.1162057')
45
- expect(subject.url).to eq('https://github.com/citation-file-format/cff-converter-python')
46
- expect(subject.type).to eq('Software')
47
- expect(subject.creators).to eq([{ 'affiliation' => [{ 'name' => 'Netherlands eScience Center' }],
48
- 'familyName' => 'Spaaks',
49
- 'givenName' => 'Jurriaan H.',
50
- 'id' => 'https://orcid.org/0000-0002-7064-4069',
51
- 'type' => 'Person' },
52
- { 'affiliation' => [{ 'name' => 'Netherlands eScience Center' }],
53
- 'familyName' => 'Klaver',
54
- 'givenName' => 'Tom',
55
- 'type' => 'Person' },
56
- { 'affiliation' => [{ 'name' => 'Netherlands eScience Center' }],
57
- 'familyName' => 'Verhoeven',
58
- 'id' => 'https://orcid.org/0000-0002-5821-2060',
59
- 'givenName' => 'Stefan',
60
- 'type' => 'Person' },
61
- { 'affiliation' => [{ 'name' => 'Humboldt-Universität zu Berlin' }],
62
- 'familyName' => 'Druskat',
63
- 'givenName' => 'Stephan',
64
- 'id' => 'https://orcid.org/0000-0003-4925-7248',
65
- 'type' => 'Person' },
66
- { 'affiliation' => [{ 'name' => 'University of Oslo' }],
67
- 'familyName' => 'Leoncio',
68
- 'givenName' => 'Waldir',
69
- 'type' => 'Person' }])
70
- expect(subject.titles).to eq([{ 'title' => 'cffconvert' }])
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' }])
81
- expect(subject.version).to eq('2.0.0')
82
- expect(subject.date).to eq('published' => '2021-09-22')
83
- expect(subject.publisher).to eq('name' => 'GitHub')
84
- expect(subject.license).to eq('id' => 'Apache-2.0', 'url' => 'http://www.apache.org/licenses/LICENSE-2.0')
85
- expect(subject.references).to eq([{ 'doi' => 'https://doi.org/10.5281/zenodo.1310751',
86
- 'key' => 'https://doi.org/10.5281/zenodo.1310751',
87
- 'publicationYear' => '2018' },
88
- { 'key' => 'https://blog.apastyle.org/apastyle/2015/01/how-to-cite-software-in-apa-style.html',
89
- 'url' => 'https://blog.apastyle.org/apastyle/2015/01/how-to-cite-software-in-apa-style.html' }])
44
+ expect(subject.id).to eq("https://doi.org/10.5281/zenodo.1162057")
45
+ expect(subject.url).to eq("https://github.com/citation-file-format/cff-converter-python")
46
+ expect(subject.type).to eq("Software")
47
+ expect(subject.contributors).to eq([{ "affiliation" => [{ "name" => "Netherlands eScience Center" }],
48
+ "familyName" => "Spaaks",
49
+ "givenName" => "Jurriaan H.",
50
+ "id" => "https://orcid.org/0000-0002-7064-4069",
51
+ "type" => "Person", "contributorRoles" => ["Author"] },
52
+ { "affiliation" => [{ "name" => "Netherlands eScience Center" }],
53
+ "familyName" => "Klaver",
54
+ "givenName" => "Tom",
55
+ "type" => "Person", "contributorRoles" => ["Author"] },
56
+ { "affiliation" => [{ "name" => "Netherlands eScience Center" }],
57
+ "familyName" => "Verhoeven",
58
+ "id" => "https://orcid.org/0000-0002-5821-2060",
59
+ "givenName" => "Stefan",
60
+ "type" => "Person", "contributorRoles" => ["Author"] },
61
+ { "affiliation" => [{ "name" => "Humboldt-Universität zu Berlin" }],
62
+ "familyName" => "Druskat",
63
+ "givenName" => "Stephan",
64
+ "id" => "https://orcid.org/0000-0003-4925-7248",
65
+ "type" => "Person", "contributorRoles" => ["Author"] },
66
+ { "affiliation" => [{ "name" => "University of Oslo" }],
67
+ "familyName" => "Leoncio",
68
+ "givenName" => "Waldir",
69
+ "type" => "Person", "contributorRoles" => ["Author"] }])
70
+ expect(subject.titles).to eq([{ "title" => "cffconvert" }])
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" }])
81
+ expect(subject.version).to eq("2.0.0")
82
+ expect(subject.date).to eq("published" => "2021-09-22")
83
+ expect(subject.publisher).to eq("name" => "GitHub")
84
+ expect(subject.license).to eq("id" => "Apache-2.0", "url" => "http://www.apache.org/licenses/LICENSE-2.0")
85
+ expect(subject.references).to eq([{ "doi" => "https://doi.org/10.5281/zenodo.1310751",
86
+ "key" => "https://doi.org/10.5281/zenodo.1310751",
87
+ "publicationYear" => "2018" },
88
+ { "key" => "https://blog.apastyle.org/apastyle/2015/01/how-to-cite-software-in-apa-style.html",
89
+ "url" => "https://blog.apastyle.org/apastyle/2015/01/how-to-cite-software-in-apa-style.html" }])
90
90
  end
91
91
 
92
- it 'ruby-cff' do
92
+ it "ruby-cff" do
93
93
  # expect(subject.valid?).to be true
94
- expect(subject.id).to eq('https://doi.org/10.5281/zenodo.1184077')
95
- expect(subject.url).to eq('https://github.com/citation-file-format/ruby-cff')
96
- expect(subject.type).to eq('Software')
97
- expect(subject.creators).to eq([{ 'affiliation' => [{ 'name' => 'The University of Manchester, UK' }], 'familyName' => 'Haines', 'givenName' => 'Robert',
98
- 'id' => 'https://orcid.org/0000-0002-9538-7919', 'type' => 'Person' }, { 'name' => 'The Ruby Citation File Format Developers', 'type' => 'Organization' }])
99
- expect(subject.titles).to eq([{ 'title' => 'Ruby CFF Library' }])
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' }])
109
- expect(subject.version).to eq('1.1.0')
110
- expect(subject.date).to eq('published' => '2023-04-10')
111
- expect(subject.publisher).to eq('name' => 'GitHub')
112
- expect(subject.license).to eq('id' => 'Apache-2.0',
113
- 'url' => 'http://www.apache.org/licenses/LICENSE-2.0')
114
- expect(subject.references).to eq([{ 'doi' => 'https://doi.org/10.5281/zenodo.1003149',
115
- 'key' => 'https://doi.org/10.5281/zenodo.1003149',
116
- 'publicationYear' => '2021' }])
94
+ expect(subject.id).to eq("https://doi.org/10.5281/zenodo.1184077")
95
+ expect(subject.url).to eq("https://github.com/citation-file-format/ruby-cff")
96
+ expect(subject.type).to eq("Software")
97
+ expect(subject.contributors).to eq([{ "affiliation" => [{ "name" => "The University of Manchester, UK" }], "familyName" => "Haines", "givenName" => "Robert",
98
+ "id" => "https://orcid.org/0000-0002-9538-7919", "type" => "Person", "contributorRoles" => ["Author"] }, { "name" => "The Ruby Citation File Format Developers", "type" => "Organization", "contributorRoles" => ["Author"] }])
99
+ expect(subject.titles).to eq([{ "title" => "Ruby CFF Library" }])
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" }])
109
+ expect(subject.version).to eq("1.1.0")
110
+ expect(subject.date).to eq("published" => "2023-04-10")
111
+ expect(subject.publisher).to eq("name" => "GitHub")
112
+ expect(subject.license).to eq("id" => "Apache-2.0",
113
+ "url" => "http://www.apache.org/licenses/LICENSE-2.0")
114
+ expect(subject.references).to eq([{ "doi" => "https://doi.org/10.5281/zenodo.1003149",
115
+ "key" => "https://doi.org/10.5281/zenodo.1003149",
116
+ "publicationYear" => "2021" }])
117
117
  end
118
118
 
119
- it 'ruby-cff repository url' do
120
- input = 'https://github.com/citation-file-format/ruby-cff'
119
+ it "ruby-cff repository url" do
120
+ input = "https://github.com/citation-file-format/ruby-cff"
121
121
  subject = described_class.new(input: input)
122
122
  # expect(subject.valid?).to be true
123
- expect(subject.id).to eq('https://doi.org/10.5281/zenodo.1184077')
124
- expect(subject.url).to eq('https://github.com/citation-file-format/ruby-cff')
125
- expect(subject.type).to eq('Software')
126
- expect(subject.creators).to eq([{ 'affiliation' => [{ 'name' => 'The University of Manchester, UK' }], 'familyName' => 'Haines', 'givenName' => 'Robert',
127
- 'id' => 'https://orcid.org/0000-0002-9538-7919', 'type' => 'Person' }, { 'name' => 'The Ruby Citation File Format Developers', 'type' => 'Organization' }])
128
- expect(subject.titles).to eq([{ 'title' => 'Ruby CFF Library' }])
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' }])
138
- expect(subject.version).to eq('1.1.0')
139
- expect(subject.date).to eq('published' => '2023-04-10')
140
- expect(subject.publisher).to eq('name' => 'GitHub')
141
- expect(subject.license).to eq('id' => 'Apache-2.0',
142
- 'url' => 'http://www.apache.org/licenses/LICENSE-2.0')
143
- expect(subject.references).to eq([{ 'doi' => 'https://doi.org/10.5281/zenodo.1003149',
144
- 'key' => 'https://doi.org/10.5281/zenodo.1003149',
145
- 'publicationYear' => '2021' }])
123
+ expect(subject.id).to eq("https://doi.org/10.5281/zenodo.1184077")
124
+ expect(subject.url).to eq("https://github.com/citation-file-format/ruby-cff")
125
+ expect(subject.type).to eq("Software")
126
+ expect(subject.contributors).to eq([{ "affiliation" => [{ "name" => "The University of Manchester, UK" }], "familyName" => "Haines", "givenName" => "Robert",
127
+ "id" => "https://orcid.org/0000-0002-9538-7919", "type" => "Person", "contributorRoles" => ["Author"] }, { "name" => "The Ruby Citation File Format Developers", "type" => "Organization", "contributorRoles" => ["Author"] }])
128
+ expect(subject.titles).to eq([{ "title" => "Ruby CFF Library" }])
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" }])
138
+ expect(subject.version).to eq("1.1.0")
139
+ expect(subject.date).to eq("published" => "2023-04-10")
140
+ expect(subject.publisher).to eq("name" => "GitHub")
141
+ expect(subject.license).to eq("id" => "Apache-2.0",
142
+ "url" => "http://www.apache.org/licenses/LICENSE-2.0")
143
+ expect(subject.references).to eq([{ "doi" => "https://doi.org/10.5281/zenodo.1003149",
144
+ "key" => "https://doi.org/10.5281/zenodo.1003149",
145
+ "publicationYear" => "2021" }])
146
146
  end
147
147
  end
148
148
  end
@@ -21,11 +21,11 @@ describe Commonmeta::Metadata, vcr: true do
21
21
  expect(subject.id).to eq('https://doi.org/10.5438/qeg0-3gm3')
22
22
  expect(subject.url).to eq('https://github.com/datacite/maremma')
23
23
  expect(subject.type).to eq('Software')
24
- expect(subject.creators).to eq([{ 'affiliation' => [{ 'name' => 'DataCite' }],
24
+ expect(subject.contributors).to eq([{ 'affiliation' => [{ 'name' => 'DataCite' }],
25
25
  'familyName' => 'Fenner',
26
26
  'givenName' => 'Martin',
27
27
  'id' => 'https://orcid.org/0000-0003-0077-4738',
28
- 'type' => 'Person' }])
28
+ 'type' => 'Person', 'contributorRoles' => ['Author'] }])
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
31
  expect(subject.subjects).to eq([{ 'subject' => 'Faraday' }, { 'subject' => 'Excon' },
@@ -43,18 +43,18 @@ describe Commonmeta::Metadata, vcr: true do
43
43
  expect(subject.id).to eq('https://doi.org/10.5063/f1m61h5x')
44
44
  expect(subject.url).to eq('https://github.com/DataONEorg/rdataone')
45
45
  expect(subject.type).to eq('Software')
46
- expect(subject.creators).to eq([{ 'affiliation' => [{ 'name' => 'NCEAS' }],
46
+ expect(subject.contributors).to eq([{ 'affiliation' => [{ 'name' => 'NCEAS' }],
47
47
  'familyName' => 'Jones',
48
48
  'givenName' => 'Matt',
49
49
  'id' => 'https://orcid.org/0000-0003-0077-4738',
50
- 'type' => 'Person' },
50
+ 'type' => 'Person', 'contributorRoles' => ['Author'] },
51
51
  { 'affiliation' => [{ 'name' => 'NCEAS' }],
52
52
  'familyName' => 'Slaughter',
53
53
  'givenName' => 'Peter',
54
54
  'id' => 'https://orcid.org/0000-0002-2192-403X',
55
- 'type' => 'Person' },
55
+ 'type' => 'Person', 'contributorRoles' => ['Author'] },
56
56
  { 'name' => 'University of California, Santa Barbara',
57
- 'type' => 'Organization' }])
57
+ 'type' => 'Organization', 'contributorRoles' => ['Author'] }])
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
60
  expect(subject.subjects).to eq([{ 'subject' => 'Data sharing' }, { 'subject' => 'Data repository' },
@@ -75,11 +75,11 @@ describe Commonmeta::Metadata, vcr: true do
75
75
  expect(subject.id).to eq('https://doi.org/10.5438/qeg0-3gm3')
76
76
  expect(subject.url).to eq('https://github.com/datacite/maremma')
77
77
  expect(subject.type).to eq('Software')
78
- expect(subject.creators).to eq([{ 'affiliation' => [{ 'name' => 'DataCite' }],
78
+ expect(subject.contributors).to eq([{ 'affiliation' => [{ 'name' => 'DataCite' }],
79
79
  'familyName' => 'Fenner',
80
80
  'givenName' => 'Martin',
81
81
  'id' => 'https://orcid.org/0000-0003-0077-4738',
82
- 'type' => 'Person' }])
82
+ 'type' => 'Person', 'contributorRoles' => ['Author'] }])
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
85
  expect(subject.subjects).to eq([{ 'subject' => 'Faraday' }, { 'subject' => 'Excon' },
@@ -98,10 +98,10 @@ describe Commonmeta::Metadata, vcr: true do
98
98
  expect(subject.id).to eq('https://doi.org/10.5438/wr0x-e194')
99
99
  expect(subject.url).to eq('https://github.com/datacite/metadata-reports')
100
100
  expect(subject.type).to eq('Software')
101
- expect(subject.creators.size).to eq(4)
102
- expect(subject.creators.last).to eq('familyName' => 'Nielsen', 'givenName' => 'Lars Holm',
101
+ expect(subject.contributors.size).to eq(4)
102
+ expect(subject.contributors.last).to eq('familyName' => 'Nielsen', 'givenName' => 'Lars Holm',
103
103
  'id' => 'https://orcid.org/0000-0001-8135-3489',
104
- 'type' => 'Person')
104
+ 'type' => 'Person', 'contributorRoles' => ['Author'])
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
107
  expect(subject.subjects).to eq([{ 'subject' => 'Doi' }, { 'subject' => 'Software' },