commonmeta-ruby 3.4.5 → 3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) 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 +2 -2
  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/write_metadata_as_crossref/book_oup.yml +107 -0
  35. data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article_plos.yml +407 -0
  36. data/spec/metadata_spec.rb +2 -2
  37. data/spec/readers/bibtex_reader_spec.rb +5 -5
  38. data/spec/readers/cff_reader_spec.rb +127 -127
  39. data/spec/readers/codemeta_reader_spec.rb +11 -11
  40. data/spec/readers/crossref_reader_spec.rb +831 -835
  41. data/spec/readers/crossref_xml_reader_spec.rb +899 -901
  42. data/spec/readers/csl_reader_spec.rb +33 -33
  43. data/spec/readers/datacite_reader_spec.rb +106 -103
  44. data/spec/readers/json_feed_reader_spec.rb +40 -40
  45. data/spec/readers/npm_reader_spec.rb +32 -33
  46. data/spec/readers/ris_reader_spec.rb +36 -36
  47. data/spec/readers/schema_org_reader_spec.rb +284 -284
  48. data/spec/writers/codemeta_writer_spec.rb +19 -20
  49. data/spec/writers/crossref_xml_writer_spec.rb +73 -37
  50. data/spec/writers/datacite_writer_spec.rb +1 -1
  51. metadata +7 -3
@@ -1,919 +1,915 @@
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
8
  let(:input) { "#{fixture_path}crossref.json" }
9
9
 
10
- context 'get crossref raw' do
11
- it 'journal article' do
10
+ context "get crossref raw" do
11
+ it "journal article" do
12
12
  expect(subject.raw).to eq(File.read(input).strip)
13
13
  end
14
14
  end
15
15
 
16
- context 'get crossref metadata' do
17
- it 'DOI with data citation' do
18
- expect(subject.valid?).to be true
19
- expect(subject.id).to eq('https://doi.org/10.7554/elife.01567')
20
- expect(subject.type).to eq('JournalArticle')
21
- expect(subject.url).to eq('https://elifesciences.org/articles/01567')
22
- expect(subject.creators.length).to eq(5)
23
- expect(subject.creators.first).to eq('type' => 'Person',
24
- 'givenName' => 'Martial', 'familyName' => 'Sankar', 'affiliation' => [{ 'name' => 'Department of Plant Molecular Biology, University of Lausanne, Lausanne, Switzerland' }])
25
- expect(subject.license).to eq('id' => 'CC-BY-3.0',
26
- 'url' => 'https://creativecommons.org/licenses/by/3.0/legalcode')
27
- expect(subject.titles).to eq([{ 'title' => 'Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth' }])
28
- expect(subject.date).to eq('published' => '2014-02-11', 'updated' => '2022-03-26')
29
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/4374',
30
- 'name' => 'eLife Sciences Publications, Ltd')
31
- expect(subject.container).to eq('identifier' => '2050-084X',
32
- 'identifierType' => 'ISSN', 'title' => 'eLife', 'type' => 'Journal', 'volume' => '3')
16
+ context "get crossref metadata" do
17
+ it "DOI with data citation" do
18
+ expect(subject.valid?).to be true
19
+ expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
20
+ expect(subject.type).to eq("JournalArticle")
21
+ expect(subject.url).to eq("https://elifesciences.org/articles/01567")
22
+ expect(subject.contributors.length).to eq(5)
23
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
24
+ "givenName" => "Martial", "familyName" => "Sankar", "affiliation" => [{ "name" => "Department of Plant Molecular Biology, University of Lausanne, Lausanne, Switzerland" }])
25
+ expect(subject.license).to eq("id" => "CC-BY-3.0",
26
+ "url" => "https://creativecommons.org/licenses/by/3.0/legalcode")
27
+ expect(subject.titles).to eq([{ "title" => "Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth" }])
28
+ expect(subject.date).to eq("published" => "2014-02-11", "updated" => "2022-03-26")
29
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/4374",
30
+ "name" => "eLife Sciences Publications, Ltd")
31
+ expect(subject.container).to eq("identifier" => "2050-084X",
32
+ "identifierType" => "ISSN", "title" => "eLife", "type" => "Journal", "volume" => "3")
33
33
  expect(subject.references.length).to eq(27)
34
- expect(subject.references.last).to eq('containerTitle' => 'Nature Cell Biology',
35
- 'creator' => 'Yin',
36
- 'doi' => 'https://doi.org/10.1038/ncb2764',
37
- 'firstPage' => '860',
38
- 'key' => 'bib27',
39
- 'publicationYear' => '2013',
40
- 'title' => 'A screen for morphological complexity identifies regulators of switch-like transitions between discrete cell shapes',
41
- 'volume' => '15')
42
- expect(subject.funding_references).to eq([{ 'funderName' => 'SystemsX' },
43
- { 'funderName' => 'EMBO longterm post-doctoral fellowships' },
44
- { 'funderName' => 'Marie Heim-Voegtlin' },
45
- { 'funderIdentifier' => 'https://doi.org/10.13039/501100006390',
46
- 'funderIdentifierType' => 'Crossref Funder ID',
47
- 'funderName' => 'University of Lausanne' },
48
- { 'funderName' => 'SystemsX' },
49
- { 'funderIdentifier' => 'https://doi.org/10.13039/501100003043',
50
- 'funderIdentifierType' => 'Crossref Funder ID',
51
- 'funderName' => 'EMBO' },
52
- { 'funderIdentifier' => 'https://doi.org/10.13039/501100001711',
53
- 'funderIdentifierType' => 'Crossref Funder ID',
54
- 'funderName' => 'Swiss National Science Foundation' },
55
- { 'funderIdentifier' => 'https://doi.org/10.13039/501100006390',
56
- 'funderIdentifierType' => 'Crossref Funder ID',
57
- 'funderName' => 'University of Lausanne' }])
58
- expect(subject.provider).to eq('Crossref')
59
- end
60
-
61
- it 'journal article' do
62
- input = 'https://doi.org/10.1371/journal.pone.0000030'
63
- subject = described_class.new(input: input)
64
- expect(subject.valid?).to be true
65
- expect(subject.id).to eq('https://doi.org/10.1371/journal.pone.0000030')
66
- expect(subject.url).to eq('https://dx.plos.org/10.1371/journal.pone.0000030')
67
- expect(subject.type).to eq('JournalArticle')
68
- expect(subject.creators.length).to eq(5)
69
- expect(subject.creators.first).to eq('type' => 'Person',
70
- 'givenName' => 'Markus', 'familyName' => 'Ralser')
71
- expect(subject.contributors).to eq([{ 'contributorType' => 'Editor', 'familyName' => 'Janbon',
72
- 'givenName' => 'Guilhem', 'type' => 'Person' }])
73
- expect(subject.titles).to eq([{ 'title' => 'Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes' }])
74
- expect(subject.license).to eq('id' => 'CC-BY-4.0',
75
- 'url' => 'https://creativecommons.org/licenses/by/4.0/legalcode')
76
- expect(subject.date).to eq('published' => '2006-12-20', 'updated' => '2021-08-06')
77
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/340',
78
- 'name' => 'Public Library of Science (PLoS)')
34
+ expect(subject.references.last).to eq("containerTitle" => "Nature Cell Biology",
35
+ "contributor" => "Yin",
36
+ "doi" => "https://doi.org/10.1038/ncb2764",
37
+ "firstPage" => "860",
38
+ "key" => "bib27",
39
+ "publicationYear" => "2013",
40
+ "title" => "A screen for morphological complexity identifies regulators of switch-like transitions between discrete cell shapes",
41
+ "volume" => "15")
42
+ expect(subject.funding_references).to eq([{ "funderName" => "SystemsX" },
43
+ { "funderName" => "EMBO longterm post-doctoral fellowships" },
44
+ { "funderName" => "Marie Heim-Voegtlin" },
45
+ { "funderIdentifier" => "https://doi.org/10.13039/501100006390",
46
+ "funderIdentifierType" => "Crossref Funder ID",
47
+ "funderName" => "University of Lausanne" },
48
+ { "funderName" => "SystemsX" },
49
+ { "funderIdentifier" => "https://doi.org/10.13039/501100003043",
50
+ "funderIdentifierType" => "Crossref Funder ID",
51
+ "funderName" => "EMBO" },
52
+ { "funderIdentifier" => "https://doi.org/10.13039/501100001711",
53
+ "funderIdentifierType" => "Crossref Funder ID",
54
+ "funderName" => "Swiss National Science Foundation" },
55
+ { "funderIdentifier" => "https://doi.org/10.13039/501100006390",
56
+ "funderIdentifierType" => "Crossref Funder ID",
57
+ "funderName" => "University of Lausanne" }])
58
+ expect(subject.provider).to eq("Crossref")
59
+ end
60
+
61
+ it "journal article" do
62
+ input = "https://doi.org/10.1371/journal.pone.0000030"
63
+ subject = described_class.new(input: input)
64
+ expect(subject.valid?).to be true
65
+ expect(subject.id).to eq("https://doi.org/10.1371/journal.pone.0000030")
66
+ expect(subject.url).to eq("https://dx.plos.org/10.1371/journal.pone.0000030")
67
+ expect(subject.type).to eq("JournalArticle")
68
+ expect(subject.contributors.length).to eq(6)
69
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
70
+ "givenName" => "Markus", "familyName" => "Ralser")
71
+ expect(subject.contributors.last).to eq({ "familyName" => "Janbon",
72
+ "givenName" => "Guilhem", "type" => "Person", "contributorRoles" => ["Editor"] })
73
+ expect(subject.titles).to eq([{ "title" => "Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes" }])
74
+ expect(subject.license).to eq("id" => "CC-BY-4.0",
75
+ "url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
76
+ expect(subject.date).to eq("published" => "2006-12-20", "updated" => "2021-08-06")
77
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/340",
78
+ "name" => "Public Library of Science (PLoS)")
79
79
  expect(subject.references.length).to eq(73)
80
- expect(subject.references.last).to eq('containerTitle' => 'N Engl J Med', 'creator' => 'KB Hammond',
81
- 'doi' => 'https://doi.org/10.1056/nejm199109123251104',
82
- 'firstPage' => '769',
83
- 'key' => 'ref73',
84
- 'publicationYear' => '1991',
85
- 'title' => 'Efficacy of statewide neonatal screening for cystic fibrosis by assay of trypsinogen concentrations.', 'volume' => '325')
86
- expect(subject.container).to eq('firstPage' => 'e30', 'identifier' => '1932-6203',
87
- 'identifierType' => 'ISSN', 'issue' => '1', 'title' => 'PLoS ONE', 'type' => 'Journal', 'volume' => '1')
88
- expect(subject.provider).to eq('Crossref')
89
- end
90
-
91
- it 'journal article with funding' do
92
- input = '10.3389/fpls.2019.00816'
93
- subject = described_class.new(input: input)
94
- expect(subject.valid?).to be true
95
- expect(subject.id).to eq('https://doi.org/10.3389/fpls.2019.00816')
96
- expect(subject.url).to eq('https://www.frontiersin.org/article/10.3389/fpls.2019.00816/full')
97
- expect(subject.type).to eq('JournalArticle')
98
- expect(subject.creators.length).to eq(4)
99
- expect(subject.creators.first).to eq('type' => 'Person', 'familyName' => 'Fortes',
100
- 'givenName' => 'Ana Margarida')
101
- expect(subject.titles).to eq([{ 'title' => 'Transcriptional Modulation of Polyamine Metabolism in Fruit Species Under Abiotic and Biotic Stress' }])
102
- expect(subject.license).to eq('id' => 'CC-BY-4.0',
103
- 'url' => 'https://creativecommons.org/licenses/by/4.0/legalcode')
104
- expect(subject.date).to eq('published' => '2019-07-02', 'updated' => '2019-09-22')
105
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/1965',
106
- 'name' => 'Frontiers Media SA')
107
- expect(subject.funding_references).to eq([{ 'awardNumber' => 'CA17111',
108
- 'funderIdentifier' => 'https://doi.org/10.13039/501100000921', 'funderIdentifierType' => 'Crossref Funder ID', 'funderName' => 'COST (European Cooperation in Science and Technology)' }])
80
+ expect(subject.references.last).to eq("containerTitle" => "N Engl J Med", "contributor" => "KB Hammond",
81
+ "doi" => "https://doi.org/10.1056/nejm199109123251104",
82
+ "firstPage" => "769",
83
+ "key" => "ref73",
84
+ "publicationYear" => "1991",
85
+ "title" => "Efficacy of statewide neonatal screening for cystic fibrosis by assay of trypsinogen concentrations.", "volume" => "325")
86
+ expect(subject.container).to eq("firstPage" => "e30", "identifier" => "1932-6203",
87
+ "identifierType" => "ISSN", "issue" => "1", "title" => "PLoS ONE", "type" => "Journal", "volume" => "1")
88
+ expect(subject.provider).to eq("Crossref")
89
+ end
90
+
91
+ it "journal article with funding" do
92
+ input = "10.3389/fpls.2019.00816"
93
+ subject = described_class.new(input: input)
94
+ expect(subject.valid?).to be true
95
+ expect(subject.id).to eq("https://doi.org/10.3389/fpls.2019.00816")
96
+ expect(subject.url).to eq("https://www.frontiersin.org/article/10.3389/fpls.2019.00816/full")
97
+ expect(subject.type).to eq("JournalArticle")
98
+ expect(subject.contributors.length).to eq(4)
99
+ expect(subject.contributors.first).to eq("type" => "Person", "familyName" => "Fortes",
100
+ "givenName" => "Ana Margarida", "contributorRoles" => ["Author"])
101
+ expect(subject.titles).to eq([{ "title" => "Transcriptional Modulation of Polyamine Metabolism in Fruit Species Under Abiotic and Biotic Stress" }])
102
+ expect(subject.license).to eq("id" => "CC-BY-4.0",
103
+ "url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
104
+ expect(subject.date).to eq("published" => "2019-07-02", "updated" => "2019-09-22")
105
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/1965",
106
+ "name" => "Frontiers Media SA")
107
+ expect(subject.funding_references).to eq([{ "awardNumber" => "CA17111",
108
+ "funderIdentifier" => "https://doi.org/10.13039/501100000921", "funderIdentifierType" => "Crossref Funder ID", "funderName" => "COST (European Cooperation in Science and Technology)" }])
109
109
  expect(subject.references.length).to eq(70)
