commonmeta-ruby 3.4.5 → 3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/commonmeta/author_utils.rb +103 -71
- data/lib/commonmeta/crossref_utils.rb +31 -25
- data/lib/commonmeta/metadata.rb +2 -8
- data/lib/commonmeta/metadata_utils.rb +4 -3
- data/lib/commonmeta/readers/bibtex_reader.rb +3 -3
- data/lib/commonmeta/readers/cff_reader.rb +7 -6
- data/lib/commonmeta/readers/codemeta_reader.rb +3 -3
- data/lib/commonmeta/readers/crossref_reader.rb +3 -5
- data/lib/commonmeta/readers/crossref_xml_reader.rb +7 -6
- data/lib/commonmeta/readers/csl_reader.rb +3 -4
- data/lib/commonmeta/readers/datacite_reader.rb +3 -5
- data/lib/commonmeta/readers/json_feed_reader.rb +2 -2
- data/lib/commonmeta/readers/npm_reader.rb +2 -2
- data/lib/commonmeta/readers/ris_reader.rb +1 -1
- data/lib/commonmeta/readers/schema_org_reader.rb +3 -3
- data/lib/commonmeta/schema_utils.rb +1 -1
- data/lib/commonmeta/utils.rb +4 -2
- data/lib/commonmeta/version.rb +1 -1
- data/lib/commonmeta/writers/bibtex_writer.rb +1 -1
- data/lib/commonmeta/writers/cff_writer.rb +5 -4
- data/lib/commonmeta/writers/codemeta_writer.rb +4 -2
- data/lib/commonmeta/writers/csv_writer.rb +4 -2
- data/lib/commonmeta/writers/datacite_writer.rb +1 -1
- data/lib/commonmeta/writers/jats_writer.rb +9 -5
- data/lib/commonmeta/writers/ris_writer.rb +2 -1
- data/lib/commonmeta/writers/schema_org_writer.rb +6 -3
- data/resources/{commonmeta_v0.9.3.json → commonmeta_v0.10.json} +62 -46
- data/spec/author_utils_spec.rb +16 -16
- data/spec/cli_spec.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_crossref_metadata/missing_contributor.yml +307 -0
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/get_datacite_metadata/SoftwareSourceCode.yml +76 -0
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/book_oup.yml +107 -0
- data/spec/fixtures/vcr_cassettes/Commonmeta_Metadata/write_metadata_as_crossref/journal_article_plos.yml +407 -0
- data/spec/metadata_spec.rb +2 -2
- data/spec/readers/bibtex_reader_spec.rb +5 -5
- data/spec/readers/cff_reader_spec.rb +127 -127
- data/spec/readers/codemeta_reader_spec.rb +11 -11
- data/spec/readers/crossref_reader_spec.rb +831 -835
- data/spec/readers/crossref_xml_reader_spec.rb +899 -901
- data/spec/readers/csl_reader_spec.rb +33 -33
- data/spec/readers/datacite_reader_spec.rb +106 -103
- data/spec/readers/json_feed_reader_spec.rb +40 -40
- data/spec/readers/npm_reader_spec.rb +32 -33
- data/spec/readers/ris_reader_spec.rb +36 -36
- data/spec/readers/schema_org_reader_spec.rb +284 -284
- data/spec/writers/codemeta_writer_spec.rb +19 -20
- data/spec/writers/crossref_xml_writer_spec.rb +73 -37
- data/spec/writers/datacite_writer_spec.rb +1 -1
- metadata +7 -3
@@ -1,919 +1,915 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
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
|
11
|
-
it
|
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
|
17
|
-
it
|
18
|
-
expect(subject.valid?).to be true
|
19
|
-
expect(subject.id).to eq(
|
20
|
-
expect(subject.type).to eq(
|
21
|
-
expect(subject.url).to eq(
|
22
|
-
expect(subject.
|
23
|
-
expect(subject.
|
24
|
-
|
25
|
-
expect(subject.license).to eq(
|
26
|
-
|
27
|
-
expect(subject.titles).to eq([{
|
28
|
-
expect(subject.date).to eq(
|
29
|
-
expect(subject.publisher).to eq(
|
30
|
-
|
31
|
-
expect(subject.container).to eq(
|
32
|
-
|
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(
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
expect(subject.funding_references).to eq([{
|
43
|
-
{
|
44
|
-
{
|
45
|
-
{
|
46
|
-
|
47
|
-
|
48
|
-
{
|
49
|
-
{
|
50
|
-
|
51
|
-
|
52
|
-
{
|
53
|
-
|
54
|
-
|
55
|
-
{
|
56
|
-
|
57
|
-
|
58
|
-
expect(subject.provider).to eq(
|
59
|
-
end
|
60
|
-
|
61
|
-
it
|
62
|
-
input =
|
63
|
-
subject = described_class.new(input: input)
|
64
|
-
expect(subject.valid?).to be true
|
65
|
-
expect(subject.id).to eq(
|
66
|
-
expect(subject.url).to eq(
|
67
|
-
expect(subject.type).to eq(
|
68
|
-
expect(subject.
|
69
|
-
expect(subject.
|
70
|
-
|
71
|
-
expect(subject.contributors).to eq(
|
72
|
-
|
73
|
-
expect(subject.titles).to eq([{
|
74
|
-
expect(subject.license).to eq(
|
75
|
-
|
76
|
-
expect(subject.date).to eq(
|
77
|
-
expect(subject.publisher).to eq(
|
78
|
-
|
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(
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
expect(subject.container).to eq(
|
87
|
-
|
88
|
-
expect(subject.provider).to eq(
|
89
|
-
end
|
90
|
-
|
91
|
-
it
|
92
|
-
input =
|
93
|
-
subject = described_class.new(input: input)
|
94
|
-
expect(subject.valid?).to be true
|
95
|
-
expect(subject.id).to eq(
|
96
|
-
expect(subject.url).to eq(
|
97
|
-
expect(subject.type).to eq(
|
98
|
-
expect(subject.
|
99
|
-
expect(subject.
|
100
|
-
|
101
|
-
expect(subject.titles).to eq([{
|
102
|
-
expect(subject.license).to eq(
|
103
|
-
|
104
|
-
expect(subject.date).to eq(
|
105
|
-
expect(subject.publisher).to eq(
|
106
|
-
|
107
|
-
expect(subject.funding_references).to eq([{
|
108
|
-
|
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(
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
expect(subject.references.last).to eq(
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
expect(subject.container).to eq(
|
127
|
-
|
128
|
-
expect(subject.provider).to eq(
|
129
|
-
end
|
130
|
-
|
131
|
-
it
|
132
|
-
input =
|
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 '/
|
136
|
-
expect(subject.id).to eq(
|
137
|
-
expect(subject.url).to eq(
|
138
|
-
expect(subject.type).to eq(
|
139
|
-
expect(subject.
|
140
|
-
expect(subject.titles).to eq([{
|
141
|
-
expect(subject.date).to include(
|
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(
|
144
|
-
|
145
|
-
expect(subject.container).to eq(
|
146
|
-
|
147
|
-
expect(subject.publisher).to eq(
|
148
|
-
|
149
|
-
expect(subject.provider).to eq(
|
150
|
-
end
|
151
|
-
|
152
|
-
it
|
153
|
-
input =
|
154
|
-
subject = described_class.new(input: input)
|
155
|
-
expect(subject.valid?).to be true
|
156
|
-
expect(subject.id).to eq(
|
157
|
-
expect(subject.url).to eq(
|
158
|
-
expect(subject.type).to eq(
|
159
|
-
expect(subject.
|
160
|
-
expect(subject.
|
161
|
-
|
162
|
-
expect(subject.titles).to eq([{
|
163
|
-
expect(subject.date).to include(
|
164
|
-
expect(subject.publisher).to eq(
|
165
|
-
|
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(
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
expect(subject.container).to eq(
|
176
|
-
|
177
|
-
expect(subject.provider).to eq(
|
178
|
-
end
|
179
|
-
|
180
|
-
it
|
181
|
-
input =
|
182
|
-
subject = described_class.new(input: input)
|
183
|
-
expect(subject.valid?).to be true
|
184
|
-
expect(subject.id).to eq(
|
185
|
-
expect(subject.url).to eq(
|
186
|
-
expect(subject.type).to eq(
|
187
|
-
expect(subject.
|
188
|
-
expect(subject.
|
189
|
-
|
190
|
-
expect(subject.titles).to eq([{
|
191
|
-
expect(subject.date).to eq(
|
192
|
-
expect(subject.publisher).to eq(
|
193
|
-
|
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(
|
196
|
-
|
197
|
-
expect(subject.container).to eq(
|
198
|
-
|
199
|
-
expect(subject.provider).to eq(
|
200
|
-
end
|
201
|
-
|
202
|
-
it
|
203
|
-
input =
|
204
|
-
subject = described_class.new(input: input)
|
205
|
-
expect(subject.valid?).to be true
|
206
|
-
expect(subject.url).to eq(
|
207
|
-
expect(subject.type).to eq(
|
208
|
-
expect(subject.
|
209
|
-
expect(subject.
|
210
|
-
|
211
|
-
expect(subject.titles).to eq([{
|
212
|
-
expect(subject.id).to eq(
|
213
|
-
expect(subject.descriptions.first[
|
214
|
-
expect(subject.date).to eq(
|
215
|
-
expect(subject.publisher).to eq(
|
216
|
-
|
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(
|
218
|
+
expect(subject.provider).to eq("Crossref")
|
219
219
|
end
|
220
220
|
|
221
|
-
it
|
222
|
-
input =
|
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(
|
226
|
-
expect(subject.type).to eq(
|
227
|
-
expect(subject.
|
228
|
-
expect(subject.
|
229
|
-
|
230
|
-
|
231
|
-
expect(subject.titles).to eq([{
|
232
|
-
expect(subject.id).to eq(
|
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(
|
236
|
-
expect(subject.publisher).to eq(
|
237
|
-
|
238
|
-
expect(subject.provider).to eq(
|
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
|
242
|
-
input =
|
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(
|
246
|
-
expect(subject.type).to eq(
|
247
|
-
expect(subject.
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
expect(subject.titles).to eq([{
|
252
|
-
expect(subject.id).to eq(
|
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(
|
256
|
-
expect(subject.publisher).to eq(
|
257
|
-
|
258
|
-
expect(subject.provider).to eq(
|
259
|
-
end
|
260
|
-
|
261
|
-
it
|
262
|
-
input =
|
263
|
-
subject = described_class.new(input: input)
|
264
|
-
expect(subject.valid?).to be true
|
265
|
-
expect(subject.id).to eq(
|
266
|
-
expect(subject.url).to eq(
|
267
|
-
expect(subject.type).to eq(
|
268
|
-
expect(subject.
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
expect(subject.license).to eq(
|
273
|
-
expect(subject.titles).to eq([{
|
274
|
-
expect(subject.date).to eq(
|
275
|
-
expect(subject.publisher).to eq(
|
276
|
-
|
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(
|
279
|
-
|
280
|
-
expect(subject.container).to eq(
|
281
|
-
|
282
|
-
expect(subject.provider).to eq(
|
283
|
-
end
|
284
|
-
|
285
|
-
it
|
286
|
-
input =
|
287
|
-
subject = described_class.new(input: input)
|
288
|
-
expect(subject.valid?).to be true
|
289
|
-
expect(subject.id).to eq(
|
290
|
-
expect(subject.url).to eq(
|
291
|
-
expect(subject.type).to eq(
|
292
|
-
expect(subject.
|
293
|
-
expect(subject.
|
294
|
-
|
295
|
-
|
296
|
-
expect(subject.license).to eq(
|
297
|
-
|
298
|
-
expect(subject.titles).to eq([{
|
299
|
-
expect(subject.date).to include(
|
300
|
-
expect(subject.publisher).to eq(
|
301
|
-
|
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(
|
304
|
-
|
305
|
-
expect(subject.container).to eq(
|
306
|
-
|
307
|
-
expect(subject.provider).to eq(
|
308
|
-
end
|
309
|
-
|
310
|
-
it
|
311
|
-
input =
|
312
|
-
subject = described_class.new(input: input)
|
313
|
-
expect(subject.valid?).to be true
|
314
|
-
expect(subject.id).to eq(
|
315
|
-
expect(subject.url).to eq(
|
316
|
-
expect(subject.type).to eq(
|
317
|
-
expect(subject.
|
318
|
-
expect(subject.
|
319
|
-
|
320
|
-
expect(subject.titles).to eq([{
|
321
|
-
expect(subject.date).to include(
|
322
|
-
expect(subject.publisher).to eq(
|
323
|
-
|
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(
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
expect(subject.container).to eq(
|
333
|
-
|
334
|
-
expect(subject.provider).to eq(
|
335
|
-
end
|
336
|
-
|
337
|
-
it
|
338
|
-
input =
|
339
|
-
subject = described_class.new(input: input)
|
340
|
-
expect(subject.valid?).to be true
|
341
|
-
expect(subject.id).to eq(
|
342
|
-
expect(subject.url).to eq(
|
343
|
-
expect(subject.type).to eq(
|
344
|
-
expect(subject.
|
345
|
-
expect(subject.
|
346
|
-
|
347
|
-
expect(subject.titles).to eq([{
|
348
|
-
expect(subject.date).to include(
|
349
|
-
expect(subject.publisher).to eq(
|
350
|
-
|
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(
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
expect(subject.container).to eq(
|
360
|
-
|
361
|
-
expect(subject.provider).to eq(
|
362
|
-
end
|
363
|
-
|
364
|
-
it
|
365
|
-
input =
|
366
|
-
subject = described_class.new(input: input)
|
367
|
-
expect(subject.valid?).to be true
|
368
|
-
expect(subject.id).to eq(
|
369
|
-
expect(subject.url).to eq(
|
370
|
-
expect(subject.type).to eq(
|
371
|
-
expect(subject.
|
372
|
-
expect(subject.
|
373
|
-
|
374
|
-
expect(subject.titles).to eq([{
|
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(
|
377
|
-
expect(subject.publisher).to eq(
|
378
|
-
|
379
|
-
expect(subject.provider).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")
|
380
380
|
end
|
381
381
|
|
382
|
-
it
|
383
|
-
input =
|
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 '/
|
387
|
-
expect(subject.id).to eq(
|
388
|
-
expect(subject.url).to eq(
|
389
|
-
expect(subject.type).to eq(
|
390
|
-
expect(subject.
|
391
|
-
expect(subject.titles).to eq([{
|
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(
|
394
|
-
expect(subject.publisher).to eq(
|
395
|
-
|
396
|
-
expect(subject.provider).to eq(
|
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
|
400
|
-
input =
|
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(
|
404
|
-
expect(subject.url).to eq(
|
405
|
-
expect(subject.type).to eq(
|
406
|
-
expect(subject.
|
407
|
-
expect(subject.
|
408
|
-
|
409
|
-
|
410
|
-
expect(subject.titles).to eq([{
|
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(
|
413
|
-
expect(subject.publisher).to eq(
|
414
|
-
|
415
|
-
expect(subject.provider).to eq(
|
416
|
-
end
|
417
|
-
|
418
|
-
it
|
419
|
-
input =
|
420
|
-
subject = described_class.new(input: input)
|
421
|
-
expect(subject.valid?).to be true
|
422
|
-
expect(subject.id).to eq(
|
423
|
-
expect(subject.url).to eq(
|
424
|
-
expect(subject.type).to eq(
|
425
|
-
expect(subject.
|
426
|
-
expect(subject.
|
427
|
-
|
428
|
-
expect(subject.titles).to eq([{
|
429
|
-
expect(subject.date).to eq(
|
430
|
-
expect(subject.publisher).to eq(
|
431
|
-
|
432
|
-
expect(subject.provider).to eq(
|
433
|
-
expect(subject.container[
|
434
|
-
expect(subject.container[
|
435
|
-
expect(subject.container[
|
436
|
-
expect(subject.container[
|
437
|
-
end
|
438
|
-
|
439
|
-
it
|
440
|
-
input =
|
441
|
-
subject = described_class.new(input: input)
|
442
|
-
expect(subject.valid?).to be true
|
443
|
-
expect(subject.id).to eq(
|
444
|
-
expect(subject.url).to eq(
|
445
|
-
expect(subject.type).to eq(
|
446
|
-
expect(subject.
|
447
|
-
|
448
|
-
expect(subject.titles).to eq([{
|
449
|
-
expect(subject.date).to include(
|
450
|
-
expect(subject.publisher).to eq(
|
451
|
-
|
452
|
-
expect(subject.provider).to eq(
|
453
|
-
expect(subject.container[
|
454
|
-
expect(subject.container[
|
455
|
-
expect(subject.container[
|
456
|
-
expect(subject.container[
|
457
|
-
end
|
458
|
-
|
459
|
-
it
|
460
|
-
input =
|
461
|
-
subject = described_class.new(input: input)
|
462
|
-
expect(subject.valid?).to be true
|
463
|
-
expect(subject.id).to eq(
|
464
|
-
expect(subject.url).to eq(
|
465
|
-
expect(subject.type).to eq(
|
466
|
-
expect(subject.
|
467
|
-
|
468
|
-
expect(subject.titles).to eq([{
|
469
|
-
expect(subject.date).to eq(
|
470
|
-
expect(subject.publisher).to eq(
|
471
|
-
|
472
|
-
expect(subject.provider).to eq(
|
473
|
-
expect(subject.container[
|
474
|
-
expect(subject.container[
|
475
|
-
expect(subject.container[
|
476
|
-
expect(subject.container[
|
477
|
-
end
|
478
|
-
|
479
|
-
it
|
480
|
-
input =
|
481
|
-
subject = described_class.new(input: input)
|
482
|
-
expect(subject.valid?).to be true
|
483
|
-
expect(subject.id).to eq(
|
484
|
-
expect(subject.url).to eq(
|
485
|
-
expect(subject.type).to eq(
|
486
|
-
expect(subject.
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
expect(subject.titles).to eq([{
|
496
|
-
expect(subject.date).to eq(
|
497
|
-
expect(subject.publisher).to eq(
|
498
|
-
|
499
|
-
expect(subject.provider).to eq(
|
500
|
-
end
|
501
|
-
|
502
|
-
it
|
503
|
-
input =
|
504
|
-
subject = described_class.new(input: input)
|
505
|
-
expect(subject.valid?).to be true
|
506
|
-
expect(subject.id).to eq(
|
507
|
-
expect(subject.url).to eq(
|
508
|
-
expect(subject.type).to eq(
|
509
|
-
expect(subject.
|
510
|
-
|
511
|
-
expect(subject.titles).to eq([{
|
512
|
-
expect(subject.date).to eq(
|
513
|
-
expect(subject.publisher).to eq(
|
514
|
-
|
515
|
-
expect(subject.provider).to eq(
|
516
|
-
end
|
517
|
-
|
518
|
-
it
|
519
|
-
input =
|
520
|
-
subject = described_class.new(input: input)
|
521
|
-
expect(subject.valid?).to be
|
522
|
-
expect(subject.
|
523
|
-
expect(subject.
|
524
|
-
expect(subject.
|
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(
|
529
|
-
|
530
|
-
expect(subject.titles).to eq([{
|
531
|
-
expect(subject.date).to eq(
|
532
|
-
expect(subject.publisher).to eq(
|
533
|
-
|
534
|
-
expect(subject.provider).to eq(
|
535
|
-
end
|
536
|
-
|
537
|
-
it
|
538
|
-
input =
|
539
|
-
subject = described_class.new(input: input)
|
540
|
-
expect(subject.valid?).to be true
|
541
|
-
expect(subject.id).to eq(
|
542
|
-
expect(subject.url).to eq(
|
543
|
-
expect(subject.type).to eq(
|
544
|
-
expect(subject.
|
545
|
-
|
546
|
-
expect(subject.titles).to eq([{
|
547
|
-
expect(subject.date).to eq(
|
548
|
-
expect(subject.publisher).to eq(
|
549
|
-
|
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(
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
expect(subject.container).to eq(
|
560
|
-
|
561
|
-
expect(subject.provider).to eq(
|
562
|
-
end
|
563
|
-
|
564
|
-
it
|
565
|
-
input =
|
566
|
-
subject = described_class.new(input: input)
|
567
|
-
expect(subject.valid?).to be true
|
568
|
-
expect(subject.id).to eq(
|
569
|
-
expect(subject.url).to eq(
|
570
|
-
expect(subject.type).to eq(
|
571
|
-
expect(subject.
|
572
|
-
expect(subject.
|
573
|
-
|
574
|
-
expect(subject.titles).to eq([{
|
575
|
-
expect(subject.date).to include(
|
576
|
-
expect(subject.publisher).to eq(
|
577
|
-
|
578
|
-
expect(subject.provider).to eq(
|
579
|
-
end
|
580
|
-
|
581
|
-
it
|
582
|
-
input =
|
583
|
-
subject = described_class.new(input: input)
|
584
|
-
expect(subject.valid?).to be true
|
585
|
-
expect(subject.id).to eq(
|
586
|
-
expect(subject.url).to eq(
|
587
|
-
expect(subject.type).to eq(
|
588
|
-
expect(subject.
|
589
|
-
expect(subject.
|
590
|
-
|
591
|
-
expect(subject.titles).to eq([{
|
592
|
-
expect(subject.date).to eq(
|
593
|
-
expect(subject.publisher).to eq(
|
594
|
-
|
595
|
-
expect(subject.provider).to eq(
|
596
|
-
end
|
597
|
-
|
598
|
-
it
|
599
|
-
input =
|
600
|
-
subject = described_class.new(input: input)
|
601
|
-
expect(subject.valid?).to be true
|
602
|
-
expect(subject.id).to eq(
|
603
|
-
expect(subject.url).to eq(
|
604
|
-
expect(subject.type).to eq(
|
605
|
-
expect(subject.
|
606
|
-
|
607
|
-
expect(subject.titles).to eq([{
|
608
|
-
expect(subject.date).to eq(
|
609
|
-
expect(subject.publisher).to eq(
|
610
|
-
|
611
|
-
expect(subject.provider).to eq(
|
612
|
-
end
|
613
|
-
|
614
|
-
it
|
615
|
-
input =
|
616
|
-
subject = described_class.new(input: input)
|
617
|
-
expect(subject.valid?).to be true
|
618
|
-
expect(subject.id).to eq(
|
619
|
-
expect(subject.url).to eq(
|
620
|
-
expect(subject.type).to eq(
|
621
|
-
expect(subject.
|
622
|
-
expect(subject.
|
623
|
-
|
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([{
|
626
|
-
expect(subject.date).to include(
|
627
|
-
expect(subject.publisher).to eq(
|
628
|
-
|
629
|
-
expect(subject.provider).to eq(
|
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
|
633
|
-
input =
|
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(
|
637
|
-
expect(subject.url).to eq(
|
638
|
-
expect(subject.type).to eq(
|
639
|
-
expect(subject.
|
640
|
-
|
641
|
-
expect(subject.titles).to eq([{
|
642
|
-
expect(subject.date).to include(
|
643
|
-
expect(subject.publisher).to eq(
|
644
|
-
|
645
|
-
expect(subject.provider).to eq(
|
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
|
649
|
-
input =
|
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(
|
653
|
-
expect(subject.url).to eq(
|
654
|
-
expect(subject.type).to eq(
|
655
|
-
expect(subject.
|
656
|
-
expect(subject.
|
657
|
-
|
658
|
-
expect(subject.titles).to eq([{
|
659
|
-
expect(subject.date).to include(
|
660
|
-
expect(subject.publisher).to eq(
|
661
|
-
|
662
|
-
expect(subject.provider).to eq(
|
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
|
666
|
-
input =
|
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(
|
670
|
-
expect(subject.url).to eq(
|
671
|
-
expect(subject.type).to eq(
|
672
|
-
expect(subject.
|
673
|
-
expect(subject.
|
674
|
-
|
675
|
-
|
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([{
|
678
|
-
expect(subject.date).to include(
|
679
|
-
expect(subject.publisher).to eq(
|
680
|
-
|
681
|
-
expect(subject.provider).to eq(
|
682
|
-
end
|
683
|
-
|
684
|
-
it
|
685
|
-
input =
|
686
|
-
subject = described_class.new(input: input)
|
687
|
-
expect(subject.valid?).to be true
|
688
|
-
expect(subject.id).to eq(
|
689
|
-
expect(subject.url).to eq(
|
690
|
-
expect(subject.type).to eq(
|
691
|
-
expect(subject.
|
692
|
-
expect(subject.
|
693
|
-
expect(subject.titles).to eq([{
|
694
|
-
expect(subject.license).to eq(
|
695
|
-
expect(subject.date).to eq(
|
696
|
-
expect(subject.publisher).to eq(
|
697
|
-
|
698
|
-
end
|
699
|
-
|
700
|
-
it
|
701
|
-
input =
|
702
|
-
subject = described_class.new(input: input)
|
703
|
-
expect(subject.valid?).to be true
|
704
|
-
expect(subject.id).to eq(
|
705
|
-
expect(subject.url).to eq(
|
706
|
-
expect(subject.type).to eq(
|
707
|
-
expect(subject.
|
708
|
-
expect(subject.
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
expect(subject.titles).to eq([{
|
714
|
-
expect(subject.date).to eq(
|
715
|
-
expect(subject.publisher).to eq(
|
716
|
-
|
717
|
-
end
|
718
|
-
|
719
|
-
it
|
720
|
-
input =
|
721
|
-
subject = described_class.new(input: input)
|
722
|
-
expect(subject.valid?).to be true
|
723
|
-
expect(subject.id).to eq(
|
724
|
-
expect(subject.url).to eq(
|
725
|
-
expect(subject.type).to eq(
|
726
|
-
expect(subject.
|
727
|
-
expect(subject.
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
expect(subject.titles).to eq([{
|
733
|
-
expect(subject.license).to eq(
|
734
|
-
expect(subject.date).to eq(
|
735
|
-
expect(subject.publisher).to eq(
|
736
|
-
|
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(
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
expect(subject.container).to eq(
|
747
|
-
|
748
|
-
expect(subject.provider).to eq(
|
749
|
-
end
|
750
|
-
|
751
|
-
it
|
752
|
-
input =
|
753
|
-
subject = described_class.new(input: input)
|
754
|
-
expect(subject.valid?).to be true
|
755
|
-
expect(subject.id).to eq(
|
756
|
-
expect(subject.url).to eq(
|
757
|
-
expect(subject.type).to eq(
|
758
|
-
expect(subject.
|
759
|
-
expect(subject.
|
760
|
-
expect(subject.titles).to eq([{
|
761
|
-
expect(subject.date).to include(
|
762
|
-
expect(subject.publisher).to eq(
|
763
|
-
|
764
|
-
expect(subject.provider).to eq(
|
765
|
-
end
|
766
|
-
|
767
|
-
it
|
768
|
-
input =
|
769
|
-
subject = described_class.new(input: input)
|
770
|
-
expect(subject.valid?).to be true
|
771
|
-
expect(subject.id).to eq(
|
772
|
-
expect(subject.url).to eq(
|
773
|
-
expect(subject.type).to eq(
|
774
|
-
expect(subject.
|
775
|
-
expect(subject.
|
776
|
-
|
777
|
-
expect(subject.titles).to eq([{
|
778
|
-
expect(subject.date).to include(
|
779
|
-
expect(subject.publisher).to eq(
|
780
|
-
|
781
|
-
expect(subject.provider).to eq(
|
782
|
-
end
|
783
|
-
|
784
|
-
it
|
785
|
-
input =
|
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(
|
789
|
-
expect(subject.url).to eq(
|
790
|
-
expect(subject.type).to eq(
|
791
|
-
expect(subject.
|
792
|
-
expect(subject.
|
793
|
-
|
794
|
-
expect(subject.titles).to eq([{
|
795
|
-
expect(subject.date).to include(
|
796
|
-
expect(subject.publisher).to eq(
|
797
|
-
|
798
|
-
expect(subject.container).to eq(
|
799
|
-
|
800
|
-
expect(subject.provider).to eq(
|
801
|
-
end
|
802
|
-
|
803
|
-
it
|
804
|
-
input =
|
805
|
-
subject = described_class.new(input: input)
|
806
|
-
expect(subject.valid?).to be true
|
807
|
-
expect(subject.id).to eq(
|
808
|
-
expect(subject.url).to eq(
|
809
|
-
expect(subject.type).to eq(
|
810
|
-
expect(subject.
|
811
|
-
expect(subject.
|
812
|
-
|
813
|
-
expect(subject.titles).to eq([{
|
814
|
-
expect(subject.date).to include(
|
815
|
-
expect(subject.publisher).to eq(
|
816
|
-
|
817
|
-
expect(subject.container).to eq(
|
818
|
-
|
819
|
-
expect(subject.provider).to eq(
|
820
|
-
end
|
821
|
-
|
822
|
-
it
|
823
|
-
input =
|
824
|
-
subject = described_class.new(input: input)
|
825
|
-
expect(subject.valid?).to be true
|
826
|
-
expect(subject.url).to eq(
|
827
|
-
expect(subject.type).to eq(
|
828
|
-
expect(subject.
|
829
|
-
expect(subject.
|
830
|
-
|
831
|
-
|
832
|
-
expect(subject.titles).to eq([{
|
833
|
-
expect(subject.id).to eq(
|
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 δ&lt;sup&gt;13&lt;/sup&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[
|
836
|
-
expect(subject.date).to include(
|
837
|
-
expect(subject.publisher).to eq(
|
838
|
-
|
839
|
-
expect(subject.provider).to eq(
|
840
|
-
end
|
841
|
-
|
842
|
-
it
|
843
|
-
input =
|
844
|
-
subject = described_class.new(input: input)
|
845
|
-
expect(subject.valid?).to be true
|
846
|
-
expect(subject.url).to eq(
|
847
|
-
expect(subject.type).to eq(
|
848
|
-
expect(subject.
|
849
|
-
expect(subject.
|
850
|
-
|
851
|
-
expect(subject.contributors.
|
852
|
-
expect(subject.
|
853
|
-
|
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[
|
858
|
-
expect(subject.date).to include(
|
859
|
-
expect(subject.publisher).to eq(
|
860
|
-
|
861
|
-
expect(subject.provider).to eq(
|
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
|
865
|
-
input =
|
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(
|
869
|
-
expect(subject.type).to eq(
|
870
|
-
expect(subject.
|
871
|
-
expect(subject.
|
872
|
-
|
873
|
-
expect(subject.
|
874
|
-
expect(subject.
|
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(
|
878
|
-
expect(subject.publisher).to eq(
|
879
|
-
|
880
|
-
expect(subject.provider).to eq(
|
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
|
884
|
-
input =
|
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.
|
888
|
-
expect(subject.
|
889
|
-
expect(subject.
|
890
|
-
expect(subject.
|
891
|
-
expect(subject.
|
892
|
-
expect(subject.
|
893
|
-
expect(subject.
|
894
|
-
|
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(
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
expect(subject.container).to eq(
|
906
|
-
|
907
|
-
expect(subject.provider).to eq(
|
908
|
-
end
|
909
|
-
|
910
|
-
it
|
911
|
-
input =
|
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(
|
915
|
-
expect(subject.provider).to eq(
|
916
|
-
expect(subject.state).to eq(
|
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
|