110
- expect(subject.references.first).to eq('containerTitle' => 'Plant Physiol. Biochem.',
111
- 'creator' => 'Agudelo-Romero',
112
- 'doi' => 'https://doi.org/10.1016/j.plaphy.2013.11.002',
113
- 'firstPage' => '141',
114
- 'key' => 'ref1',
115
- 'publicationYear' => '2014',
116
- 'title' => 'Perturbation of polyamine catabolism affects grape ripening of Vitis vinifera cv. Trincadeira',
117
- 'volume' => '74')
118
- expect(subject.references.last).to eq('containerTitle' => 'Acta Hortic.',
119
- 'creator' => 'Zheng',
120
- 'doi' => 'https://doi.org/10.17660/actahortic.2004.632.41',
121
- 'firstPage' => '317',
122
- 'key' => 'ref70',
123
- 'publicationYear' => '2004',
124
- 'title' => 'Effects of polyamines and salicylic acid on postharvest storage of “Ponkan” mandarin',
125
- 'volume' => '632')
126
- expect(subject.container).to eq('identifier' => '1664-462X',
127
- 'identifierType' => 'ISSN', 'title' => 'Frontiers in Plant Science', 'type' => 'Journal', 'volume' => '10')
128
- expect(subject.provider).to eq('Crossref')
129
- end
130
-
131
- it 'journal article original language title' do
132
- input = 'https://doi.org/10.7600/jspfsm.56.60'
110
+ expect(subject.references.first).to eq("containerTitle" => "Plant Physiol. Biochem.",
111
+ "contributor" => "Agudelo-Romero",
112
+ "doi" => "https://doi.org/10.1016/j.plaphy.2013.11.002",
113
+ "firstPage" => "141",
114
+ "key" => "ref1",
115
+ "publicationYear" => "2014",
116
+ "title" => "Perturbation of polyamine catabolism affects grape ripening of Vitis vinifera cv. Trincadeira",
117
+ "volume" => "74")
118
+ expect(subject.references.last).to eq("containerTitle" => "Acta Hortic.",
119
+ "contributor" => "Zheng",
120
+ "doi" => "https://doi.org/10.17660/actahortic.2004.632.41",
121
+ "firstPage" => "317",
122
+ "key" => "ref70",
123
+ "publicationYear" => "2004",
124
+ "title" => "Effects of polyamines and salicylic acid on postharvest storage of “Ponkan” mandarin",
125
+ "volume" => "632")
126
+ expect(subject.container).to eq("identifier" => "1664-462X",
127
+ "identifierType" => "ISSN", "title" => "Frontiers in Plant Science", "type" => "Journal", "volume" => "10")
128
+ expect(subject.provider).to eq("Crossref")
129
+ end
130
+
131
+ it "journal article original language title" do
132
+ input = "https://doi.org/10.7600/jspfsm.56.60"
133
133
  subject = described_class.new(input: input)
134
134
  expect(subject.valid?).to be false
135
- expect(subject.errors).to eq(["property '/creators' is invalid: error_type=minItems"])
136
- expect(subject.id).to eq('https://doi.org/10.7600/jspfsm.56.60')
137
- expect(subject.url).to eq('https://www.jstage.jst.go.jp/article/jspfsm/56/1/56_1_60/_article/-char/ja')
138
- expect(subject.type).to eq('JournalArticle')
139
- expect(subject.creators.empty?).to be true
140
- expect(subject.titles).to eq([{ 'title' => ':(unav)' }])
141
- expect(subject.date).to include('published' => '2007', 'updated' => '2021-05-20')
135
+ expect(subject.errors).to eq(["property '/contributors' is invalid: error_type=minItems"])
136
+ expect(subject.id).to eq("https://doi.org/10.7600/jspfsm.56.60")
137
+ expect(subject.url).to eq("https://www.jstage.jst.go.jp/article/jspfsm/56/1/56_1_60/_article/-char/ja")
138
+ expect(subject.type).to eq("JournalArticle")
139
+ expect(subject.contributors.empty?).to be true
140
+ expect(subject.titles).to eq([{ "title" => ":(unav)" }])
141
+ expect(subject.date).to include("published" => "2007", "updated" => "2021-05-20")
142
142
  expect(subject.references.length).to eq(7)
143
- expect(subject.references.first).to eq('doi' => 'https://doi.org/10.1111/j.1469-7793.2000.00407.x',
144
- 'key' => '1')
145
- expect(subject.container).to eq('firstPage' => '60', 'identifier' => '1881-4751',
146
- 'identifierType' => 'ISSN', 'issue' => '1', 'lastPage' => '60', 'title' => 'Japanese Journal of Physical Fitness and Sports Medicine', 'type' => 'Journal', 'volume' => '56')
147
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/4426',
148
- 'name' => 'The Japanese Society of Physical Fitness and Sports Medicine')
149
- expect(subject.provider).to eq('Crossref')
150
- end
151
-
152
- it 'journal article with RDF for container' do
153
- input = 'https://doi.org/10.1163/1937240X-00002096'
154
- subject = described_class.new(input: input)
155
- expect(subject.valid?).to be true
156
- expect(subject.id).to eq('https://doi.org/10.1163/1937240x-00002096')
157
- expect(subject.url).to eq('https://academic.oup.com/jcb/article-lookup/doi/10.1163/1937240X-00002096')
158
- expect(subject.type).to eq('JournalArticle')
159
- expect(subject.creators.length).to eq(8)
160
- expect(subject.creators.first).to eq('familyName' => 'Escrivà',
161
- 'givenName' => 'Andreu', 'type' => 'Person')
162
- expect(subject.titles).to eq([{ 'title' => 'Global distribution of Fabaeformiscandona subacuta: an exotic invasive Ostracoda on the Iberian Peninsula?' }])
163
- expect(subject.date).to include('published' => '2012-01-01')
164
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/286',
165
- 'name' => 'Oxford University Press (OUP)')
143
+ expect(subject.references.first).to eq("doi" => "https://doi.org/10.1111/j.1469-7793.2000.00407.x",
144
+ "key" => "1")
145
+ expect(subject.container).to eq("firstPage" => "60", "identifier" => "1881-4751",
146
+ "identifierType" => "ISSN", "issue" => "1", "lastPage" => "60", "title" => "Japanese Journal of Physical Fitness and Sports Medicine", "type" => "Journal", "volume" => "56")
147
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/4426",
148
+ "name" => "The Japanese Society of Physical Fitness and Sports Medicine")
149
+ expect(subject.provider).to eq("Crossref")
150
+ end
151
+
152
+ it "journal article with RDF for container" do
153
+ input = "https://doi.org/10.1163/1937240X-00002096"
154
+ subject = described_class.new(input: input)
155
+ expect(subject.valid?).to be true
156
+ expect(subject.id).to eq("https://doi.org/10.1163/1937240x-00002096")
157
+ expect(subject.url).to eq("https://academic.oup.com/jcb/article-lookup/doi/10.1163/1937240X-00002096")
158
+ expect(subject.type).to eq("JournalArticle")
159
+ expect(subject.contributors.length).to eq(8)
160
+ expect(subject.contributors.first).to eq("familyName" => "Escrivà",
161
+ "givenName" => "Andreu", "type" => "Person", "contributorRoles" => ["Author"])
162
+ expect(subject.titles).to eq([{ "title" => "Global distribution of Fabaeformiscandona subacuta: an exotic invasive Ostracoda on the Iberian Peninsula?" }])
163
+ expect(subject.date).to include("published" => "2012-01-01")
164
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/286",
165
+ "name" => "Oxford University Press (OUP)")
166
166
  expect(subject.references.length).to eq(111)
167
- expect(subject.references.first).to eq('containerTitle' => 'Rozpravy Ceskoslovenske Akademie Ved, Rada Matematickych A Prirodnich Ved',
168
- 'creator' => 'Absolon',
169
- 'firstPage' => '1',
170
- 'issue' => '5',
171
- 'key' => 'bibr1',
172
- 'publicationYear' => '1978',
173
- 'title' => 'Die Gattung Candonaim Quartar von Europa',
174
- 'volume' => '88')
175
- expect(subject.container).to eq('firstPage' => '949', 'identifier' => '1937-240X',
176
- 'identifierType' => 'ISSN', 'issue' => '6', 'lastPage' => '961', 'title' => 'Journal of Crustacean Biology', 'type' => 'Journal', 'volume' => '32')
177
- expect(subject.provider).to eq('Crossref')
178
- end
179
-
180
- it 'book chapter with RDF for container' do
181
- input = 'https://doi.org/10.1007/978-3-642-33191-6_49'
182
- subject = described_class.new(input: input)
183
- expect(subject.valid?).to be true
184
- expect(subject.id).to eq('https://doi.org/10.1007/978-3-642-33191-6_49')
185
- expect(subject.url).to eq('http://link.springer.com/10.1007/978-3-642-33191-6_49')
186
- expect(subject.type).to eq('BookChapter')
187
- expect(subject.creators.length).to eq(3)
188
- expect(subject.creators.first).to eq('familyName' => 'Chen', 'givenName' => 'Lili',
189
- 'type' => 'Person')
190
- expect(subject.titles).to eq([{ 'title' => 'Human Body Orientation Estimation in Multiview Scenarios' }])
191
- expect(subject.date).to eq('published' => '2012', 'updated' => '2020-11-24')
192
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/297',
193
- 'name' => 'Springer Science and Business Media LLC')
167
+ expect(subject.references.first).to eq("containerTitle" => "Rozpravy Ceskoslovenske Akademie Ved, Rada Matematickych A Prirodnich Ved",
168
+ "contributor" => "Absolon",
169
+ "firstPage" => "1",
170
+ "issue" => "5",
171
+ "key" => "bibr1",
172
+ "publicationYear" => "1978",
173
+ "title" => "Die Gattung Candonaim Quartar von Europa",
174
+ "volume" => "88")
175
+ expect(subject.container).to eq("firstPage" => "949", "identifier" => "1937-240X",
176
+ "identifierType" => "ISSN", "issue" => "6", "lastPage" => "961", "title" => "Journal of Crustacean Biology", "type" => "Journal", "volume" => "32")
177
+ expect(subject.provider).to eq("Crossref")
178
+ end
179
+
180
+ it "book chapter with RDF for container" do
181
+ input = "https://doi.org/10.1007/978-3-642-33191-6_49"
182
+ subject = described_class.new(input: input)
183
+ expect(subject.valid?).to be true
184
+ expect(subject.id).to eq("https://doi.org/10.1007/978-3-642-33191-6_49")
185
+ expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-642-33191-6_49")
186
+ expect(subject.type).to eq("BookChapter")
187
+ expect(subject.contributors.length).to eq(3)
188
+ expect(subject.contributors.first).to eq("familyName" => "Chen", "givenName" => "Lili",
189
+ "type" => "Person", "contributorRoles" => ["Author"])
190
+ expect(subject.titles).to eq([{ "title" => "Human Body Orientation Estimation in Multiview Scenarios" }])
191
+ expect(subject.date).to eq("published" => "2012", "updated" => "2020-11-24")
192
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
193
+ "name" => "Springer Science and Business Media LLC")
194
194
  expect(subject.references.length).to eq(11)
195
- expect(subject.references.first).to eq('key' => '49_CR1',
196
- 'unstructured' => 'Khan, S., Javed, O., Rasheed, Z., Shah, M.: Human tracking in multiple cameras. In: Proceedings of the 8th IEEE International Conference on Computer Vision, Vancouver, Canada, pp. 331–336 (2001)')
197
- expect(subject.container).to eq('identifier' => '1611-3349', 'identifierType' => 'ISSN',
198
- 'title' => 'Advances in Visual Computing', 'type' => 'Book', 'firstPage' => '499', 'lastPage' => '508')
199
- expect(subject.provider).to eq('Crossref')
200
- end
201
-
202
- it 'posted_content' do
203
- input = 'https://doi.org/10.1101/097196'
204
- subject = described_class.new(input: input)
205
- expect(subject.valid?).to be true
206
- expect(subject.url).to eq('http://biorxiv.org/lookup/doi/10.1101/097196')
207
- expect(subject.type).to eq('Article')
208
- expect(subject.creators.count).to eq(11)
209
- expect(subject.creators.last).to eq('id' => 'https://orcid.org/0000-0003-4060-7360',
210
- 'givenName' => 'Timothy', 'familyName' => 'Clark', 'type' => 'Person')
211
- expect(subject.titles).to eq([{ 'title' => 'A Data Citation Roadmap for Scholarly Data Repositories' }])
212
- expect(subject.id).to eq('https://doi.org/10.1101/097196')
213
- expect(subject.descriptions.first['description']).to start_with('AbstractThis article presents a practical roadmap')
214
- expect(subject.date).to eq('published' => '2016-12-28', 'updated' => '2020-01-18')
215
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/246',
216
- 'name' => 'Cold Spring Harbor Laboratory')
195
+ expect(subject.references.first).to eq("key" => "49_CR1",
196
+ "unstructured" => "Khan, S., Javed, O., Rasheed, Z., Shah, M.: Human tracking in multiple cameras. In: Proceedings of the 8th IEEE International Conference on Computer Vision, Vancouver, Canada, pp. 331–336 (2001)")
197
+ expect(subject.container).to eq("identifier" => "1611-3349", "identifierType" => "ISSN",
198
+ "title" => "Advances in Visual Computing", "type" => "Book", "firstPage" => "499", "lastPage" => "508")
199
+ expect(subject.provider).to eq("Crossref")
200
+ end
201
+
202
+ it "posted_content" do
203
+ input = "https://doi.org/10.1101/097196"
204
+ subject = described_class.new(input: input)
205
+ expect(subject.valid?).to be true
206
+ expect(subject.url).to eq("http://biorxiv.org/lookup/doi/10.1101/097196")
207
+ expect(subject.type).to eq("Article")
208
+ expect(subject.contributors.count).to eq(11)
209
+ expect(subject.contributors.last).to eq("id" => "https://orcid.org/0000-0003-4060-7360",
210
+ "givenName" => "Timothy", "familyName" => "Clark", "type" => "Person", "contributorRoles" => ["Author"])
211
+ expect(subject.titles).to eq([{ "title" => "A Data Citation Roadmap for Scholarly Data Repositories" }])
212
+ expect(subject.id).to eq("https://doi.org/10.1101/097196")
213
+ expect(subject.descriptions.first["description"]).to start_with("AbstractThis article presents a practical roadmap")
214
+ expect(subject.date).to eq("published" => "2016-12-28", "updated" => "2020-01-18")
215
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/246",
216
+ "name" => "Cold Spring Harbor Laboratory")
217
217
  expect(subject.container.empty?).to be(true)
218
- expect(subject.provider).to eq('Crossref')
218
+ expect(subject.provider).to eq("Crossref")
219
219
  end
220
220
 
221
- it 'peer review' do
222
- input = '10.7554/elife.55167.sa2'
221
+ it "peer review" do
222
+ input = "10.7554/elife.55167.sa2"
223
223
  subject = described_class.new(input: input)
224
224
  expect(subject.valid?).to be true
225
- expect(subject.url).to eq('https://elifesciences.org/articles/55167')
226
- expect(subject.type).to eq('PeerReview')
227
- expect(subject.creators.count).to eq(8)
228
- expect(subject.creators.last).to eq('type' => 'Person', 'affiliation' => [{ 'name' => 'Center for Computational Mathematics, Flatiron Institute, New York, United States' }],
229
- 'familyName' => 'Barnett',
230
- 'givenName' => 'Alex H')
231
- expect(subject.titles).to eq([{ 'title' => 'Author response: SpikeForest, reproducible web-facing ground-truth validation of automated neural spike sorters' }])
232
- expect(subject.id).to eq('https://doi.org/10.7554/elife.55167.sa2')
225
+ expect(subject.url).to eq("https://elifesciences.org/articles/55167")
226
+ expect(subject.type).to eq("PeerReview")
227
+ expect(subject.contributors.count).to eq(8)
228
+ expect(subject.contributors.last).to eq("type" => "Person", "contributorRoles" => ["Author"], "affiliation" => [{ "name" => "Center for Computational Mathematics, Flatiron Institute, New York, United States" }],
229
+ "familyName" => "Barnett",
230
+ "givenName" => "Alex H")
231
+ expect(subject.titles).to eq([{ "title" => "Author response: SpikeForest, reproducible web-facing ground-truth validation of automated neural spike sorters" }])
232
+ expect(subject.id).to eq("https://doi.org/10.7554/elife.55167.sa2")
233
233
  expect(subject.alternate_identifiers.empty?).to be(true)
234
234
  expect(subject.descriptions.empty?).to be(true)
235
- expect(subject.date).to eq('published' => '2020-04-29', 'updated' => '2020-05-19')
236
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/4374',
237
- 'name' => 'eLife Sciences Publications, Ltd')
238
- expect(subject.provider).to eq('Crossref')
235
+ expect(subject.date).to eq("published" => "2020-04-29", "updated" => "2020-05-19")
236
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/4374",
237
+ "name" => "eLife Sciences Publications, Ltd")
238
+ expect(subject.provider).to eq("Crossref")
239
239
  end
240
240
 
241
- it 'dissertation' do
242
- input = '10.14264/uql.2020.791'
241
+ it "dissertation" do
242
+ input = "10.14264/uql.2020.791"
243
243
  subject = described_class.new(input: input)
244
244
  expect(subject.valid?).to be true
245
- expect(subject.url).to eq('http://espace.library.uq.edu.au/view/UQ:23a1e74')
246
- expect(subject.type).to eq('Dissertation')
247
- expect(subject.creators).to eq([{ 'familyName' => 'Collingwood',
248
- 'givenName' => 'Patricia Maree',
249
- 'id' => 'https://orcid.org/0000-0003-3086-4443',
250
- 'type' => 'Person' }])
251
- expect(subject.titles).to eq([{ 'title' => 'School truancy and financial independence during emerging adulthood: a longitudinal analysis of receipt of and reliance on cash transfers' }])
252
- expect(subject.id).to eq('https://doi.org/10.14264/uql.2020.791')
245
+ expect(subject.url).to eq("http://espace.library.uq.edu.au/view/UQ:23a1e74")
246
+ expect(subject.type).to eq("Dissertation")
247
+ expect(subject.contributors).to eq([{ "familyName" => "Collingwood",
248
+ "givenName" => "Patricia Maree",
249
+ "id" => "https://orcid.org/0000-0003-3086-4443",
250
+ "type" => "Person", "contributorRoles" => ["Author"] }])
251
+ expect(subject.titles).to eq([{ "title" => "School truancy and financial independence during emerging adulthood: a longitudinal analysis of receipt of and reliance on cash transfers" }])
252
+ expect(subject.id).to eq("https://doi.org/10.14264/uql.2020.791")
253
253
  expect(subject.alternate_identifiers.empty?).to be(true)
254
254
  expect(subject.descriptions.empty?).to be(true)
255
- expect(subject.date).to eq('published' => '2020-06-08', 'updated' => '2020-06-08')
256
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/5387',
257
- 'name' => 'University of Queensland Library')
258
- expect(subject.provider).to eq('Crossref')
259
- end
260
-
261
- it 'DOI with SICI DOI' do
262
- input = '10.1890/0012-9658(2006)87[2832:tiopma]2.0.co;2'
263
- subject = described_class.new(input: input)
264
- expect(subject.valid?).to be true
265
- expect(subject.id).to eq('https://doi.org/10.1890/0012-9658(2006)87%255b2832:tiopma%255d2.0.co;2')
266
- expect(subject.url).to eq('http://doi.wiley.com/10.1890/0012-9658(2006)87%5B2832:TIOPMA%5D2.0.CO;2')
267
- expect(subject.type).to eq('JournalArticle')
268
- expect(subject.creators).to eq([
269
- { 'familyName' => 'Fenton', 'givenName' => 'A.',
270
- 'type' => 'Person' }, { 'familyName' => 'Rands', 'givenName' => 'S. A.', 'type' => 'Person' }
271
- ])
272
- expect(subject.license).to eq('url' => 'http://doi.wiley.com/10.1002/tdm_license_1.1')
273
- expect(subject.titles).to eq([{ 'title' => 'THE IMPACT OF PARASITE MANIPULATION AND PREDATOR FORAGING BEHAVIOR ON PREDATOR–PREY COMMUNITIES' }])
274
- expect(subject.date).to eq('published' => '2006-11', 'updated' => '2019-04-28')
275
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/311',
276
- 'name' => 'Wiley')
255
+ expect(subject.date).to eq("published" => "2020-06-08", "updated" => "2020-06-08")
256
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/5387",
257
+ "name" => "University of Queensland Library")
258
+ expect(subject.provider).to eq("Crossref")
259
+ end
260
+
261
+ it "DOI with SICI DOI" do
262
+ input = "10.1890/0012-9658(2006)87[2832:tiopma]2.0.co;2"
263
+ subject = described_class.new(input: input)
264
+ expect(subject.valid?).to be true
265
+ expect(subject.id).to eq("https://doi.org/10.1890/0012-9658(2006)87%255b2832:tiopma%255d2.0.co;2")
266
+ expect(subject.url).to eq("http://doi.wiley.com/10.1890/0012-9658(2006)87%5B2832:TIOPMA%5D2.0.CO;2")
267
+ expect(subject.type).to eq("JournalArticle")
268
+ expect(subject.contributors).to eq([
269
+ { "familyName" => "Fenton", "givenName" => "A.",
270
+ "type" => "Person", "contributorRoles" => ["Author"] }, { "familyName" => "Rands", "givenName" => "S. A.", "type" => "Person", "contributorRoles" => ["Author"] },
271
+ ])
272
+ expect(subject.license).to eq("url" => "http://doi.wiley.com/10.1002/tdm_license_1.1")
273
+ expect(subject.titles).to eq([{ "title" => "THE IMPACT OF PARASITE MANIPULATION AND PREDATOR FORAGING BEHAVIOR ON PREDATOR–PREY COMMUNITIES" }])
274
+ expect(subject.date).to eq("published" => "2006-11", "updated" => "2019-04-28")
275
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/311",
276
+ "name" => "Wiley")
277
277
  expect(subject.references.length).to eq(39)
278
- expect(subject.references.last).to eq('key' => 'i0012-9658-87-11-2832-ydenberg1',
279
- 'unstructured' => 'R. C. Ydenberg, 1998 .Behavioral decisions about foraging and predator avoidance .Pages343 -378inR. Dukas, editorCognitive ecology: the evolutionary ecology of information processing and decision making University of Chicago Press, Chicago, Illinois, USA.')
280
- expect(subject.container).to eq('firstPage' => '2832', 'identifier' => '0012-9658',
281
- 'identifierType' => 'ISSN', 'issue' => '11', 'lastPage' => '2841', 'title' => 'Ecology', 'type' => 'Journal', 'volume' => '87')
282
- expect(subject.provider).to eq('Crossref')
283
- end
284
-
285
- it 'DOI with ORCID ID' do
286
- input = 'https://doi.org/10.1155/2012/291294'
287
- subject = described_class.new(input: input)
288
- expect(subject.valid?).to be true
289
- expect(subject.id).to eq('https://doi.org/10.1155/2012/291294')
290
- expect(subject.url).to eq('http://www.hindawi.com/journals/pm/2012/291294')
291
- expect(subject.type).to eq('JournalArticle')
292
- expect(subject.creators.length).to eq(7)
293
- expect(subject.creators[2]).to eq('type' => 'Person',
294
- 'id' => 'https://orcid.org/0000-0003-2043-4925',
295
- 'givenName' => 'Beatriz', 'familyName' => 'Hernandez', 'affiliation' => [{ 'name' => 'War Related Illness and Injury Study Center (WRIISC) and Mental Illness Research Education and Clinical Center (MIRECC), Department of Veterans Affairs, Palo Alto, CA 94304, USA' }, { 'name' => 'Department of Psychiatry and Behavioral Sciences, Stanford University School of Medicine, Stanford, CA 94304, USA' }])
296
- expect(subject.license).to eq('id' => 'CC-BY-3.0',
297
- 'url' => 'https://creativecommons.org/licenses/by/3.0/legalcode')
298
- expect(subject.titles).to eq([{ 'title' => 'Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers' }])
299
- expect(subject.date).to include('published' => '2012')
300
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/98',
301
- 'name' => 'Hindawi Limited')
278
+ expect(subject.references.last).to eq("key" => "i0012-9658-87-11-2832-ydenberg1",
279
+ "unstructured" => "R. C. Ydenberg, 1998 .Behavioral decisions about foraging and predator avoidance .Pages343 -378inR. Dukas, editorCognitive ecology: the evolutionary ecology of information processing and decision making University of Chicago Press, Chicago, Illinois, USA.")
280
+ expect(subject.container).to eq("firstPage" => "2832", "identifier" => "0012-9658",
281
+ "identifierType" => "ISSN", "issue" => "11", "lastPage" => "2841", "title" => "Ecology", "type" => "Journal", "volume" => "87")
282
+ expect(subject.provider).to eq("Crossref")
283
+ end
284
+
285
+ it "DOI with ORCID ID" do
286
+ input = "https://doi.org/10.1155/2012/291294"
287
+ subject = described_class.new(input: input)
288
+ expect(subject.valid?).to be true
289
+ expect(subject.id).to eq("https://doi.org/10.1155/2012/291294")
290
+ expect(subject.url).to eq("http://www.hindawi.com/journals/pm/2012/291294")
291
+ expect(subject.type).to eq("JournalArticle")
292
+ expect(subject.contributors.length).to eq(7)
293
+ expect(subject.contributors[2]).to eq("type" => "Person",
294
+ "id" => "https://orcid.org/0000-0003-2043-4925", "contributorRoles" => ["Author"],
295
+ "givenName" => "Beatriz", "familyName" => "Hernandez", "affiliation" => [{ "name" => "War Related Illness and Injury Study Center (WRIISC) and Mental Illness Research Education and Clinical Center (MIRECC), Department of Veterans Affairs, Palo Alto, CA 94304, USA" }, { "name" => "Department of Psychiatry and Behavioral Sciences, Stanford University School of Medicine, Stanford, CA 94304, USA" }])
296
+ expect(subject.license).to eq("id" => "CC-BY-3.0",
297
+ "url" => "https://creativecommons.org/licenses/by/3.0/legalcode")
298
+ expect(subject.titles).to eq([{ "title" => "Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers" }])
299
+ expect(subject.date).to include("published" => "2012")
300
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/98",
301
+ "name" => "Hindawi Limited")
302
302
  expect(subject.references.length).to eq(27)
303
- expect(subject.references.last).to eq('doi' => 'https://doi.org/10.1378/chest.12-0045',
304
- 'key' => '30')
305
- expect(subject.container).to eq('firstPage' => '1', 'identifier' => '2090-1844',
306
- 'identifierType' => 'ISSN', 'lastPage' => '7', 'title' => 'Pulmonary Medicine', 'type' => 'Journal', 'volume' => '2012')
307
- expect(subject.provider).to eq('Crossref')
308
- end
309
-
310
- it 'date in future' do
311
- input = 'https://doi.org/10.1016/j.ejphar.2015.03.018'
312
- subject = described_class.new(input: input)
313
- expect(subject.valid?).to be true
314
- expect(subject.id).to eq('https://doi.org/10.1016/j.ejphar.2015.03.018')
315
- expect(subject.url).to eq('https://linkinghub.elsevier.com/retrieve/pii/S0014299915002332')
316
- expect(subject.type).to eq('JournalArticle')
317
- expect(subject.creators.length).to eq(10)
318
- expect(subject.creators.first).to eq('type' => 'Person',
319
- 'givenName' => 'Sarah E.', 'familyName' => 'Beck')
320
- expect(subject.titles).to eq([{ 'title' => 'Paving the path to HIV neurotherapy: Predicting SIV CNS disease' }])
321
- expect(subject.date).to include('published' => '2015-07')
322
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/78',
323
- 'name' => 'Elsevier BV')
303
+ expect(subject.references.last).to eq("doi" => "https://doi.org/10.1378/chest.12-0045",
304
+ "key" => "30")
305
+ expect(subject.container).to eq("firstPage" => "1", "identifier" => "2090-1844",
306
+ "identifierType" => "ISSN", "lastPage" => "7", "title" => "Pulmonary Medicine", "type" => "Journal", "volume" => "2012")
307
+ expect(subject.provider).to eq("Crossref")
308
+ end
309
+
310
+ it "date in future" do
311
+ input = "https://doi.org/10.1016/j.ejphar.2015.03.018"
312
+ subject = described_class.new(input: input)
313
+ expect(subject.valid?).to be true
314
+ expect(subject.id).to eq("https://doi.org/10.1016/j.ejphar.2015.03.018")
315
+ expect(subject.url).to eq("https://linkinghub.elsevier.com/retrieve/pii/S0014299915002332")
316
+ expect(subject.type).to eq("JournalArticle")
317
+ expect(subject.contributors.length).to eq(10)
318
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
319
+ "givenName" => "Sarah E.", "familyName" => "Beck")
320
+ expect(subject.titles).to eq([{ "title" => "Paving the path to HIV neurotherapy: Predicting SIV CNS disease" }])
321
+ expect(subject.date).to include("published" => "2015-07")
322
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/78",
323
+ "name" => "Elsevier BV")
324
324
  expect(subject.references.length).to eq(98)
325
- expect(subject.references.first).to eq('containerTitle' => 'J. Immunol',
326
- 'creator' => 'Allen',
327
- 'firstPage' => '6062',
328
- 'key' => '10.1016/j.ejphar.2015.03.018_bib1',
329
- 'publicationYear' => '1998',
330
- 'title' => 'Characterization of the peptide binding motif of a rhesus MHC class I molecule (Mamu-A*01) that binds an immunodominant CTL epitope from simianimmunodeficiency virus.',
331
- 'volume' => '160')
332
- expect(subject.container).to eq('firstPage' => '303', 'identifier' => '0014-2999',
333
- 'identifierType' => 'ISSN', 'lastPage' => '312', 'title' => 'European Journal of Pharmacology', 'type' => 'Journal', 'volume' => '759')
334
- expect(subject.provider).to eq('Crossref')
335
- end
336
-
337
- it 'vor with url' do
338
- input = 'https://doi.org/10.1038/hdy.2013.26'
339
- subject = described_class.new(input: input)
340
- expect(subject.valid?).to be true
341
- expect(subject.id).to eq('https://doi.org/10.1038/hdy.2013.26')
342
- expect(subject.url).to eq('https://www.nature.com/articles/hdy201326')
343
- expect(subject.type).to eq('JournalArticle')
344
- expect(subject.creators.length).to eq(2)
345
- expect(subject.creators.first).to eq('type' => 'Person', 'familyName' => 'Gross',
346
- 'givenName' => 'J B')
347
- expect(subject.titles).to eq([{ 'title' => 'Albinism in phylogenetically and geographically distinct populations of Astyanax cavefish arises through the same loss-of-function Oca2 allele' }])
348
- expect(subject.date).to include('published' => '2013-04-10')
349
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/297',
350
- 'name' => 'Springer Science and Business Media LLC')
325
+ expect(subject.references.first).to eq("containerTitle" => "J. Immunol",
326
+ "contributor" => "Allen",
327
+ "firstPage" => "6062",
328
+ "key" => "10.1016/j.ejphar.2015.03.018_bib1",
329
+ "publicationYear" => "1998",
330
+ "title" => "Characterization of the peptide binding motif of a rhesus MHC class I molecule (Mamu-A*01) that binds an immunodominant CTL epitope from simianimmunodeficiency virus.",
331
+ "volume" => "160")
332
+ expect(subject.container).to eq("firstPage" => "303", "identifier" => "0014-2999",
333
+ "identifierType" => "ISSN", "lastPage" => "312", "title" => "European Journal of Pharmacology", "type" => "Journal", "volume" => "759")
334
+ expect(subject.provider).to eq("Crossref")
335
+ end
336
+
337
+ it "vor with url" do
338
+ input = "https://doi.org/10.1038/hdy.2013.26"
339
+ subject = described_class.new(input: input)
340
+ expect(subject.valid?).to be true
341
+ expect(subject.id).to eq("https://doi.org/10.1038/hdy.2013.26")
342
+ expect(subject.url).to eq("https://www.nature.com/articles/hdy201326")
343
+ expect(subject.type).to eq("JournalArticle")
344
+ expect(subject.contributors.length).to eq(2)
345
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Gross",
346
+ "givenName" => "J B")
347
+ expect(subject.titles).to eq([{ "title" => "Albinism in phylogenetically and geographically distinct populations of Astyanax cavefish arises through the same loss-of-function Oca2 allele" }])
348
+ expect(subject.date).to include("published" => "2013-04-10")
349
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
350
+ "name" => "Springer Science and Business Media LLC")
351
351
  expect(subject.references.size).to eq(41)
352
- expect(subject.references.first).to eq('containerTitle' => 'An Esc Nac Cien Biol México',
353
- 'creator' => 'J Alvarez',
354
- 'firstPage' => '263',
355
- 'key' => 'BFhdy201326_CR1',
356
- 'publicationYear' => '1946',
357
- 'unstructured' => 'Alvarez J . (1946). Revisión del género Anoptichthys con descipción de una especie nueva (Pisces, Characidae). An Esc Nac Cien Biol México 4: 263–282.',
358
- 'volume' => '4')
359
- expect(subject.container).to eq('firstPage' => '122', 'identifier' => '1365-2540',
360
- 'identifierType' => 'ISSN', 'issue' => '2', 'lastPage' => '130', 'title' => 'Heredity', 'type' => 'Journal', 'volume' => '111')
361
- expect(subject.provider).to eq('Crossref')
362
- end
363
-
364
- it 'dataset' do
365
- input = 'https://doi.org/10.2210/pdb4hhb/pdb'
366
- subject = described_class.new(input: input)
367
- expect(subject.valid?).to be true
368
- expect(subject.id).to eq('https://doi.org/10.2210/pdb4hhb/pdb')
369
- expect(subject.url).to eq('https://www.wwpdb.org/pdb?id=pdb_00004hhb')
370
- expect(subject.type).to eq('Component')
371
- expect(subject.creators.length).to eq(2)
372
- expect(subject.creators.first).to eq('type' => 'Person', 'givenName' => 'G.',
373
- 'familyName' => 'Fermi')
374
- expect(subject.titles).to eq([{ 'title' => 'THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT 1.74 ANGSTROMS RESOLUTION' }])
352
+ expect(subject.references.first).to eq("containerTitle" => "An Esc Nac Cien Biol México",
353
+ "contributor" => "J Alvarez",
354
+ "firstPage" => "263",
355
+ "key" => "BFhdy201326_CR1",
356
+ "publicationYear" => "1946",
357
+ "unstructured" => "Alvarez J . (1946). Revisión del género Anoptichthys con descipción de una especie nueva (Pisces, Characidae). An Esc Nac Cien Biol México 4: 263–282.",
358
+ "volume" => "4")
359
+ expect(subject.container).to eq("firstPage" => "122", "identifier" => "1365-2540",
360
+ "identifierType" => "ISSN", "issue" => "2", "lastPage" => "130", "title" => "Heredity", "type" => "Journal", "volume" => "111")
361
+ expect(subject.provider).to eq("Crossref")
362
+ end
363
+
364
+ it "dataset" do
365
+ input = "https://doi.org/10.2210/pdb4hhb/pdb"
366
+ subject = described_class.new(input: input)
367
+ expect(subject.valid?).to be true
368
+ expect(subject.id).to eq("https://doi.org/10.2210/pdb4hhb/pdb")
369
+ expect(subject.url).to eq("https://www.wwpdb.org/pdb?id=pdb_00004hhb")
370
+ expect(subject.type).to eq("Component")
371
+ expect(subject.contributors.length).to eq(2)
372
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "givenName" => "G.",
373
+ "familyName" => "Fermi")
374
+ expect(subject.titles).to eq([{ "title" => "THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT 1.74 ANGSTROMS RESOLUTION" }])
375
375
  expect(subject.descriptions).to eq([])
376
- expect(subject.date).to include('published' => '1984-07-17')
377
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/7763',
378
- 'name' => 'Worldwide Protein Data Bank')
379
- expect(subject.provider).to eq('Crossref')
376
+ expect(subject.date).to include("published" => "1984-07-17")
377
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/7763",
378
+ "name" => "Worldwide Protein Data Bank")
379
+ expect(subject.provider).to eq("Crossref")
380
380
  end
381
381
 
382
- it 'component' do
383
- input = 'https://doi.org/10.1371/journal.pmed.0030277.g001'
382
+ it "component" do
383
+ input = "https://doi.org/10.1371/journal.pmed.0030277.g001"
384
384
  subject = described_class.new(input: input)
385
385
  expect(subject.valid?).to be false
386
- expect(subject.errors).to eq(["property '/creators' is invalid: error_type=minItems"])
387
- expect(subject.id).to eq('https://doi.org/10.1371/journal.pmed.0030277.g001')
388
- expect(subject.url).to eq('https://dx.plos.org/10.1371/journal.pmed.0030277.g001')
389
- expect(subject.type).to eq('Component')
390
- expect(subject.creators.empty?).to be true
391
- expect(subject.titles).to eq([{ 'title' => ':(unav)' }])
386
+ expect(subject.errors).to eq(["property '/contributors' is invalid: error_type=minItems"])
387
+ expect(subject.id).to eq("https://doi.org/10.1371/journal.pmed.0030277.g001")
388
+ expect(subject.url).to eq("https://dx.plos.org/10.1371/journal.pmed.0030277.g001")
389
+ expect(subject.type).to eq("Component")
390
+ expect(subject.contributors.empty?).to be true
391
+ expect(subject.titles).to eq([{ "title" => ":(unav)" }])
392
392
  expect(subject.descriptions.empty?).to be(true)
393
- expect(subject.date).to eq('published' => '2015-10-20', 'updated' => '2018-10-19')
394
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/340',
395
- 'name' => 'Public Library of Science (PLoS)')
396
- expect(subject.provider).to eq('Crossref')
393
+ expect(subject.date).to eq("published" => "2015-10-20", "updated" => "2018-10-19")
394
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/340",
395
+ "name" => "Public Library of Science (PLoS)")
396
+ expect(subject.provider).to eq("Crossref")
397
397
  end
398
398
 
399
- it 'dataset usda' do
400
- input = 'https://doi.org/10.2737/RDS-2018-0001'
399
+ it "dataset usda" do
400
+ input = "https://doi.org/10.2737/RDS-2018-0001"
401
401
  subject = described_class.new(input: input)
402
402
  expect(subject.valid?).to be true
403
- expect(subject.id).to eq('https://doi.org/10.2737/rds-2018-0001')
404
- expect(subject.url).to eq('https://www.fs.usda.gov/rds/archive/Catalog/RDS-2018-0001')
405
- expect(subject.type).to eq('Dataset')
406
- expect(subject.creators.length).to eq(4)
407
- expect(subject.creators.first).to eq('familyName' => 'Ribic', 'givenName' => 'Christine A.',
408
- 'affiliation' => [{ 'name' => 'U.S. Geological Survey' }],
409
- 'id' => 'https://orcid.org/0000-0003-2583-1778', 'type' => 'Person')
410
- expect(subject.titles).to eq([{ 'title' => 'Fledging times of grassland birds' }])
403
+ expect(subject.id).to eq("https://doi.org/10.2737/rds-2018-0001")
404
+ expect(subject.url).to eq("https://www.fs.usda.gov/rds/archive/Catalog/RDS-2018-0001")
405
+ expect(subject.type).to eq("Dataset")
406
+ expect(subject.contributors.length).to eq(4)
407
+ expect(subject.contributors.first).to eq("familyName" => "Ribic", "givenName" => "Christine A.",
408
+ "affiliation" => [{ "name" => "U.S. Geological Survey" }],
409
+ "id" => "https://orcid.org/0000-0003-2583-1778", "type" => "Person", "contributorRoles" => ["Author"])
410
+ expect(subject.titles).to eq([{ "title" => "Fledging times of grassland birds" }])
411
411
  expect(subject.descriptions.empty?).to be(true)
412
- expect(subject.date).to eq('published' => '2017-08-09', 'updated' => '2021-07-01')
413
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/1450',
414
- 'name' => 'USDA Forest Service')
415
- expect(subject.provider).to eq('Crossref')
416
- end
417
-
418
- it 'book chapter' do
419
- input = 'https://doi.org/10.1007/978-3-662-46370-3_13'
420
- subject = described_class.new(input: input)
421
- expect(subject.valid?).to be true
422
- expect(subject.id).to eq('https://doi.org/10.1007/978-3-662-46370-3_13')
423
- expect(subject.url).to eq('https://link.springer.com/10.1007/978-3-662-46370-3_13')
424
- expect(subject.type).to eq('BookChapter')
425
- expect(subject.creators.length).to eq(2)
426
- expect(subject.creators.first).to eq('type' => 'Person',
427
- 'givenName' => 'Ronald L.', 'familyName' => 'Diercks')
428
- expect(subject.titles).to eq([{ 'title' => 'Clinical Symptoms and Physical Examinations' }])
429
- expect(subject.date).to eq('published' => '2015', 'updated' => '2023-02-10')
430
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/297',
431
- 'name' => 'Springer Science and Business Media LLC')
432
- expect(subject.provider).to eq('Crossref')
433
- expect(subject.container['type']).to eq('Book')
434
- expect(subject.container['title']).to eq('Shoulder Stiffness')
435
- expect(subject.container['firstPage']).to eq('155')
436
- expect(subject.container['lastPage']).to eq('158')
437
- end
438
-
439
- it 'another book chapter' do
440
- input = 'https://doi.org/10.1007/978-3-319-75889-3_1'
441
- subject = described_class.new(input: input)
442
- expect(subject.valid?).to be true
443
- expect(subject.id).to eq('https://doi.org/10.1007/978-3-319-75889-3_1')
444
- expect(subject.url).to eq('http://link.springer.com/10.1007/978-3-319-75889-3_1')
445
- expect(subject.type).to eq('BookChapter')
446
- expect(subject.creators).to eq([{ 'familyName' => 'Jones', 'givenName' => 'Hunter M.',
447
- 'type' => 'Person' }])
448
- expect(subject.titles).to eq([{ 'title' => 'Climate Change and Increasing Risk of Extreme Heat' }])
449
- expect(subject.date).to include('published' => '2018')
450
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/297',
451
- 'name' => 'Springer Science and Business Media LLC')
452
- expect(subject.provider).to eq('Crossref')
453
- expect(subject.container['type']).to eq('Book')
454
- expect(subject.container['title']).to eq('SpringerBriefs in Medical Earth Sciences')
455
- expect(subject.container['identifier']).to eq('2523-3629')
456
- expect(subject.container['identifierType']).to eq('ISSN')
457
- end
458
-
459
- it 'yet another book chapter' do
460
- input = 'https://doi.org/10.4018/978-1-4666-1891-6.ch004'
461
- subject = described_class.new(input: input)
462
- expect(subject.valid?).to be true
463
- expect(subject.id).to eq('https://doi.org/10.4018/978-1-4666-1891-6.ch004')
464
- expect(subject.url).to eq('http://services.igi-global.com/resolvedoi/resolve.aspx?doi=10.4018%2F978-1-4666-1891-6.ch004')
465
- expect(subject.type).to eq('BookChapter')
466
- expect(subject.creators).to eq([{ 'type' => 'Person', 'affiliation' => [{ 'name' => 'Université de Lyon, France' }],
467
- 'familyName' => 'Bichot', 'givenName' => 'Charles-Edmond' }])
468
- expect(subject.titles).to eq([{ 'title' => 'Unsupervised and Supervised Image Segmentation Using Graph Partitioning' }])
469
- expect(subject.date).to eq('published' => '2012-08-08', 'updated' => '2019-07-02')
470
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/2432',
471
- 'name' => 'IGI Global')
472
- expect(subject.provider).to eq('Crossref')
473
- expect(subject.container['type']).to eq('Book')
474
- expect(subject.container['title']).to eq('Graph-Based Methods in Computer Vision')
475
- expect(subject.container['firstPage']).to eq('72')
476
- expect(subject.container['lastPage']).to eq('94')
477
- end
478
-
479
- it 'missing creator' do
480
- input = 'https://doi.org/10.3390/publications6020015'
481
- subject = described_class.new(input: input)
482
- expect(subject.valid?).to be true
483
- expect(subject.id).to eq('https://doi.org/10.3390/publications6020015')
484
- expect(subject.url).to eq('https://www.mdpi.com/2304-6775/6/2/15')
485
- expect(subject.type).to eq('JournalArticle')
486
- expect(subject.creators).to eq([{ 'familyName' => 'Kohls',
487
- 'givenName' => 'Alexander',
488
- 'id' => 'https://orcid.org/0000-0002-3836-8885',
489
- 'type' => 'Person' },
490
- { 'familyName' => 'Mele',
491
- 'givenName' => 'Salvatore',
492
-
493
- 'id' => 'https://orcid.org/0000-0003-0762-2235',
494
- 'type' => 'Person' }])
495
- expect(subject.titles).to eq([{ 'title' => 'Converting the Literature of a Scientific Field to Open Access through Global Collaboration: The Experience of SCOAP3 in Particle Physics' }])
496
- expect(subject.date).to eq('published' => '2018-04-09', 'updated' => '2021-07-22')
497
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/1968',
498
- 'name' => 'MDPI AG')
499
- expect(subject.provider).to eq('Crossref')
500
- end
501
-
502
- it 'book' do
503
- input = 'https://doi.org/10.1017/9781108348843'
504
- subject = described_class.new(input: input)
505
- expect(subject.valid?).to be true
506
- expect(subject.id).to eq('https://doi.org/10.1017/9781108348843')
507
- expect(subject.url).to eq('https://www.cambridge.org/core/product/identifier/9781108348843/type/book')
508
- expect(subject.type).to eq('Book')
509
- expect(subject.creators).to eq([{ 'type' => 'Person', 'familyName' => 'Leung',
510
- 'givenName' => 'Vincent S.' }])
511
- expect(subject.titles).to eq([{ 'title' => 'The Politics of the Past in Early China' }])
512
- expect(subject.date).to eq('published' => '2019-07-01', 'updated' => '2022-09-22')
513
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/56',
514
- 'name' => 'Cambridge University Press (CUP)')
515
- expect(subject.provider).to eq('Crossref')
516
- end
517
-
518
- it 'another book' do
519
- input = 'https://doi.org/10.2973/odp.proc.ir.180.2000'
520
- subject = described_class.new(input: input)
521
- expect(subject.valid?).to be false
522
- expect(subject.errors).to eq(["property '/creators' is invalid: error_type=minItems"])
523
- expect(subject.id).to eq('https://doi.org/10.2973/odp.proc.ir.180.2000')
524
- expect(subject.url).to eq('http://www-odp.tamu.edu/publications/180_IR/180TOC.HTM')
525
- expect(subject.type).to eq('Book')
526
- expect(subject.creators.empty?).to be true
412
+ expect(subject.date).to eq("published" => "2017-08-09", "updated" => "2021-07-01")
413
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/1450",
414
+ "name" => "USDA Forest Service")
415
+ expect(subject.provider).to eq("Crossref")
416
+ end
417
+
418
+ it "book chapter" do
419
+ input = "https://doi.org/10.1007/978-3-662-46370-3_13"
420
+ subject = described_class.new(input: input)
421
+ expect(subject.valid?).to be true
422
+ expect(subject.id).to eq("https://doi.org/10.1007/978-3-662-46370-3_13")
423
+ expect(subject.url).to eq("https://link.springer.com/10.1007/978-3-662-46370-3_13")
424
+ expect(subject.type).to eq("BookChapter")
425
+ expect(subject.contributors.length).to eq(2)
426
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
427
+ "givenName" => "Ronald L.", "familyName" => "Diercks")
428
+ expect(subject.titles).to eq([{ "title" => "Clinical Symptoms and Physical Examinations" }])
429
+ expect(subject.date).to eq("published" => "2015", "updated" => "2023-02-10")
430
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
431
+ "name" => "Springer Science and Business Media LLC")
432
+ expect(subject.provider).to eq("Crossref")
433
+ expect(subject.container["type"]).to eq("Book")
434
+ expect(subject.container["title"]).to eq("Shoulder Stiffness")
435
+ expect(subject.container["firstPage"]).to eq("155")
436
+ expect(subject.container["lastPage"]).to eq("158")
437
+ end
438
+
439
+ it "another book chapter" do
440
+ input = "https://doi.org/10.1007/978-3-319-75889-3_1"
441
+ subject = described_class.new(input: input)
442
+ expect(subject.valid?).to be true
443
+ expect(subject.id).to eq("https://doi.org/10.1007/978-3-319-75889-3_1")
444
+ expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-319-75889-3_1")
445
+ expect(subject.type).to eq("BookChapter")
446
+ expect(subject.contributors).to eq([{ "familyName" => "Jones", "givenName" => "Hunter M.",
447
+ "type" => "Person", "contributorRoles" => ["Author"] }])
448
+ expect(subject.titles).to eq([{ "title" => "Climate Change and Increasing Risk of Extreme Heat" }])
449
+ expect(subject.date).to include("published" => "2018")
450
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
451
+ "name" => "Springer Science and Business Media LLC")
452
+ expect(subject.provider).to eq("Crossref")
453
+ expect(subject.container["type"]).to eq("Book")
454
+ expect(subject.container["title"]).to eq("SpringerBriefs in Medical Earth Sciences")
455
+ expect(subject.container["identifier"]).to eq("2523-3629")
456
+ expect(subject.container["identifierType"]).to eq("ISSN")
457
+ end
458
+
459
+ it "yet another book chapter" do
460
+ input = "https://doi.org/10.4018/978-1-4666-1891-6.ch004"
461
+ subject = described_class.new(input: input)
462
+ expect(subject.valid?).to be true
463
+ expect(subject.id).to eq("https://doi.org/10.4018/978-1-4666-1891-6.ch004")
464
+ expect(subject.url).to eq("http://services.igi-global.com/resolvedoi/resolve.aspx?doi=10.4018%2F978-1-4666-1891-6.ch004")
465
+ expect(subject.type).to eq("BookChapter")
466
+ expect(subject.contributors).to eq([{ "type" => "Person", "contributorRoles" => ["Author"], "affiliation" => [{ "name" => "Université de Lyon, France" }],
467
+ "familyName" => "Bichot", "givenName" => "Charles-Edmond" }])
468
+ expect(subject.titles).to eq([{ "title" => "Unsupervised and Supervised Image Segmentation Using Graph Partitioning" }])
469
+ expect(subject.date).to eq("published" => "2012-08-08", "updated" => "2019-07-02")
470
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/2432",
471
+ "name" => "IGI Global")
472
+ expect(subject.provider).to eq("Crossref")
473
+ expect(subject.container["type"]).to eq("Book")
474
+ expect(subject.container["title"]).to eq("Graph-Based Methods in Computer Vision")
475
+ expect(subject.container["firstPage"]).to eq("72")
476
+ expect(subject.container["lastPage"]).to eq("94")
477
+ end
478
+
479
+ it "missing contributor" do
480
+ input = "https://doi.org/10.3390/publications6020015"
481
+ subject = described_class.new(input: input)
482
+ expect(subject.valid?).to be true
483
+ expect(subject.id).to eq("https://doi.org/10.3390/publications6020015")
484
+ expect(subject.url).to eq("https://www.mdpi.com/2304-6775/6/2/15")
485
+ expect(subject.type).to eq("JournalArticle")
486
+ expect(subject.contributors).to eq([{ "familyName" => "Kohls",
487
+ "givenName" => "Alexander",
488
+ "id" => "https://orcid.org/0000-0002-3836-8885",
489
+ "type" => "Person", "contributorRoles" => ["Author"] },
490
+ { "familyName" => "Mele",
491
+ "givenName" => "Salvatore",
492
+
493
+ "id" => "https://orcid.org/0000-0003-0762-2235",
494
+ "type" => "Person", "contributorRoles" => ["Author"] }])
495
+ expect(subject.titles).to eq([{ "title" => "Converting the Literature of a Scientific Field to Open Access through Global Collaboration: The Experience of SCOAP3 in Particle Physics" }])
496
+ expect(subject.date).to eq("published" => "2018-04-09", "updated" => "2021-07-22")
497
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/1968",
498
+ "name" => "MDPI AG")
499
+ expect(subject.provider).to eq("Crossref")
500
+ end
501
+
502
+ it "book" do
503
+ input = "https://doi.org/10.1017/9781108348843"
504
+ subject = described_class.new(input: input)
505
+ expect(subject.valid?).to be true
506
+ expect(subject.id).to eq("https://doi.org/10.1017/9781108348843")
507
+ expect(subject.url).to eq("https://www.cambridge.org/core/product/identifier/9781108348843/type/book")
508
+ expect(subject.type).to eq("Book")
509
+ expect(subject.contributors).to eq([{ "type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Leung",
510
+ "givenName" => "Vincent S." }])
511
+ expect(subject.titles).to eq([{ "title" => "The Politics of the Past in Early China" }])
512
+ expect(subject.date).to eq("published" => "2019-07-01", "updated" => "2022-09-22")
513
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/56",
514
+ "name" => "Cambridge University Press (CUP)")
515
+ expect(subject.provider).to eq("Crossref")
516
+ end
517
+
518
+ it "another book" do
519
+ input = "https://doi.org/10.2973/odp.proc.ir.180.2000"
520
+ subject = described_class.new(input: input)
521
+ expect(subject.valid?).to be true
522
+ expect(subject.id).to eq("https://doi.org/10.2973/odp.proc.ir.180.2000")
523
+ expect(subject.url).to eq("http://www-odp.tamu.edu/publications/180_IR/180TOC.HTM")
524
+ expect(subject.type).to eq("Book")
527
525
  expect(subject.contributors.size).to eq(4)
528
- expect(subject.contributors.first).to eq('type' => 'Person', 'contributorType' => 'Editor', 'familyName' => 'Taylor',
529
- 'givenName' => 'B.')
530
- expect(subject.titles).to eq([{ 'title' => 'Proceedings of the Ocean Drilling Program, 180 Initial Reports' }])
531
- expect(subject.date).to eq('published' => '2000-02-04', 'updated' => '2009-02-02')
532
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/1029',
533
- 'name' => 'International Ocean Discovery Program (IODP)')
534
- expect(subject.provider).to eq('Crossref')
535
- end
536
-
537
- it 'yet another book' do
538
- input = 'https://doi.org/10.1029/ar035'
539
- subject = described_class.new(input: input)
540
- expect(subject.valid?).to be true
541
- expect(subject.id).to eq('https://doi.org/10.1029/ar035')
542
- expect(subject.url).to eq('http://doi.wiley.com/10.1029/AR035')
543
- expect(subject.type).to eq('Book')
544
- expect(subject.creators).to eq([{ 'type' => 'Person', 'familyName' => 'McGinnis',
545
- 'givenName' => 'Richard Frank' }])
546
- expect(subject.titles).to eq([{ 'title' => 'Biogeography of Lanternfishes (Myctophidae) South of 30°S' }])
547
- expect(subject.date).to eq('published' => '1982', 'updated' => '2021-12-04')
548
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/311',
549
- 'name' => 'Wiley')
526
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Editor"], "familyName" => "Taylor",
527
+ "givenName" => "B.")
528
+ expect(subject.titles).to eq([{ "title" => "Proceedings of the Ocean Drilling Program, 180 Initial Reports" }])
529
+ expect(subject.date).to eq("published" => "2000-02-04", "updated" => "2009-02-02")
530
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/1029",
531
+ "name" => "International Ocean Discovery Program (IODP)")
532
+ expect(subject.provider).to eq("Crossref")
533
+ end
534
+
535
+ it "yet another book" do
536
+ input = "https://doi.org/10.1029/ar035"
537
+ subject = described_class.new(input: input)
538
+ expect(subject.valid?).to be true
539
+ expect(subject.id).to eq("https://doi.org/10.1029/ar035")
540
+ expect(subject.url).to eq("http://doi.wiley.com/10.1029/AR035")
541
+ expect(subject.type).to eq("Book")
542
+ expect(subject.contributors).to eq([{ "type" => "Person", "contributorRoles" => ["Author"], "familyName" => "McGinnis",
543
+ "givenName" => "Richard Frank" }])
544
+ expect(subject.titles).to eq([{ "title" => "Biogeography of Lanternfishes (Myctophidae) South of 30°S" }])
545
+ expect(subject.date).to eq("published" => "1982", "updated" => "2021-12-04")
546
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/311",
547
+ "name" => "Wiley")
550
548
  expect(subject.references.length).to eq(242)
551
- expect(subject.references.first).to eq('containerTitle' => 'Palaeogeogr. Palaeoclimatol. Palaeoecol.',
552
- 'creator' => 'Addicott',
553
- 'doi' => 'https://doi.org/10.1016/0031-0182(70)90103-3',
554
- 'firstPage' => '287',
555
- 'key' => '10.1029/AR035:addi70',
556
- 'publicationYear' => '1970',
557
- 'title' => 'Latitudinal gradients in tertiary mol-luscan faunas of the Pacific coast',
558
- 'volume' => '8')
559
- expect(subject.container).to eq('identifier' => '0066-4634', 'identifierType' => 'ISSN',
560
- 'title' => 'Antarctic Research Series', 'type' => 'BookSeries')
561
- expect(subject.provider).to eq('Crossref')
562
- end
563
-
564
- it 'mEDRA' do
565
- input = 'https://doi.org/10.3280/ecag2018-001005'
566
- subject = described_class.new(input: input)
567
- expect(subject.valid?).to be true
568
- expect(subject.id).to eq('https://doi.org/10.3280/ecag2018-001005')
569
- expect(subject.url).to eq('http://www.francoangeli.it/riviste/Scheda_Riviste.asp?IDArticolo=61645')
570
- expect(subject.type).to eq('JournalArticle')
571
- expect(subject.creators.length).to eq(2)
572
- expect(subject.creators.first).to eq('type' => 'Person', 'familyName' => 'Oh',
573
- 'givenName' => 'Sohae Eve')
574
- expect(subject.titles).to eq([{ 'title' => 'Substitutability between organic and conventional poultry products and organic price premiums' }])
575
- expect(subject.date).to include('published' => '2018-05')
576
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/4169',
577
- 'name' => 'Franco Angeli')
578
- expect(subject.provider).to eq('Crossref')
579
- end
580
-
581
- it 'KISTI' do
582
- input = 'https://doi.org/10.5012/bkcs.2013.34.10.2889'
583
- subject = described_class.new(input: input)
584
- expect(subject.valid?).to be true
585
- expect(subject.id).to eq('https://doi.org/10.5012/bkcs.2013.34.10.2889')
586
- expect(subject.url).to eq('http://koreascience.or.kr/journal/view.jsp?kj=JCGMCS&py=2013&vnc=v34n10&sp=2889')
587
- expect(subject.type).to eq('JournalArticle')
588
- expect(subject.creators.length).to eq(7)
589
- expect(subject.creators.first).to eq('type' => 'Person', 'familyName' => 'Huang',
590
- 'givenName' => 'Guimei')
591
- expect(subject.titles).to eq([{ 'title' => 'Synthesis, Crystal Structure and Theoretical Calculation of a Novel Nickel(II) Complex with Dibromotyrosine and 1,10-Phenanthroline' }])
592
- expect(subject.date).to eq('published' => '2013-10-20', 'updated' => '2016-12-15')
593
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/2923',
594
- 'name' => 'Korean Chemical Society')
595
- expect(subject.provider).to eq('KISTI')
596
- end
597
-
598
- it 'JaLC' do
599
- input = 'https://doi.org/10.1241/johokanri.39.979'
600
- subject = described_class.new(input: input)
601
- expect(subject.valid?).to be true
602
- expect(subject.id).to eq('https://doi.org/10.1241/johokanri.39.979')
603
- expect(subject.url).to eq('http://joi.jlc.jst.go.jp/JST.JSTAGE/johokanri/39.979?from=CrossRef')
604
- expect(subject.type).to eq('JournalArticle')
605
- expect(subject.creators).to eq([{ 'familyName' => 'KUSUMOTO', 'givenName' => 'Hiroyuki',
606
- 'type' => 'Person' }])
607
- expect(subject.titles).to eq([{ 'title' => 'Utilizing the Internet. 12 Series. Future of the Internet.' }])
608
- expect(subject.date).to eq('published' => '1997', 'updated' => '2020-03-06')
609
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/272',
610
- 'name' => 'Japan Science and Technology Agency (JST)')
611
- expect(subject.provider).to eq('JaLC')
612
- end
613
-
614
- it 'OP' do
615
- input = 'https://doi.org/10.2903/j.efsa.2018.5239'
616
- subject = described_class.new(input: input)
617
- expect(subject.valid?).to be true
618
- expect(subject.id).to eq('https://doi.org/10.2903/j.efsa.2018.5239')
619
- expect(subject.url).to eq('http://doi.wiley.com/10.2903/j.efsa.2018.5239')
620
- expect(subject.type).to eq('JournalArticle')
621
- expect(subject.creators.length).to eq(28)
622
- expect(subject.creators.first).to eq(
623
- 'name' => 'EFSA Panel on Food Additives and Nutrient Sources added to Food (ANS)', 'type' => 'Organization'
549
+ expect(subject.references.first).to eq("containerTitle" => "Palaeogeogr. Palaeoclimatol. Palaeoecol.",
550
+ "contributor" => "Addicott",
551
+ "doi" => "https://doi.org/10.1016/0031-0182(70)90103-3",
552
+ "firstPage" => "287",
553
+ "key" => "10.1029/AR035:addi70",
554
+ "publicationYear" => "1970",
555
+ "title" => "Latitudinal gradients in tertiary mol-luscan faunas of the Pacific coast",
556
+ "volume" => "8")
557
+ expect(subject.container).to eq("identifier" => "0066-4634", "identifierType" => "ISSN",
558
+ "title" => "Antarctic Research Series", "type" => "BookSeries")
559
+ expect(subject.provider).to eq("Crossref")
560
+ end
561
+
562
+ it "mEDRA" do
563
+ input = "https://doi.org/10.3280/ecag2018-001005"
564
+ subject = described_class.new(input: input)
565
+ expect(subject.valid?).to be true
566
+ expect(subject.id).to eq("https://doi.org/10.3280/ecag2018-001005")
567
+ expect(subject.url).to eq("http://www.francoangeli.it/riviste/Scheda_Riviste.asp?IDArticolo=61645")
568
+ expect(subject.type).to eq("JournalArticle")
569
+ expect(subject.contributors.length).to eq(2)
570
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Oh",
571
+ "givenName" => "Sohae Eve")
572
+ expect(subject.titles).to eq([{ "title" => "Substitutability between organic and conventional poultry products and organic price premiums" }])
573
+ expect(subject.date).to include("published" => "2018-05")
574
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/4169",
575
+ "name" => "Franco Angeli")
576
+ expect(subject.provider).to eq("Crossref")
577
+ end
578
+
579
+ it "KISTI" do
580
+ input = "https://doi.org/10.5012/bkcs.2013.34.10.2889"
581
+ subject = described_class.new(input: input)
582
+ expect(subject.valid?).to be true
583
+ expect(subject.id).to eq("https://doi.org/10.5012/bkcs.2013.34.10.2889")
584
+ expect(subject.url).to eq("http://koreascience.or.kr/journal/view.jsp?kj=JCGMCS&py=2013&vnc=v34n10&sp=2889")
585
+ expect(subject.type).to eq("JournalArticle")
586
+ expect(subject.contributors.length).to eq(7)
587
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Huang",
588
+ "givenName" => "Guimei")
589
+ expect(subject.titles).to eq([{ "title" => "Synthesis, Crystal Structure and Theoretical Calculation of a Novel Nickel(II) Complex with Dibromotyrosine and 1,10-Phenanthroline" }])
590
+ expect(subject.date).to eq("published" => "2013-10-20", "updated" => "2016-12-15")
591
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/2923",
592
+ "name" => "Korean Chemical Society")
593
+ expect(subject.provider).to eq("KISTI")
594
+ end
595
+
596
+ it "JaLC" do
597
+ input = "https://doi.org/10.1241/johokanri.39.979"
598
+ subject = described_class.new(input: input)
599
+ expect(subject.valid?).to be true
600
+ expect(subject.id).to eq("https://doi.org/10.1241/johokanri.39.979")
601
+ expect(subject.url).to eq("http://joi.jlc.jst.go.jp/JST.JSTAGE/johokanri/39.979?from=CrossRef")
602
+ expect(subject.type).to eq("JournalArticle")
603
+ expect(subject.contributors).to eq([{ "familyName" => "KUSUMOTO", "givenName" => "Hiroyuki",
604
+ "type" => "Person", "contributorRoles" => ["Author"] }])
605
+ expect(subject.titles).to eq([{ "title" => "Utilizing the Internet. 12 Series. Future of the Internet." }])
606
+ expect(subject.date).to eq("published" => "1997", "updated" => "2020-03-06")
607
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/272",
608
+ "name" => "Japan Science and Technology Agency (JST)")
609
+ expect(subject.provider).to eq("JaLC")
610
+ end
611
+
612
+ it "OP" do
613
+ input = "https://doi.org/10.2903/j.efsa.2018.5239"
614
+ subject = described_class.new(input: input)
615
+ expect(subject.valid?).to be true
616
+ expect(subject.id).to eq("https://doi.org/10.2903/j.efsa.2018.5239")
617
+ expect(subject.url).to eq("http://doi.wiley.com/10.2903/j.efsa.2018.5239")
618
+ expect(subject.type).to eq("JournalArticle")
619
+ expect(subject.contributors.length).to eq(28)
620
+ expect(subject.contributors.first).to eq(
621
+ "name" => "EFSA Panel on Food Additives and Nutrient Sources added to Food (ANS)", "type" => "Organization", "contributorRoles" => ["Author"],
624
622
  )
625
- expect(subject.titles).to eq([{ 'title' => 'Scientific opinion on the safety of green tea catechins' }])
626
- expect(subject.date).to include('published' => '2018-04')
627
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/311',
628
- 'name' => 'Wiley')
629
- expect(subject.provider).to eq('OP')
623
+ expect(subject.titles).to eq([{ "title" => "Scientific opinion on the safety of green tea catechins" }])
624
+ expect(subject.date).to include("published" => "2018-04")
625
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/311",
626
+ "name" => "Wiley")
627
+ expect(subject.provider).to eq("OP")
630
628
  end
631
629
 
632
- it 'multiple titles' do
633
- input = 'https://doi.org/10.4000/dms.865'
630
+ it "multiple titles" do
631
+ input = "https://doi.org/10.4000/dms.865"
634
632
  subject = described_class.new(input: input)
635
633
  expect(subject.valid?).to be true
636
- expect(subject.id).to eq('https://doi.org/10.4000/dms.865')
637
- expect(subject.url).to eq('http://journals.openedition.org/dms/865')
638
- expect(subject.type).to eq('JournalArticle')
639
- expect(subject.creators).to eq([{ 'familyName' => 'Peraya', 'givenName' => 'Daniel',
640
- 'type' => 'Person' }])
641
- expect(subject.titles).to eq([{ 'title' => 'Distance(s), proximity and presence(s): evolving concepts' }])
642
- expect(subject.date).to include('published' => '2014-12-14')
643
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/2399',
644
- 'name' => 'OpenEdition')
645
- expect(subject.provider).to eq('Crossref')
634
+ expect(subject.id).to eq("https://doi.org/10.4000/dms.865")
635
+ expect(subject.url).to eq("http://journals.openedition.org/dms/865")
636
+ expect(subject.type).to eq("JournalArticle")
637
+ expect(subject.contributors).to eq([{ "familyName" => "Peraya", "givenName" => "Daniel",
638
+ "type" => "Person", "contributorRoles" => ["Author"] }])
639
+ expect(subject.titles).to eq([{ "title" => "Distance(s), proximity and presence(s): evolving concepts" }])
640
+ expect(subject.date).to include("published" => "2014-12-14")
641
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/2399",
642
+ "name" => "OpenEdition")
643
+ expect(subject.provider).to eq("Crossref")
646
644
  end
647
645
 
648
- it 'multiple titles with missing' do
649
- input = 'https://doi.org/10.1186/1471-2164-7-187'
646
+ it "multiple titles with missing" do
647
+ input = "https://doi.org/10.1186/1471-2164-7-187"
650
648
  subject = described_class.new(input: input)
651
649
  expect(subject.valid?).to be true
652
- expect(subject.id).to eq('https://doi.org/10.1186/1471-2164-7-187')
653
- expect(subject.url).to eq('https://bmcgenomics.biomedcentral.com/articles/10.1186/1471-2164-7-187')
654
- expect(subject.type).to eq('JournalArticle')
655
- expect(subject.creators.size).to eq(5)
656
- expect(subject.creators.first).to eq('familyName' => 'Myers', 'givenName' => 'Chad L',
657
- 'type' => 'Person')
658
- expect(subject.titles).to eq([{ 'title' => 'Finding function: evaluation methods for functional genomic data' }])
659
- expect(subject.date).to include('published' => '2006-07-25')
660
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/297',
661
- 'name' => 'Springer Science and Business Media LLC')
662
- expect(subject.provider).to eq('Crossref')
650
+ expect(subject.id).to eq("https://doi.org/10.1186/1471-2164-7-187")
651
+ expect(subject.url).to eq("https://bmcgenomics.biomedcentral.com/articles/10.1186/1471-2164-7-187")
652
+ expect(subject.type).to eq("JournalArticle")
653
+ expect(subject.contributors.size).to eq(5)
654
+ expect(subject.contributors.first).to eq("familyName" => "Myers", "givenName" => "Chad L",
655
+ "type" => "Person", "contributorRoles" => ["Author"])
656
+ expect(subject.titles).to eq([{ "title" => "Finding function: evaluation methods for functional genomic data" }])
657
+ expect(subject.date).to include("published" => "2006-07-25")
658
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
659
+ "name" => "Springer Science and Business Media LLC")
660
+ expect(subject.provider).to eq("Crossref")
663
661
  end
664
662
 
665
- it 'markup' do
666
- input = 'https://doi.org/10.1098/rspb.2017.0132'
663
+ it "markup" do
664
+ input = "https://doi.org/10.1098/rspb.2017.0132"
667
665
  subject = described_class.new(input: input)
668
666
  expect(subject.valid?).to be true
669
- expect(subject.id).to eq('https://doi.org/10.1098/rspb.2017.0132')
670
- expect(subject.url).to eq('https://royalsocietypublishing.org/doi/10.1098/rspb.2017.0132')
671
- expect(subject.type).to eq('JournalArticle')
672
- expect(subject.creators.size).to eq(6)
673
- expect(subject.creators.first).to eq(
674
- 'affiliation' => [{ 'name' => 'School of Biological Sciences, Centre for Evolutionary Biology, University of Western Australia, Crawley, WA 6009, Australia' }], 'familyName' => 'Dougherty', 'givenName' => 'Liam R.',
675
- 'id' => 'https://orcid.org/0000-0003-1406-0680', 'type' => 'Person'
667
+ expect(subject.id).to eq("https://doi.org/10.1098/rspb.2017.0132")
668
+ expect(subject.url).to eq("https://royalsocietypublishing.org/doi/10.1098/rspb.2017.0132")
669
+ expect(subject.type).to eq("JournalArticle")
670
+ expect(subject.contributors.size).to eq(6)
671
+ expect(subject.contributors.first).to eq(
672
+ "affiliation" => [{ "name" => "School of Biological Sciences, Centre for Evolutionary Biology, University of Western Australia, Crawley, WA 6009, Australia" }], "familyName" => "Dougherty", "givenName" => "Liam R.",
673
+ "id" => "https://orcid.org/0000-0003-1406-0680", "type" => "Person", "contributorRoles" => ["Author"],
676
674
  )
677
- expect(subject.titles).to eq([{ 'title' => 'Sexual conflict and correlated evolution between male persistence and female resistance traits in the seed beetle <i>Callosobruchus maculatus</i>' }])
678
- expect(subject.date).to include('published' => '2017-05-24')
679
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/175',
680
- 'name' => 'The Royal Society')
681
- expect(subject.provider).to eq('Crossref')
682
- end
683
-
684
- it 'empty given name' do
685
- input = 'https://doi.org/10.1111/J.1865-1682.2010.01171.X'
686
- subject = described_class.new(input: input)
687
- expect(subject.valid?).to be true
688
- expect(subject.id).to eq('https://doi.org/10.1111/j.1865-1682.2010.01171.x')
689
- expect(subject.url).to eq('https://onlinelibrary.wiley.com/doi/10.1111/j.1865-1682.2010.01171.x')
690
- expect(subject.type).to eq('JournalArticle')
691
- expect(subject.creators.length).to eq(5)
692
- expect(subject.creators[3]).to eq('type' => 'Person', 'familyName' => 'Ehtisham-ul-Haq')
693
- expect(subject.titles).to eq([{ 'title' => 'Serological Evidence of Brucella abortus Prevalence in Punjab Province, Pakistan - A Cross-Sectional Study' }])
694
- expect(subject.license).to eq('url' => 'http://doi.wiley.com/10.1002/tdm_license_1.1')
695
- expect(subject.date).to eq('published' => '2010-09-29', 'updated' => '2023-02-09')
696
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/98',
697
- 'name' => 'Hindawi Limited')
698
- end
699
-
700
- it 'invalid date' do
701
- input = 'https://doi.org/10.1055/s-0039-1690894'
702
- subject = described_class.new(input: input)
703
- expect(subject.valid?).to be true
704
- expect(subject.id).to eq('https://doi.org/10.1055/s-0039-1690894')
705
- expect(subject.url).to eq('http://www.thieme-connect.de/DOI/DOI?10.1055%2Fs-0039-1690894')
706
- expect(subject.type).to eq('JournalArticle')
707
- expect(subject.creators.length).to eq(4)
708
- expect(subject.creators[1]).to eq('affiliation' => [{ 'name' => 'Department of Chemistry, Tianjin Key Laboratory of Molecular Optoelectronic Sciences, and Tianjin Collaborative Innovation Centre of Chemical Science and Engineering, Tianjin University' }, { 'name' => 'Joint School of National University of Singapore and Tianjin University, International Campus of Tianjin University' }],
709
- 'familyName' => 'Ma',
710
- 'givenName' => 'Jun-An',
711
- 'id' => 'https://orcid.org/0000-0002-3902-6799',
712
- 'type' => 'Person')
713
- expect(subject.titles).to eq([{ 'title' => 'Silver-Catalyzed [3+3] Annulation of Glycine Imino Esters with Seyferth–Gilbert Reagent To Access Tetrahydro-1,2,4-triazinecarboxylate Esters' }])
714
- expect(subject.date).to eq('published' => '2020-04-08', 'updated' => '2020-06-16')
715
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/194',
716
- 'name' => 'Georg Thieme Verlag KG')
717
- end
718
-
719
- it 'journal article with' do
720
- input = 'https://doi.org/10.1111/nph.14619'
721
- subject = described_class.new(input: input)
722
- expect(subject.valid?).to be true
723
- expect(subject.id).to eq('https://doi.org/10.1111/nph.14619')
724
- expect(subject.url).to eq('https://onlinelibrary.wiley.com/doi/10.1111/nph.14619')
725
- expect(subject.type).to eq('JournalArticle')
726
- expect(subject.creators.length).to eq(3)
727
- expect(subject.creators.first).to eq('affiliation' => [{ 'name' => 'Independent Junior Research Group on Protein Recognition and Degradation; Leibniz Institute of Plant Biochemistry (IPB); Weinberg 3 Halle (Saale) D-06120 Germany' }, { 'name' => 'ScienceCampus Halle - Plant-based Bioeconomy; Betty-Heimann-Strasse 3 Halle (Saale) D-06120 Germany' }],
728
- 'familyName' => 'Dissmeyer',
729
- 'givenName' => 'Nico',
730
- 'id' => 'https://orcid.org/0000-0002-4156-3761',
731
- 'type' => 'Person')
732
- expect(subject.titles).to eq([{ 'title' => 'Life and death of proteins after protease cleavage: protein degradation by the N-end rule pathway' }])
733
- expect(subject.license).to eq('url' => 'http://doi.wiley.com/10.1002/tdm_license_1.1')
734
- expect(subject.date).to eq('published' => '2017-06-05', 'updated' => '2021-07-07')
735
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/311',
736
- 'name' => 'Wiley')
675
+ expect(subject.titles).to eq([{ "title" => "Sexual conflict and correlated evolution between male persistence and female resistance traits in the seed beetle <i>Callosobruchus maculatus</i>" }])
676
+ expect(subject.date).to include("published" => "2017-05-24")
677
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/175",
678
+ "name" => "The Royal Society")
679
+ expect(subject.provider).to eq("Crossref")
680
+ end
681
+
682
+ it "empty given name" do
683
+ input = "https://doi.org/10.1111/J.1865-1682.2010.01171.X"
684
+ subject = described_class.new(input: input)
685
+ expect(subject.valid?).to be true
686
+ expect(subject.id).to eq("https://doi.org/10.1111/j.1865-1682.2010.01171.x")
687
+ expect(subject.url).to eq("https://onlinelibrary.wiley.com/doi/10.1111/j.1865-1682.2010.01171.x")
688
+ expect(subject.type).to eq("JournalArticle")
689
+ expect(subject.contributors.length).to eq(5)
690
+ expect(subject.contributors[3]).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Ehtisham-ul-Haq")
691
+ expect(subject.titles).to eq([{ "title" => "Serological Evidence of Brucella abortus Prevalence in Punjab Province, Pakistan - A Cross-Sectional Study" }])
692
+ expect(subject.license).to eq("url" => "http://doi.wiley.com/10.1002/tdm_license_1.1")
693
+ expect(subject.date).to eq("published" => "2010-09-29", "updated" => "2023-02-09")
694
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/98",
695
+ "name" => "Hindawi Limited")
696
+ end
697
+
698
+ it "invalid date" do
699
+ input = "https://doi.org/10.1055/s-0039-1690894"
700
+ subject = described_class.new(input: input)
701
+ expect(subject.valid?).to be true
702
+ expect(subject.id).to eq("https://doi.org/10.1055/s-0039-1690894")
703
+ expect(subject.url).to eq("http://www.thieme-connect.de/DOI/DOI?10.1055%2Fs-0039-1690894")
704
+ expect(subject.type).to eq("JournalArticle")
705
+ expect(subject.contributors.length).to eq(4)
706
+ expect(subject.contributors[1]).to eq("affiliation" => [{ "name" => "Department of Chemistry, Tianjin Key Laboratory of Molecular Optoelectronic Sciences, and Tianjin Collaborative Innovation Centre of Chemical Science and Engineering, Tianjin University" }, { "name" => "Joint School of National University of Singapore and Tianjin University, International Campus of Tianjin University" }],
707
+ "familyName" => "Ma",
708
+ "givenName" => "Jun-An",
709
+ "id" => "https://orcid.org/0000-0002-3902-6799",
710
+ "type" => "Person", "contributorRoles" => ["Author"])
711
+ expect(subject.titles).to eq([{ "title" => "Silver-Catalyzed [3+3] Annulation of Glycine Imino Esters with Seyferth–Gilbert Reagent To Access Tetrahydro-1,2,4-triazinecarboxylate Esters" }])
712
+ expect(subject.date).to eq("published" => "2020-04-08", "updated" => "2020-06-16")
713
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/194",
714
+ "name" => "Georg Thieme Verlag KG")
715
+ end
716
+
717
+ it "journal article with" do
718
+ input = "https://doi.org/10.1111/nph.14619"
719
+ subject = described_class.new(input: input)
720
+ expect(subject.valid?).to be true
721
+ expect(subject.id).to eq("https://doi.org/10.1111/nph.14619")
722
+ expect(subject.url).to eq("https://onlinelibrary.wiley.com/doi/10.1111/nph.14619")
723
+ expect(subject.type).to eq("JournalArticle")
724
+ expect(subject.contributors.length).to eq(3)
725
+ expect(subject.contributors.first).to eq("affiliation" => [{ "name" => "Independent Junior Research Group on Protein Recognition and Degradation; Leibniz Institute of Plant Biochemistry (IPB); Weinberg 3 Halle (Saale) D-06120 Germany" }, { "name" => "ScienceCampus Halle - Plant-based Bioeconomy; Betty-Heimann-Strasse 3 Halle (Saale) D-06120 Germany" }],
726
+ "familyName" => "Dissmeyer",
727
+ "givenName" => "Nico",
728
+ "id" => "https://orcid.org/0000-0002-4156-3761",
729
+ "type" => "Person", "contributorRoles" => ["Author"])
730
+ expect(subject.titles).to eq([{ "title" => "Life and death of proteins after protease cleavage: protein degradation by the N-end rule pathway" }])
731
+ expect(subject.license).to eq("url" => "http://doi.wiley.com/10.1002/tdm_license_1.1")
732
+ expect(subject.date).to eq("published" => "2017-06-05", "updated" => "2021-07-07")
733
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/311",
734
+ "name" => "Wiley")
737
735
  expect(subject.references.length).to eq(49)
738
- expect(subject.references.last).to eq('containerTitle' => 'Proteomics',
739
- 'creator' => 'Zhang',
740
- 'doi' => 'https://doi.org/10.1002/pmic.201400530',
741
- 'firstPage' => '2447',
742
- 'key' => '10.1111/nph.14619-BIB0049|nph14619-cit-0049',
743
- 'publicationYear' => '2015',
744
- 'title' => 'Quantitative proteomics analysis of the Arg/N-end rule pathway of targeted degradation in Arabidopsis roots',
745
- 'volume' => '15')
746
- expect(subject.container).to eq('firstPage' => '929', 'identifier' => '0028-646X',
747
- 'identifierType' => 'ISSN', 'issue' => '3', 'lastPage' => '935', 'title' => 'New Phytologist', 'type' => 'Journal', 'volume' => '218')
748
- expect(subject.provider).to eq('Crossref')
749
- end
750
-
751
- it 'author literal' do
752
- input = 'https://doi.org/10.1038/ng.3834'
753
- subject = described_class.new(input: input)
754
- expect(subject.valid?).to be true
755
- expect(subject.id).to eq('https://doi.org/10.1038/ng.3834')
756
- expect(subject.url).to eq('https://www.nature.com/articles/ng.3834')
757
- expect(subject.type).to eq('JournalArticle')
758
- expect(subject.creators.length).to eq(14)
759
- expect(subject.creators[1]).to eq('name' => 'GTEx Consortium', 'type' => 'Organization')
760
- expect(subject.titles).to eq([{ 'title' => 'The impact of structural variation on human gene expression' }])
761
- expect(subject.date).to include('published' => '2017-04-03')
762
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/297',
763
- 'name' => 'Springer Science and Business Media LLC')
764
- expect(subject.provider).to eq('Crossref')
765
- end
766
-
767
- it 'affiliation is space' do
768
- input = 'https://doi.org/10.1177/0042098011428175'
769
- subject = described_class.new(input: input)
770
- expect(subject.valid?).to be true
771
- expect(subject.id).to eq('https://doi.org/10.1177/0042098011428175')
772
- expect(subject.url).to eq('http://journals.sagepub.com/doi/10.1177/0042098011428175')
773
- expect(subject.type).to eq('JournalArticle')
774
- expect(subject.creators.length).to eq(1)
775
- expect(subject.creators.first).to eq('familyName' => 'Petrovici', 'givenName' => 'Norbert',
776
- 'type' => 'Person')
777
- expect(subject.titles).to eq([{ 'title' => 'Workers and the City: Rethinking the Geographies of Power in Post-socialist Urbanisation' }])
778
- expect(subject.date).to include('published' => '2011-12-22')
779
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/179',
780
- 'name' => 'SAGE Publications')
781
- expect(subject.provider).to eq('Crossref')
782
- end
783
-
784
- it 'multiple issn' do
785
- input = 'https://doi.org/10.1007/978-3-642-34922-5_19'
736
+ expect(subject.references.last).to eq("containerTitle" => "Proteomics",
737
+ "contributor" => "Zhang",
738
+ "doi" => "https://doi.org/10.1002/pmic.201400530",
739
+ "firstPage" => "2447",
740
+ "key" => "10.1111/nph.14619-BIB0049|nph14619-cit-0049",
741
+ "publicationYear" => "2015",
742
+ "title" => "Quantitative proteomics analysis of the Arg/N-end rule pathway of targeted degradation in Arabidopsis roots",
743
+ "volume" => "15")
744
+ expect(subject.container).to eq("firstPage" => "929", "identifier" => "0028-646X",
745
+ "identifierType" => "ISSN", "issue" => "3", "lastPage" => "935", "title" => "New Phytologist", "type" => "Journal", "volume" => "218")
746
+ expect(subject.provider).to eq("Crossref")
747
+ end
748
+
749
+ it "author literal" do
750
+ input = "https://doi.org/10.1038/ng.3834"
751
+ subject = described_class.new(input: input)
752
+ expect(subject.valid?).to be true
753
+ expect(subject.id).to eq("https://doi.org/10.1038/ng.3834")
754
+ expect(subject.url).to eq("https://www.nature.com/articles/ng.3834")
755
+ expect(subject.type).to eq("JournalArticle")
756
+ expect(subject.contributors.length).to eq(14)
757
+ expect(subject.contributors[1]).to eq("contributorRoles"=>["Author"], "name"=>"GTEx Consortium", "type"=>"Organization")
758
+ expect(subject.titles).to eq([{ "title" => "The impact of structural variation on human gene expression" }])
759
+ expect(subject.date).to include("published" => "2017-04-03")
760
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
761
+ "name" => "Springer Science and Business Media LLC")
762
+ expect(subject.provider).to eq("Crossref")
763
+ end
764
+
765
+ it "affiliation is space" do
766
+ input = "https://doi.org/10.1177/0042098011428175"
767
+ subject = described_class.new(input: input)
768
+ expect(subject.valid?).to be true
769
+ expect(subject.id).to eq("https://doi.org/10.1177/0042098011428175")
770
+ expect(subject.url).to eq("http://journals.sagepub.com/doi/10.1177/0042098011428175")
771
+ expect(subject.type).to eq("JournalArticle")
772
+ expect(subject.contributors.length).to eq(1)
773
+ expect(subject.contributors.first).to eq("familyName" => "Petrovici", "givenName" => "Norbert",
774
+ "type" => "Person", "contributorRoles" => ["Author"])
775
+ expect(subject.titles).to eq([{ "title" => "Workers and the City: Rethinking the Geographies of Power in Post-socialist Urbanisation" }])
776
+ expect(subject.date).to include("published" => "2011-12-22")
777
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/179",
778
+ "name" => "SAGE Publications")
779
+ expect(subject.provider).to eq("Crossref")
780
+ end
781
+
782
+ it "multiple issn" do
783
+ input = "https://doi.org/10.1007/978-3-642-34922-5_19"
786
784
  subject = described_class.new(input: input)
787
785
  # expect(subject.valid?).to be true
788
- expect(subject.id).to eq('https://doi.org/10.1007/978-3-642-34922-5_19')
789
- expect(subject.url).to eq('https://link.springer.com/10.1007/978-3-642-34922-5_19')
790
- expect(subject.type).to eq('BookChapter')
791
- expect(subject.creators.length).to eq(3)
792
- expect(subject.creators.first).to eq('familyName' => 'Razib', 'givenName' => 'Ali',
793
- 'type' => 'Person')
794
- expect(subject.titles).to eq([{ 'title' => 'Log-Domain Arithmetic for High-Speed Fuzzy Control on a Field-Programmable Gate Array' }])
795
- expect(subject.date).to include('published' => '2013')
796
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/297',
797
- 'name' => 'Springer Science and Business Media LLC')
798
- expect(subject.container).to eq('identifier' => '1860-0808', 'identifierType' => 'ISSN', 'firstPage' => '269', 'lastPage' => '287',
799
- 'title' => 'Soft Computing: State of the Art Theory and Novel Applications', 'type' => 'Book')
800
- expect(subject.provider).to eq('Crossref')
801
- end
802
-
803
- it 'article id as page number' do
804
- input = 'https://doi.org/10.1103/physrevlett.120.117701'
805
- subject = described_class.new(input: input)
806
- expect(subject.valid?).to be true
807
- expect(subject.id).to eq('https://doi.org/10.1103/physrevlett.120.117701')
808
- expect(subject.url).to eq('https://link.aps.org/doi/10.1103/PhysRevLett.120.117701')
809
- expect(subject.type).to eq('JournalArticle')
810
- expect(subject.creators.length).to eq(5)
811
- expect(subject.creators.first).to eq('familyName' => 'Marrazzo', 'givenName' => 'Antimo',
812
- 'type' => 'Person')
813
- expect(subject.titles).to eq([{ 'title' => 'Prediction of a Large-Gap and Switchable Kane-Mele Quantum Spin Hall Insulator' }])
814
- expect(subject.date).to include('published' => '2018-03-13')
815
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/16',
816
- 'name' => 'American Physical Society (APS)')
817
- expect(subject.container).to eq('identifier' => '1079-7114',
818
- 'identifierType' => 'ISSN', 'issue' => '11', 'title' => 'Physical Review Letters', 'type' => 'Journal', 'volume' => '120')
819
- expect(subject.provider).to eq('Crossref')
820
- end
821
-
822
- it 'posted content copernicus' do
823
- input = 'https://doi.org/10.5194/CP-2020-95'
824
- subject = described_class.new(input: input)
825
- expect(subject.valid?).to be true
826
- expect(subject.url).to eq('https://cp.copernicus.org/preprints/cp-2020-95/cp-2020-95.pdf')
827
- expect(subject.type).to eq('Article')
828
- expect(subject.creators.count).to eq(6)
829
- expect(subject.creators.first).to eq('type' => 'Person', 'familyName' => 'Shao',
830
- 'givenName' => 'Jun',
831
- 'id' => 'https://orcid.org/0000-0001-6130-6474')
832
- expect(subject.titles).to eq([{ 'title' => 'The Atmospheric Bridge Communicated the δ&amp;lt;sup&amp;gt;13&amp;lt;/sup&amp;gt;C Decline during the Last Deglaciation to the Global Upper Ocean' }])
833
- expect(subject.id).to eq('https://doi.org/10.5194/cp-2020-95')
786
+ expect(subject.id).to eq("https://doi.org/10.1007/978-3-642-34922-5_19")
787
+ expect(subject.url).to eq("https://link.springer.com/10.1007/978-3-642-34922-5_19")
788
+ expect(subject.type).to eq("BookChapter")
789
+ expect(subject.contributors.length).to eq(3)
790
+ expect(subject.contributors.first).to eq("familyName" => "Razib", "givenName" => "Ali",
791
+ "type" => "Person", "contributorRoles" => ["Author"])
792
+ expect(subject.titles).to eq([{ "title" => "Log-Domain Arithmetic for High-Speed Fuzzy Control on a Field-Programmable Gate Array" }])
793
+ expect(subject.date).to include("published" => "2013")
794
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
795
+ "name" => "Springer Science and Business Media LLC")
796
+ expect(subject.container).to eq("identifier" => "1860-0808", "identifierType" => "ISSN", "firstPage" => "269", "lastPage" => "287",
797
+ "title" => "Soft Computing: State of the Art Theory and Novel Applications", "type" => "Book")
798
+ expect(subject.provider).to eq("Crossref")
799
+ end
800
+
801
+ it "article id as page number" do
802
+ input = "https://doi.org/10.1103/physrevlett.120.117701"
803
+ subject = described_class.new(input: input)
804
+ expect(subject.valid?).to be true
805
+ expect(subject.id).to eq("https://doi.org/10.1103/physrevlett.120.117701")
806
+ expect(subject.url).to eq("https://link.aps.org/doi/10.1103/PhysRevLett.120.117701")
807
+ expect(subject.type).to eq("JournalArticle")
808
+ expect(subject.contributors.length).to eq(5)
809
+ expect(subject.contributors.first).to eq("familyName" => "Marrazzo", "givenName" => "Antimo",
810
+ "type" => "Person", "contributorRoles" => ["Author"])
811
+ expect(subject.titles).to eq([{ "title" => "Prediction of a Large-Gap and Switchable Kane-Mele Quantum Spin Hall Insulator" }])
812
+ expect(subject.date).to include("published" => "2018-03-13")
813
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/16",
814
+ "name" => "American Physical Society (APS)")
815
+ expect(subject.container).to eq("identifier" => "1079-7114",
816
+ "identifierType" => "ISSN", "issue" => "11", "title" => "Physical Review Letters", "type" => "Journal", "volume" => "120")
817
+ expect(subject.provider).to eq("Crossref")
818
+ end
819
+
820
+ it "posted content copernicus" do
821
+ input = "https://doi.org/10.5194/CP-2020-95"
822
+ subject = described_class.new(input: input)
823
+ expect(subject.valid?).to be true
824
+ expect(subject.url).to eq("https://cp.copernicus.org/preprints/cp-2020-95/cp-2020-95.pdf")
825
+ expect(subject.type).to eq("Article")
826
+ expect(subject.contributors.count).to eq(6)
827
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Shao",
828
+ "givenName" => "Jun",
829
+ "id" => "https://orcid.org/0000-0001-6130-6474")
830
+ expect(subject.titles).to eq([{ "title" => "The Atmospheric Bridge Communicated the δ&amp;lt;sup&amp;gt;13&amp;lt;/sup&amp;gt;C Decline during the Last Deglaciation to the Global Upper Ocean" }])
831
+ expect(subject.id).to eq("https://doi.org/10.5194/cp-2020-95")
834
832
  expect(subject.alternate_identifiers.empty?).to be(true)
835
- expect(subject.descriptions.first['description']).to start_with('Abstract. During the early last glacial termination')
836
- expect(subject.date).to include('published' => '2020-07-28')
837
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/3145',
838
- 'name' => 'Copernicus GmbH')
839
- expect(subject.provider).to eq('Crossref')
840
- end
841
-
842
- it 'book oup' do
843
- input = '10.1093/oxfordhb/9780198746140.013.5'
844
- subject = described_class.new(input: input)
845
- expect(subject.valid?).to be true
846
- expect(subject.url).to eq('https://academic.oup.com/edited-volume/28081/chapter/212116415')
847
- expect(subject.type).to eq('Book')
848
- expect(subject.creators.count).to eq(1)
849
- expect(subject.creators.first).to eq('type' => 'Person', 'familyName' => 'Clayton',
850
- 'givenName' => 'Barbra R.')
851
- expect(subject.contributors.count).to eq(2)
852
- expect(subject.contributors.first).to eq('contributorType' => 'Editor', 'familyName' => 'Cozort',
853
- 'givenName' => 'Daniel', 'type' => 'Person')
854
- expect(subject.titles).to eq([{ 'title' => 'The Changing Way of the Bodhisattva' }])
855
- expect(subject.id).to eq('https://doi.org/10.1093/oxfordhb/9780198746140.013.5')
833
+ expect(subject.descriptions.first["description"]).to start_with("Abstract. During the early last glacial termination")
834
+ expect(subject.date).to include("published" => "2020-07-28")
835
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/3145",
836
+ "name" => "Copernicus GmbH")
837
+ expect(subject.provider).to eq("Crossref")
838
+ end
839
+
840
+ it "book oup" do
841
+ input = "10.1093/oxfordhb/9780198746140.013.5"
842
+ subject = described_class.new(input: input)
843
+ expect(subject.valid?).to be true
844
+ expect(subject.url).to eq("https://academic.oup.com/edited-volume/28081/chapter/212116415")
845
+ expect(subject.type).to eq("Book")
846
+ expect(subject.contributors.count).to eq(3)
847
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Clayton",
848
+ "givenName" => "Barbra R.")
849
+ expect(subject.contributors.last).to eq("contributorRoles"=>["Editor"], "familyName"=>"Shields", "givenName"=>"James Mark", "type"=>"Person")
850
+ expect(subject.titles).to eq([{ "title" => "The Changing Way of the Bodhisattva" }])
851
+ expect(subject.id).to eq("https://doi.org/10.1093/oxfordhb/9780198746140.013.5")
856
852
  expect(subject.alternate_identifiers.empty?).to be(true)
857
- expect(subject.descriptions.first['description']).to start_with('This chapter explores the nature of the connections')
858
- expect(subject.date).to include('published' => '2018-04-05')
859
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/286',
860
- 'name' => 'Oxford University Press (OUP)')
861
- expect(subject.provider).to eq('Crossref')
853
+ expect(subject.descriptions.first["description"]).to start_with("This chapter explores the nature of the connections")
854
+ expect(subject.date).to include("published" => "2018-04-05")
855
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/286",
856
+ "name" => "Oxford University Press (OUP)")
857
+ expect(subject.provider).to eq("Crossref")
862
858
  end
863
859
 
864
- it 'report osti' do
865
- input = '10.2172/972169'
860
+ it "report osti" do
861
+ input = "10.2172/972169"
866
862
  subject = described_class.new(input: input)
867
863
  expect(subject.valid?).to be true
868
- expect(subject.url).to eq('http://www.osti.gov/servlets/purl/972169-1QXROM')
869
- expect(subject.type).to eq('Report')
870
- expect(subject.creators.count).to eq(4)
871
- expect(subject.creators.first).to eq('type' => 'Person', 'familyName' => 'Denholm',
872
- 'givenName' => 'P.')
873
- expect(subject.contributors.count).to eq(0)
874
- expect(subject.titles).to eq([{ 'title' => 'Role of Energy Storage with Renewable Electricity Generation' }])
875
- expect(subject.id).to eq('https://doi.org/10.2172/972169')
864
+ expect(subject.url).to eq("http://www.osti.gov/servlets/purl/972169-1QXROM")
865
+ expect(subject.type).to eq("Report")
866
+ expect(subject.contributors.count).to eq(4)
867
+ expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Denholm",
868
+ "givenName" => "P.")
869
+ expect(subject.titles).to eq([{ "title" => "Role of Energy Storage with Renewable Electricity Generation" }])
870
+ expect(subject.id).to eq("https://doi.org/10.2172/972169")
876
871
  expect(subject.descriptions.empty?).to be(true)
877
- expect(subject.date).to include('published' => '2010-01-01')
878
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/960',
879
- 'name' => 'Office of Scientific and Technical Information (OSTI)')
880
- expect(subject.provider).to eq('Crossref')
872
+ expect(subject.date).to include("published" => "2010-01-01")
873
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/960",
874
+ "name" => "Office of Scientific and Technical Information (OSTI)")
875
+ expect(subject.provider).to eq("Crossref")
881
876
  end
882
877
 
883
- it 'journal issue' do
884
- input = 'https://doi.org/10.6002/ect.2015.0371'
878
+ it "journal issue" do
879
+ input = "https://doi.org/10.6002/ect.2015.0371"
885
880
  subject = described_class.new(input: input)
886
881
  expect(subject.valid?).to be false
887
- expect(subject.id).to eq('https://doi.org/10.6002/ect.2015.0371')
888
- expect(subject.url).to eq('http://ectrx.org/forms/ectrxcontentshow.php?doi_id=10.6002%2Fect.2015.0371')
889
- expect(subject.type).to eq('JournalIssue')
890
- expect(subject.creators.empty?).to be true
891
- expect(subject.titles).to eq([{ 'title' => ':(unav)' }])
892
- expect(subject.date).to eq('published' => '2018-10', 'updated' => '2018-10-03')
893
- expect(subject.publisher).to eq('id' => 'https://api.crossref.org/members/4021',
894
- 'name' => 'Baskent University')
882
+ expect(subject.errors).to eq(["property '/contributors' is invalid: error_type=minItems"])
883
+ expect(subject.id).to eq("https://doi.org/10.6002/ect.2015.0371")
884
+ expect(subject.url).to eq("http://ectrx.org/forms/ectrxcontentshow.php?doi_id=10.6002%2Fect.2015.0371")
885
+ expect(subject.type).to eq("JournalIssue")
886
+ expect(subject.contributors.empty?).to be true
887
+ expect(subject.titles).to eq([{ "title" => ":(unav)" }])
888
+ expect(subject.date).to eq("published" => "2018-10", "updated" => "2018-10-03")
889
+ expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/4021",
890
+ "name" => "Baskent University")
895
891
  expect(subject.references.length).to eq(1)
896
- expect(subject.references.first).to eq('containerTitle' => 'Ergonomics',
897
- 'creator' => 'IMAMURA',
898
- 'doi' => 'https://doi.org/10.1080/001401398186180',
899
- 'firstPage' => '1421',
900
- 'issue' => '10',
901
- 'key' => 'ref0',
902
- 'publicationYear' => '1998',
903
- 'title' => 'Manual performance in cold conditions while wearing NBC clothing',
904
- 'volume' => '41')
905
- expect(subject.container).to eq('identifier' => '2146-8427', 'identifierType' => 'ISSN',
906
- 'issue' => '5', 'title' => 'Experimental and Clinical Transplantation', 'type' => 'Journal', 'volume' => '16')
907
- expect(subject.provider).to eq('Crossref')
908
- end
909
-
910
- it 'not found error' do
911
- input = 'https://doi.org/10.7554/elife.01567x'
892
+ expect(subject.references.first).to eq("containerTitle" => "Ergonomics",
893
+ "contributor" => "IMAMURA",
894
+ "doi" => "https://doi.org/10.1080/001401398186180",
895
+ "firstPage" => "1421",
896
+ "issue" => "10",
897
+ "key" => "ref0",
898
+ "publicationYear" => "1998",
899
+ "title" => "Manual performance in cold conditions while wearing NBC clothing",
900
+ "volume" => "41")
901
+ expect(subject.container).to eq("identifier" => "2146-8427", "identifierType" => "ISSN",
902
+ "issue" => "5", "title" => "Experimental and Clinical Transplantation", "type" => "Journal", "volume" => "16")
903
+ expect(subject.provider).to eq("Crossref")
904
+ end
905
+
906
+ it "not found error" do
907
+ input = "https://doi.org/10.7554/elife.01567x"
912
908
  subject = described_class.new(input: input)
913
909
  expect(subject.valid?).to be false
914
- expect(subject.id).to eq('https://doi.org/10.7554/elife.01567x')
915
- expect(subject.provider).to eq('Crossref')
916
- expect(subject.state).to eq('not_found')
910
+ expect(subject.id).to eq("https://doi.org/10.7554/elife.01567x")
911
+ expect(subject.provider).to eq("Crossref")
912
+ expect(subject.state).to eq("not_found")
917
913
  end
918
914
  end
919
915
  end