commonmeta-ruby 3.4.5 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/csl-data.json +538 -0
- data/lib/commonmeta/author_utils.rb +103 -71
- data/lib/commonmeta/crossref_utils.rb +31 -25
- data/lib/commonmeta/metadata.rb +8 -14
- 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 +131 -124
- 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 +5 -5
- data/lib/commonmeta/readers/json_feed_reader.rb +8 -4
- 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 +6 -4
- 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 +7 -4
- data/resources/{commonmeta_v0.9.3.json → commonmeta_v0.10.3.json} +138 -55
- data/resources/csl-citation.json +99 -0
- 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/get_json_feed_item_metadata/archived_wordpress_post.yml +119 -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 +844 -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 +68 -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 +289 -288
- 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 +2 -1
- metadata +10 -3
@@ -1,919 +1,928 @@
|
|
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.
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
expect(subject.
|
318
|
-
expect(subject.
|
319
|
-
|
320
|
-
expect(subject.
|
321
|
-
expect(subject.
|
322
|
-
expect(subject.
|
323
|
-
|
303
|
+
expect(subject.references.last).to eq("doi" => "https://doi.org/10.1378/chest.12-0045",
|
304
|
+
"key" => "30")
|
305
|
+
expect(subject.files).to eq([{ "mimeType" => "application/pdf",
|
306
|
+
"url" => "http://downloads.hindawi.com/journals/pm/2012/291294.pdf" },
|
307
|
+
{ "mimeType" => "application/xml",
|
308
|
+
"url" => "http://downloads.hindawi.com/journals/pm/2012/291294.xml" }])
|
309
|
+
expect(subject.container).to eq("firstPage" => "1", "identifier" => "2090-1844",
|
310
|
+
"identifierType" => "ISSN", "lastPage" => "7", "title" => "Pulmonary Medicine", "type" => "Journal", "volume" => "2012")
|
311
|
+
expect(subject.provider).to eq("Crossref")
|
312
|
+
end
|
313
|
+
|
314
|
+
it "date in future" do
|
315
|
+
input = "https://doi.org/10.1016/j.ejphar.2015.03.018"
|
316
|
+
subject = described_class.new(input: input)
|
317
|
+
expect(subject.valid?).to be true
|
318
|
+
expect(subject.id).to eq("https://doi.org/10.1016/j.ejphar.2015.03.018")
|
319
|
+
expect(subject.url).to eq("https://linkinghub.elsevier.com/retrieve/pii/S0014299915002332")
|
320
|
+
expect(subject.type).to eq("JournalArticle")
|
321
|
+
expect(subject.contributors.length).to eq(10)
|
322
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
323
|
+
"givenName" => "Sarah E.", "familyName" => "Beck")
|
324
|
+
expect(subject.titles).to eq([{ "title" => "Paving the path to HIV neurotherapy: Predicting SIV CNS disease" }])
|
325
|
+
expect(subject.date).to include("published" => "2015-07")
|
326
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/78",
|
327
|
+
"name" => "Elsevier BV")
|
324
328
|
expect(subject.references.length).to eq(98)
|
325
|
-
expect(subject.references.first).to eq(
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
expect(subject.
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
expect(subject.
|
345
|
-
expect(subject.
|
346
|
-
|
347
|
-
expect(subject.
|
348
|
-
expect(subject.
|
349
|
-
expect(subject.
|
350
|
-
|
329
|
+
expect(subject.references.first).to eq("containerTitle" => "J. Immunol",
|
330
|
+
"contributor" => "Allen",
|
331
|
+
"firstPage" => "6062",
|
332
|
+
"key" => "10.1016/j.ejphar.2015.03.018_bib1",
|
333
|
+
"publicationYear" => "1998",
|
334
|
+
"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.",
|
335
|
+
"volume" => "160")
|
336
|
+
expect(subject.files).to eq([{ "mimeType" => "text/xml",
|
337
|
+
"url" => "https://api.elsevier.com/content/article/PII:S0014299915002332?httpAccept=text/xml" },
|
338
|
+
{ "mimeType" => "text/plain",
|
339
|
+
"url" => "https://api.elsevier.com/content/article/PII:S0014299915002332?httpAccept=text/plain" }])
|
340
|
+
expect(subject.container).to eq("firstPage" => "303", "identifier" => "0014-2999",
|
341
|
+
"identifierType" => "ISSN", "lastPage" => "312", "title" => "European Journal of Pharmacology", "type" => "Journal", "volume" => "759")
|
342
|
+
expect(subject.provider).to eq("Crossref")
|
343
|
+
end
|
344
|
+
|
345
|
+
it "vor with url" do
|
346
|
+
input = "https://doi.org/10.1038/hdy.2013.26"
|
347
|
+
subject = described_class.new(input: input)
|
348
|
+
expect(subject.valid?).to be true
|
349
|
+
expect(subject.id).to eq("https://doi.org/10.1038/hdy.2013.26")
|
350
|
+
expect(subject.url).to eq("https://www.nature.com/articles/hdy201326")
|
351
|
+
expect(subject.type).to eq("JournalArticle")
|
352
|
+
expect(subject.contributors.length).to eq(2)
|
353
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Gross",
|
354
|
+
"givenName" => "J B")
|
355
|
+
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" }])
|
356
|
+
expect(subject.date).to include("published" => "2013-04-10")
|
357
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
|
358
|
+
"name" => "Springer Science and Business Media LLC")
|
351
359
|
expect(subject.references.size).to eq(41)
|
352
|
-
expect(subject.references.first).to eq(
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
expect(subject.
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
subject
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
expect(subject.
|
373
|
-
|
374
|
-
expect(subject.
|
360
|
+
expect(subject.references.first).to eq("containerTitle" => "An Esc Nac Cien Biol México",
|
361
|
+
"contributor" => "J Alvarez",
|
362
|
+
"firstPage" => "263",
|
363
|
+
"key" => "BFhdy201326_CR1",
|
364
|
+
"publicationYear" => "1946",
|
365
|
+
"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.",
|
366
|
+
"volume" => "4")
|
367
|
+
expect(subject.files).to eq([{ "mimeType" => "application/pdf",
|
368
|
+
"url" => "http://www.nature.com/articles/hdy201326.pdf" },
|
369
|
+
{ "mimeType" => "text/html", "url" => "http://www.nature.com/articles/hdy201326" },
|
370
|
+
{ "mimeType" => "application/pdf",
|
371
|
+
"url" => "http://www.nature.com/articles/hdy201326.pdf" }])
|
372
|
+
expect(subject.container).to eq("firstPage" => "122", "identifier" => "1365-2540",
|
373
|
+
"identifierType" => "ISSN", "issue" => "2", "lastPage" => "130", "title" => "Heredity", "type" => "Journal", "volume" => "111")
|
374
|
+
expect(subject.provider).to eq("Crossref")
|
375
|
+
end
|
376
|
+
|
377
|
+
it "dataset" do
|
378
|
+
input = "https://doi.org/10.2210/pdb4hhb/pdb"
|
379
|
+
subject = described_class.new(input: input)
|
380
|
+
expect(subject.valid?).to be true
|
381
|
+
expect(subject.id).to eq("https://doi.org/10.2210/pdb4hhb/pdb")
|
382
|
+
expect(subject.url).to eq("https://www.wwpdb.org/pdb?id=pdb_00004hhb")
|
383
|
+
expect(subject.type).to eq("Component")
|
384
|
+
expect(subject.contributors.length).to eq(2)
|
385
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "givenName" => "G.",
|
386
|
+
"familyName" => "Fermi")
|
387
|
+
expect(subject.titles).to eq([{ "title" => "THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT 1.74 ANGSTROMS RESOLUTION" }])
|
375
388
|
expect(subject.descriptions).to eq([])
|
376
|
-
expect(subject.date).to include(
|
377
|
-
expect(subject.publisher).to eq(
|
378
|
-
|
379
|
-
expect(subject.provider).to eq(
|
389
|
+
expect(subject.date).to include("published" => "1984-07-17")
|
390
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/7763",
|
391
|
+
"name" => "Worldwide Protein Data Bank")
|
392
|
+
expect(subject.provider).to eq("Crossref")
|
380
393
|
end
|
381
394
|
|
382
|
-
it
|
383
|
-
input =
|
395
|
+
it "component" do
|
396
|
+
input = "https://doi.org/10.1371/journal.pmed.0030277.g001"
|
384
397
|
subject = described_class.new(input: input)
|
385
398
|
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([{
|
399
|
+
expect(subject.errors).to eq(["property '/contributors' is invalid: error_type=minItems"])
|
400
|
+
expect(subject.id).to eq("https://doi.org/10.1371/journal.pmed.0030277.g001")
|
401
|
+
expect(subject.url).to eq("https://dx.plos.org/10.1371/journal.pmed.0030277.g001")
|
402
|
+
expect(subject.type).to eq("Component")
|
403
|
+
expect(subject.contributors.empty?).to be true
|
404
|
+
expect(subject.titles).to eq([{ "title" => ":(unav)" }])
|
392
405
|
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(
|
406
|
+
expect(subject.date).to eq("published" => "2015-10-20", "updated" => "2018-10-19")
|
407
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/340",
|
408
|
+
"name" => "Public Library of Science (PLoS)")
|
409
|
+
expect(subject.provider).to eq("Crossref")
|
397
410
|
end
|
398
411
|
|
399
|
-
it
|
400
|
-
input =
|
412
|
+
it "dataset usda" do
|
413
|
+
input = "https://doi.org/10.2737/RDS-2018-0001"
|
401
414
|
subject = described_class.new(input: input)
|
402
415
|
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([{
|
416
|
+
expect(subject.id).to eq("https://doi.org/10.2737/rds-2018-0001")
|
417
|
+
expect(subject.url).to eq("https://www.fs.usda.gov/rds/archive/Catalog/RDS-2018-0001")
|
418
|
+
expect(subject.type).to eq("Dataset")
|
419
|
+
expect(subject.contributors.length).to eq(4)
|
420
|
+
expect(subject.contributors.first).to eq("familyName" => "Ribic", "givenName" => "Christine A.",
|
421
|
+
"affiliation" => [{ "name" => "U.S. Geological Survey" }],
|
422
|
+
"id" => "https://orcid.org/0000-0003-2583-1778", "type" => "Person", "contributorRoles" => ["Author"])
|
423
|
+
expect(subject.titles).to eq([{ "title" => "Fledging times of grassland birds" }])
|
411
424
|
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
|
425
|
+
expect(subject.date).to eq("published" => "2017-08-09", "updated" => "2021-07-01")
|
426
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/1450",
|
427
|
+
"name" => "USDA Forest Service")
|
428
|
+
expect(subject.provider).to eq("Crossref")
|
429
|
+
end
|
430
|
+
|
431
|
+
it "book chapter" do
|
432
|
+
input = "https://doi.org/10.1007/978-3-662-46370-3_13"
|
433
|
+
subject = described_class.new(input: input)
|
434
|
+
expect(subject.valid?).to be true
|
435
|
+
expect(subject.id).to eq("https://doi.org/10.1007/978-3-662-46370-3_13")
|
436
|
+
expect(subject.url).to eq("https://link.springer.com/10.1007/978-3-662-46370-3_13")
|
437
|
+
expect(subject.type).to eq("BookChapter")
|
438
|
+
expect(subject.contributors.length).to eq(2)
|
439
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
440
|
+
"givenName" => "Ronald L.", "familyName" => "Diercks")
|
441
|
+
expect(subject.titles).to eq([{ "title" => "Clinical Symptoms and Physical Examinations" }])
|
442
|
+
expect(subject.date).to eq("published" => "2015", "updated" => "2023-02-10")
|
443
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
|
444
|
+
"name" => "Springer Science and Business Media LLC")
|
445
|
+
expect(subject.provider).to eq("Crossref")
|
446
|
+
expect(subject.container["type"]).to eq("Book")
|
447
|
+
expect(subject.container["title"]).to eq("Shoulder Stiffness")
|
448
|
+
expect(subject.container["firstPage"]).to eq("155")
|
449
|
+
expect(subject.container["lastPage"]).to eq("158")
|
450
|
+
end
|
451
|
+
|
452
|
+
it "another book chapter" do
|
453
|
+
input = "https://doi.org/10.1007/978-3-319-75889-3_1"
|
454
|
+
subject = described_class.new(input: input)
|
455
|
+
expect(subject.valid?).to be true
|
456
|
+
expect(subject.id).to eq("https://doi.org/10.1007/978-3-319-75889-3_1")
|
457
|
+
expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-319-75889-3_1")
|
458
|
+
expect(subject.type).to eq("BookChapter")
|
459
|
+
expect(subject.contributors).to eq([{ "familyName" => "Jones", "givenName" => "Hunter M.",
|
460
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
461
|
+
expect(subject.titles).to eq([{ "title" => "Climate Change and Increasing Risk of Extreme Heat" }])
|
462
|
+
expect(subject.date).to include("published" => "2018")
|
463
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
|
464
|
+
"name" => "Springer Science and Business Media LLC")
|
465
|
+
expect(subject.provider).to eq("Crossref")
|
466
|
+
expect(subject.container["type"]).to eq("Book")
|
467
|
+
expect(subject.container["title"]).to eq("SpringerBriefs in Medical Earth Sciences")
|
468
|
+
expect(subject.container["identifier"]).to eq("2523-3629")
|
469
|
+
expect(subject.container["identifierType"]).to eq("ISSN")
|
470
|
+
end
|
471
|
+
|
472
|
+
it "yet another book chapter" do
|
473
|
+
input = "https://doi.org/10.4018/978-1-4666-1891-6.ch004"
|
474
|
+
subject = described_class.new(input: input)
|
475
|
+
expect(subject.valid?).to be true
|
476
|
+
expect(subject.id).to eq("https://doi.org/10.4018/978-1-4666-1891-6.ch004")
|
477
|
+
expect(subject.url).to eq("http://services.igi-global.com/resolvedoi/resolve.aspx?doi=10.4018%2F978-1-4666-1891-6.ch004")
|
478
|
+
expect(subject.type).to eq("BookChapter")
|
479
|
+
expect(subject.contributors).to eq([{ "type" => "Person", "contributorRoles" => ["Author"], "affiliation" => [{ "name" => "Université de Lyon, France" }],
|
480
|
+
"familyName" => "Bichot", "givenName" => "Charles-Edmond" }])
|
481
|
+
expect(subject.titles).to eq([{ "title" => "Unsupervised and Supervised Image Segmentation Using Graph Partitioning" }])
|
482
|
+
expect(subject.date).to eq("published" => "2012-08-08", "updated" => "2019-07-02")
|
483
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/2432",
|
484
|
+
"name" => "IGI Global")
|
485
|
+
expect(subject.provider).to eq("Crossref")
|
486
|
+
expect(subject.container["type"]).to eq("Book")
|
487
|
+
expect(subject.container["title"]).to eq("Graph-Based Methods in Computer Vision")
|
488
|
+
expect(subject.container["firstPage"]).to eq("72")
|
489
|
+
expect(subject.container["lastPage"]).to eq("94")
|
490
|
+
end
|
491
|
+
|
492
|
+
it "missing contributor" do
|
493
|
+
input = "https://doi.org/10.3390/publications6020015"
|
494
|
+
subject = described_class.new(input: input)
|
495
|
+
expect(subject.valid?).to be true
|
496
|
+
expect(subject.id).to eq("https://doi.org/10.3390/publications6020015")
|
497
|
+
expect(subject.url).to eq("https://www.mdpi.com/2304-6775/6/2/15")
|
498
|
+
expect(subject.type).to eq("JournalArticle")
|
499
|
+
expect(subject.contributors).to eq([{ "familyName" => "Kohls",
|
500
|
+
"givenName" => "Alexander",
|
501
|
+
"id" => "https://orcid.org/0000-0002-3836-8885",
|
502
|
+
"type" => "Person", "contributorRoles" => ["Author"] },
|
503
|
+
{ "familyName" => "Mele",
|
504
|
+
"givenName" => "Salvatore",
|
505
|
+
|
506
|
+
"id" => "https://orcid.org/0000-0003-0762-2235",
|
507
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
508
|
+
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" }])
|
509
|
+
expect(subject.date).to eq("published" => "2018-04-09", "updated" => "2021-07-22")
|
510
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/1968",
|
511
|
+
"name" => "MDPI AG")
|
512
|
+
expect(subject.provider).to eq("Crossref")
|
513
|
+
end
|
514
|
+
|
515
|
+
it "book" do
|
516
|
+
input = "https://doi.org/10.1017/9781108348843"
|
517
|
+
subject = described_class.new(input: input)
|
518
|
+
expect(subject.valid?).to be true
|
519
|
+
expect(subject.id).to eq("https://doi.org/10.1017/9781108348843")
|
520
|
+
expect(subject.url).to eq("https://www.cambridge.org/core/product/identifier/9781108348843/type/book")
|
521
|
+
expect(subject.type).to eq("Book")
|
522
|
+
expect(subject.contributors).to eq([{ "type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Leung",
|
523
|
+
"givenName" => "Vincent S." }])
|
524
|
+
expect(subject.titles).to eq([{ "title" => "The Politics of the Past in Early China" }])
|
525
|
+
expect(subject.date).to eq("published" => "2019-07-01", "updated" => "2022-09-22")
|
526
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/56",
|
527
|
+
"name" => "Cambridge University Press (CUP)")
|
528
|
+
expect(subject.provider).to eq("Crossref")
|
529
|
+
end
|
530
|
+
|
531
|
+
it "another book" do
|
532
|
+
input = "https://doi.org/10.2973/odp.proc.ir.180.2000"
|
533
|
+
subject = described_class.new(input: input)
|
534
|
+
expect(subject.valid?).to be true
|
535
|
+
expect(subject.id).to eq("https://doi.org/10.2973/odp.proc.ir.180.2000")
|
536
|
+
expect(subject.url).to eq("http://www-odp.tamu.edu/publications/180_IR/180TOC.HTM")
|
537
|
+
expect(subject.type).to eq("Book")
|
527
538
|
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
|
-
|
539
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Editor"], "familyName" => "Taylor",
|
540
|
+
"givenName" => "B.")
|
541
|
+
expect(subject.titles).to eq([{ "title" => "Proceedings of the Ocean Drilling Program, 180 Initial Reports" }])
|
542
|
+
expect(subject.date).to eq("published" => "2000-02-04", "updated" => "2009-02-02")
|
543
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/1029",
|
544
|
+
"name" => "International Ocean Discovery Program (IODP)")
|
545
|
+
expect(subject.provider).to eq("Crossref")
|
546
|
+
end
|
547
|
+
|
548
|
+
it "yet another book" do
|
549
|
+
input = "https://doi.org/10.1029/ar035"
|
550
|
+
subject = described_class.new(input: input)
|
551
|
+
expect(subject.valid?).to be true
|
552
|
+
expect(subject.id).to eq("https://doi.org/10.1029/ar035")
|
553
|
+
expect(subject.url).to eq("http://doi.wiley.com/10.1029/AR035")
|
554
|
+
expect(subject.type).to eq("Book")
|
555
|
+
expect(subject.contributors).to eq([{ "type" => "Person", "contributorRoles" => ["Author"], "familyName" => "McGinnis",
|
556
|
+
"givenName" => "Richard Frank" }])
|
557
|
+
expect(subject.titles).to eq([{ "title" => "Biogeography of Lanternfishes (Myctophidae) South of 30°S" }])
|
558
|
+
expect(subject.date).to eq("published" => "1982", "updated" => "2021-12-04")
|
559
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/311",
|
560
|
+
"name" => "Wiley")
|
550
561
|
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
|
-
|
562
|
+
expect(subject.references.first).to eq("containerTitle" => "Palaeogeogr. Palaeoclimatol. Palaeoecol.",
|
563
|
+
"contributor" => "Addicott",
|
564
|
+
"doi" => "https://doi.org/10.1016/0031-0182(70)90103-3",
|
565
|
+
"firstPage" => "287",
|
566
|
+
"key" => "10.1029/AR035:addi70",
|
567
|
+
"publicationYear" => "1970",
|
568
|
+
"title" => "Latitudinal gradients in tertiary mol-luscan faunas of the Pacific coast",
|
569
|
+
"volume" => "8")
|
570
|
+
expect(subject.container).to eq("identifier" => "0066-4634", "identifierType" => "ISSN",
|
571
|
+
"title" => "Antarctic Research Series", "type" => "BookSeries")
|
572
|
+
expect(subject.provider).to eq("Crossref")
|
573
|
+
end
|
574
|
+
|
575
|
+
it "mEDRA" do
|
576
|
+
input = "https://doi.org/10.3280/ecag2018-001005"
|
577
|
+
subject = described_class.new(input: input)
|
578
|
+
expect(subject.valid?).to be true
|
579
|
+
expect(subject.id).to eq("https://doi.org/10.3280/ecag2018-001005")
|
580
|
+
expect(subject.url).to eq("http://www.francoangeli.it/riviste/Scheda_Riviste.asp?IDArticolo=61645")
|
581
|
+
expect(subject.type).to eq("JournalArticle")
|
582
|
+
expect(subject.contributors.length).to eq(2)
|
583
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Oh",
|
584
|
+
"givenName" => "Sohae Eve")
|
585
|
+
expect(subject.titles).to eq([{ "title" => "Substitutability between organic and conventional poultry products and organic price premiums" }])
|
586
|
+
expect(subject.date).to include("published" => "2018-05")
|
587
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/4169",
|
588
|
+
"name" => "Franco Angeli")
|
589
|
+
expect(subject.provider).to eq("Crossref")
|
590
|
+
end
|
591
|
+
|
592
|
+
it "KISTI" do
|
593
|
+
input = "https://doi.org/10.5012/bkcs.2013.34.10.2889"
|
594
|
+
subject = described_class.new(input: input)
|
595
|
+
expect(subject.valid?).to be true
|
596
|
+
expect(subject.id).to eq("https://doi.org/10.5012/bkcs.2013.34.10.2889")
|
597
|
+
expect(subject.url).to eq("http://koreascience.or.kr/journal/view.jsp?kj=JCGMCS&py=2013&vnc=v34n10&sp=2889")
|
598
|
+
expect(subject.type).to eq("JournalArticle")
|
599
|
+
expect(subject.contributors.length).to eq(7)
|
600
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Huang",
|
601
|
+
"givenName" => "Guimei")
|
602
|
+
expect(subject.titles).to eq([{ "title" => "Synthesis, Crystal Structure and Theoretical Calculation of a Novel Nickel(II) Complex with Dibromotyrosine and 1,10-Phenanthroline" }])
|
603
|
+
expect(subject.date).to eq("published" => "2013-10-20", "updated" => "2016-12-15")
|
604
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/2923",
|
605
|
+
"name" => "Korean Chemical Society")
|
606
|
+
expect(subject.provider).to eq("KISTI")
|
607
|
+
end
|
608
|
+
|
609
|
+
it "JaLC" do
|
610
|
+
input = "https://doi.org/10.1241/johokanri.39.979"
|
611
|
+
subject = described_class.new(input: input)
|
612
|
+
expect(subject.valid?).to be true
|
613
|
+
expect(subject.id).to eq("https://doi.org/10.1241/johokanri.39.979")
|
614
|
+
expect(subject.url).to eq("http://joi.jlc.jst.go.jp/JST.JSTAGE/johokanri/39.979?from=CrossRef")
|
615
|
+
expect(subject.type).to eq("JournalArticle")
|
616
|
+
expect(subject.contributors).to eq([{ "familyName" => "KUSUMOTO", "givenName" => "Hiroyuki",
|
617
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
618
|
+
expect(subject.titles).to eq([{ "title" => "Utilizing the Internet. 12 Series. Future of the Internet." }])
|
619
|
+
expect(subject.date).to eq("published" => "1997", "updated" => "2020-03-06")
|
620
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/272",
|
621
|
+
"name" => "Japan Science and Technology Agency (JST)")
|
622
|
+
expect(subject.provider).to eq("JaLC")
|
623
|
+
end
|
624
|
+
|
625
|
+
it "OP" do
|
626
|
+
input = "https://doi.org/10.2903/j.efsa.2018.5239"
|
627
|
+
subject = described_class.new(input: input)
|
628
|
+
expect(subject.valid?).to be true
|
629
|
+
expect(subject.id).to eq("https://doi.org/10.2903/j.efsa.2018.5239")
|
630
|
+
expect(subject.url).to eq("http://doi.wiley.com/10.2903/j.efsa.2018.5239")
|
631
|
+
expect(subject.type).to eq("JournalArticle")
|
632
|
+
expect(subject.contributors.length).to eq(28)
|
633
|
+
expect(subject.contributors.first).to eq(
|
634
|
+
"name" => "EFSA Panel on Food Additives and Nutrient Sources added to Food (ANS)", "type" => "Organization", "contributorRoles" => ["Author"],
|
624
635
|
)
|
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(
|
636
|
+
expect(subject.titles).to eq([{ "title" => "Scientific opinion on the safety of green tea catechins" }])
|
637
|
+
expect(subject.date).to include("published" => "2018-04")
|
638
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/311",
|
639
|
+
"name" => "Wiley")
|
640
|
+
expect(subject.provider).to eq("OP")
|
630
641
|
end
|
631
642
|
|
632
|
-
it
|
633
|
-
input =
|
643
|
+
it "multiple titles" do
|
644
|
+
input = "https://doi.org/10.4000/dms.865"
|
634
645
|
subject = described_class.new(input: input)
|
635
646
|
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(
|
647
|
+
expect(subject.id).to eq("https://doi.org/10.4000/dms.865")
|
648
|
+
expect(subject.url).to eq("http://journals.openedition.org/dms/865")
|
649
|
+
expect(subject.type).to eq("JournalArticle")
|
650
|
+
expect(subject.contributors).to eq([{ "familyName" => "Peraya", "givenName" => "Daniel",
|
651
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
652
|
+
expect(subject.titles).to eq([{ "title" => "Distance(s), proximity and presence(s): evolving concepts" }])
|
653
|
+
expect(subject.date).to include("published" => "2014-12-14")
|
654
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/2399",
|
655
|
+
"name" => "OpenEdition")
|
656
|
+
expect(subject.provider).to eq("Crossref")
|
646
657
|
end
|
647
658
|
|
648
|
-
it
|
649
|
-
input =
|
659
|
+
it "multiple titles with missing" do
|
660
|
+
input = "https://doi.org/10.1186/1471-2164-7-187"
|
650
661
|
subject = described_class.new(input: input)
|
651
662
|
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(
|
663
|
+
expect(subject.id).to eq("https://doi.org/10.1186/1471-2164-7-187")
|
664
|
+
expect(subject.url).to eq("https://bmcgenomics.biomedcentral.com/articles/10.1186/1471-2164-7-187")
|
665
|
+
expect(subject.type).to eq("JournalArticle")
|
666
|
+
expect(subject.contributors.size).to eq(5)
|
667
|
+
expect(subject.contributors.first).to eq("familyName" => "Myers", "givenName" => "Chad L",
|
668
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
669
|
+
expect(subject.titles).to eq([{ "title" => "Finding function: evaluation methods for functional genomic data" }])
|
670
|
+
expect(subject.date).to include("published" => "2006-07-25")
|
671
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
|
672
|
+
"name" => "Springer Science and Business Media LLC")
|
673
|
+
expect(subject.provider).to eq("Crossref")
|
663
674
|
end
|
664
675
|
|
665
|
-
it
|
666
|
-
input =
|
676
|
+
it "markup" do
|
677
|
+
input = "https://doi.org/10.1098/rspb.2017.0132"
|
667
678
|
subject = described_class.new(input: input)
|
668
679
|
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
|
-
|
680
|
+
expect(subject.id).to eq("https://doi.org/10.1098/rspb.2017.0132")
|
681
|
+
expect(subject.url).to eq("https://royalsocietypublishing.org/doi/10.1098/rspb.2017.0132")
|
682
|
+
expect(subject.type).to eq("JournalArticle")
|
683
|
+
expect(subject.contributors.size).to eq(6)
|
684
|
+
expect(subject.contributors.first).to eq(
|
685
|
+
"affiliation" => [{ "name" => "School of Biological Sciences, Centre for Evolutionary Biology, University of Western Australia, Crawley, WA 6009, Australia" }], "familyName" => "Dougherty", "givenName" => "Liam R.",
|
686
|
+
"id" => "https://orcid.org/0000-0003-1406-0680", "type" => "Person", "contributorRoles" => ["Author"],
|
676
687
|
)
|
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
|
-
|
688
|
+
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>" }])
|
689
|
+
expect(subject.date).to include("published" => "2017-05-24")
|
690
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/175",
|
691
|
+
"name" => "The Royal Society")
|
692
|
+
expect(subject.provider).to eq("Crossref")
|
693
|
+
end
|
694
|
+
|
695
|
+
it "empty given name" do
|
696
|
+
input = "https://doi.org/10.1111/J.1865-1682.2010.01171.X"
|
697
|
+
subject = described_class.new(input: input)
|
698
|
+
expect(subject.valid?).to be true
|
699
|
+
expect(subject.id).to eq("https://doi.org/10.1111/j.1865-1682.2010.01171.x")
|
700
|
+
expect(subject.url).to eq("https://onlinelibrary.wiley.com/doi/10.1111/j.1865-1682.2010.01171.x")
|
701
|
+
expect(subject.type).to eq("JournalArticle")
|
702
|
+
expect(subject.contributors.length).to eq(5)
|
703
|
+
expect(subject.contributors[3]).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Ehtisham-ul-Haq")
|
704
|
+
expect(subject.titles).to eq([{ "title" => "Serological Evidence of Brucella abortus Prevalence in Punjab Province, Pakistan - A Cross-Sectional Study" }])
|
705
|
+
expect(subject.license).to eq("url" => "http://doi.wiley.com/10.1002/tdm_license_1.1")
|
706
|
+
expect(subject.date).to eq("published" => "2010-09-29", "updated" => "2023-02-09")
|
707
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/98",
|
708
|
+
"name" => "Hindawi Limited")
|
709
|
+
end
|
710
|
+
|
711
|
+
it "invalid date" do
|
712
|
+
input = "https://doi.org/10.1055/s-0039-1690894"
|
713
|
+
subject = described_class.new(input: input)
|
714
|
+
expect(subject.valid?).to be true
|
715
|
+
expect(subject.id).to eq("https://doi.org/10.1055/s-0039-1690894")
|
716
|
+
expect(subject.url).to eq("http://www.thieme-connect.de/DOI/DOI?10.1055%2Fs-0039-1690894")
|
717
|
+
expect(subject.type).to eq("JournalArticle")
|
718
|
+
expect(subject.contributors.length).to eq(4)
|
719
|
+
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" }],
|
720
|
+
"familyName" => "Ma",
|
721
|
+
"givenName" => "Jun-An",
|
722
|
+
"id" => "https://orcid.org/0000-0002-3902-6799",
|
723
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
724
|
+
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" }])
|
725
|
+
expect(subject.date).to eq("published" => "2020-04-08", "updated" => "2020-06-16")
|
726
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/194",
|
727
|
+
"name" => "Georg Thieme Verlag KG")
|
728
|
+
end
|
729
|
+
|
730
|
+
it "journal article with" do
|
731
|
+
input = "https://doi.org/10.1111/nph.14619"
|
732
|
+
subject = described_class.new(input: input)
|
733
|
+
expect(subject.valid?).to be true
|
734
|
+
expect(subject.id).to eq("https://doi.org/10.1111/nph.14619")
|
735
|
+
expect(subject.url).to eq("https://onlinelibrary.wiley.com/doi/10.1111/nph.14619")
|
736
|
+
expect(subject.type).to eq("JournalArticle")
|
737
|
+
expect(subject.contributors.length).to eq(3)
|
738
|
+
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" }],
|
739
|
+
"familyName" => "Dissmeyer",
|
740
|
+
"givenName" => "Nico",
|
741
|
+
"id" => "https://orcid.org/0000-0002-4156-3761",
|
742
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
743
|
+
expect(subject.titles).to eq([{ "title" => "Life and death of proteins after protease cleavage: protein degradation by the N-end rule pathway" }])
|
744
|
+
expect(subject.license).to eq("url" => "http://doi.wiley.com/10.1002/tdm_license_1.1")
|
745
|
+
expect(subject.date).to eq("published" => "2017-06-05", "updated" => "2021-07-07")
|
746
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/311",
|
747
|
+
"name" => "Wiley")
|
737
748
|
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 =
|
749
|
+
expect(subject.references.last).to eq("containerTitle" => "Proteomics",
|
750
|
+
"contributor" => "Zhang",
|
751
|
+
"doi" => "https://doi.org/10.1002/pmic.201400530",
|
752
|
+
"firstPage" => "2447",
|
753
|
+
"key" => "10.1111/nph.14619-BIB0049|nph14619-cit-0049",
|
754
|
+
"publicationYear" => "2015",
|
755
|
+
"title" => "Quantitative proteomics analysis of the Arg/N-end rule pathway of targeted degradation in Arabidopsis roots",
|
756
|
+
"volume" => "15")
|
757
|
+
expect(subject.container).to eq("firstPage" => "929", "identifier" => "0028-646X",
|
758
|
+
"identifierType" => "ISSN", "issue" => "3", "lastPage" => "935", "title" => "New Phytologist", "type" => "Journal", "volume" => "218")
|
759
|
+
expect(subject.provider).to eq("Crossref")
|
760
|
+
end
|
761
|
+
|
762
|
+
it "author literal" do
|
763
|
+
input = "https://doi.org/10.1038/ng.3834"
|
764
|
+
subject = described_class.new(input: input)
|
765
|
+
expect(subject.valid?).to be true
|
766
|
+
expect(subject.id).to eq("https://doi.org/10.1038/ng.3834")
|
767
|
+
expect(subject.url).to eq("https://www.nature.com/articles/ng.3834")
|
768
|
+
expect(subject.type).to eq("JournalArticle")
|
769
|
+
expect(subject.contributors.length).to eq(14)
|
770
|
+
expect(subject.contributors[1]).to eq("contributorRoles" => ["Author"], "name" => "GTEx Consortium", "type" => "Organization")
|
771
|
+
expect(subject.titles).to eq([{ "title" => "The impact of structural variation on human gene expression" }])
|
772
|
+
expect(subject.date).to include("published" => "2017-04-03")
|
773
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
|
774
|
+
"name" => "Springer Science and Business Media LLC")
|
775
|
+
expect(subject.provider).to eq("Crossref")
|
776
|
+
end
|
777
|
+
|
778
|
+
it "affiliation is space" do
|
779
|
+
input = "https://doi.org/10.1177/0042098011428175"
|
780
|
+
subject = described_class.new(input: input)
|
781
|
+
expect(subject.valid?).to be true
|
782
|
+
expect(subject.id).to eq("https://doi.org/10.1177/0042098011428175")
|
783
|
+
expect(subject.url).to eq("http://journals.sagepub.com/doi/10.1177/0042098011428175")
|
784
|
+
expect(subject.type).to eq("JournalArticle")
|
785
|
+
expect(subject.contributors.length).to eq(1)
|
786
|
+
expect(subject.contributors.first).to eq("familyName" => "Petrovici", "givenName" => "Norbert",
|
787
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
788
|
+
expect(subject.titles).to eq([{ "title" => "Workers and the City: Rethinking the Geographies of Power in Post-socialist Urbanisation" }])
|
789
|
+
expect(subject.date).to include("published" => "2011-12-22")
|
790
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/179",
|
791
|
+
"name" => "SAGE Publications")
|
792
|
+
expect(subject.provider).to eq("Crossref")
|
793
|
+
end
|
794
|
+
|
795
|
+
it "multiple issn" do
|
796
|
+
input = "https://doi.org/10.1007/978-3-642-34922-5_19"
|
786
797
|
subject = described_class.new(input: input)
|
787
798
|
# 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(
|
799
|
+
expect(subject.id).to eq("https://doi.org/10.1007/978-3-642-34922-5_19")
|
800
|
+
expect(subject.url).to eq("https://link.springer.com/10.1007/978-3-642-34922-5_19")
|
801
|
+
expect(subject.type).to eq("BookChapter")
|
802
|
+
expect(subject.contributors.length).to eq(3)
|
803
|
+
expect(subject.contributors.first).to eq("familyName" => "Razib", "givenName" => "Ali",
|
804
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
805
|
+
expect(subject.titles).to eq([{ "title" => "Log-Domain Arithmetic for High-Speed Fuzzy Control on a Field-Programmable Gate Array" }])
|
806
|
+
expect(subject.date).to include("published" => "2013")
|
807
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/297",
|
808
|
+
"name" => "Springer Science and Business Media LLC")
|
809
|
+
expect(subject.container).to eq("identifier" => "1860-0808", "identifierType" => "ISSN", "firstPage" => "269", "lastPage" => "287",
|
810
|
+
"title" => "Soft Computing: State of the Art Theory and Novel Applications", "type" => "Book")
|
811
|
+
expect(subject.provider).to eq("Crossref")
|
812
|
+
end
|
813
|
+
|
814
|
+
it "article id as page number" do
|
815
|
+
input = "https://doi.org/10.1103/physrevlett.120.117701"
|
816
|
+
subject = described_class.new(input: input)
|
817
|
+
expect(subject.valid?).to be true
|
818
|
+
expect(subject.id).to eq("https://doi.org/10.1103/physrevlett.120.117701")
|
819
|
+
expect(subject.url).to eq("https://link.aps.org/doi/10.1103/PhysRevLett.120.117701")
|
820
|
+
expect(subject.type).to eq("JournalArticle")
|
821
|
+
expect(subject.contributors.length).to eq(5)
|
822
|
+
expect(subject.contributors.first).to eq("familyName" => "Marrazzo", "givenName" => "Antimo",
|
823
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
824
|
+
expect(subject.titles).to eq([{ "title" => "Prediction of a Large-Gap and Switchable Kane-Mele Quantum Spin Hall Insulator" }])
|
825
|
+
expect(subject.date).to include("published" => "2018-03-13")
|
826
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/16",
|
827
|
+
"name" => "American Physical Society (APS)")
|
828
|
+
expect(subject.container).to eq("identifier" => "1079-7114",
|
829
|
+
"identifierType" => "ISSN", "issue" => "11", "title" => "Physical Review Letters", "type" => "Journal", "volume" => "120")
|
830
|
+
expect(subject.provider).to eq("Crossref")
|
831
|
+
end
|
832
|
+
|
833
|
+
it "posted content copernicus" do
|
834
|
+
input = "https://doi.org/10.5194/CP-2020-95"
|
835
|
+
subject = described_class.new(input: input)
|
836
|
+
expect(subject.valid?).to be true
|
837
|
+
expect(subject.url).to eq("https://cp.copernicus.org/preprints/cp-2020-95/cp-2020-95.pdf")
|
838
|
+
expect(subject.type).to eq("Article")
|
839
|
+
expect(subject.contributors.count).to eq(6)
|
840
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Shao",
|
841
|
+
"givenName" => "Jun",
|
842
|
+
"id" => "https://orcid.org/0000-0001-6130-6474")
|
843
|
+
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" }])
|
844
|
+
expect(subject.id).to eq("https://doi.org/10.5194/cp-2020-95")
|
834
845
|
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')
|
846
|
+
expect(subject.descriptions.first["description"]).to start_with("Abstract. During the early last glacial termination")
|
847
|
+
expect(subject.date).to include("published" => "2020-07-28")
|
848
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/3145",
|
849
|
+
"name" => "Copernicus GmbH")
|
850
|
+
expect(subject.provider).to eq("Crossref")
|
851
|
+
end
|
852
|
+
|
853
|
+
it "book oup" do
|
854
|
+
input = "10.1093/oxfordhb/9780198746140.013.5"
|
855
|
+
subject = described_class.new(input: input)
|
856
|
+
expect(subject.valid?).to be true
|
857
|
+
expect(subject.url).to eq("https://academic.oup.com/edited-volume/28081/chapter/212116415")
|
858
|
+
expect(subject.type).to eq("Book")
|
859
|
+
expect(subject.contributors.count).to eq(3)
|
860
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Clayton",
|
861
|
+
"givenName" => "Barbra R.")
|
862
|
+
expect(subject.contributors.last).to eq("contributorRoles" => ["Editor"], "familyName" => "Shields", "givenName" => "James Mark", "type" => "Person")
|
863
|
+
expect(subject.titles).to eq([{ "title" => "The Changing Way of the Bodhisattva" }])
|
864
|
+
expect(subject.id).to eq("https://doi.org/10.1093/oxfordhb/9780198746140.013.5")
|
856
865
|
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(
|
866
|
+
expect(subject.descriptions.first["description"]).to start_with("This chapter explores the nature of the connections")
|
867
|
+
expect(subject.date).to include("published" => "2018-04-05")
|
868
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/286",
|
869
|
+
"name" => "Oxford University Press (OUP)")
|
870
|
+
expect(subject.provider).to eq("Crossref")
|
862
871
|
end
|
863
872
|
|
864
|
-
it
|
865
|
-
input =
|
873
|
+
it "report osti" do
|
874
|
+
input = "10.2172/972169"
|
866
875
|
subject = described_class.new(input: input)
|
867
876
|
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')
|
877
|
+
expect(subject.url).to eq("http://www.osti.gov/servlets/purl/972169-1QXROM")
|
878
|
+
expect(subject.type).to eq("Report")
|
879
|
+
expect(subject.contributors.count).to eq(4)
|
880
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Denholm",
|
881
|
+
"givenName" => "P.")
|
882
|
+
expect(subject.titles).to eq([{ "title" => "Role of Energy Storage with Renewable Electricity Generation" }])
|
883
|
+
expect(subject.id).to eq("https://doi.org/10.2172/972169")
|
876
884
|
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(
|
885
|
+
expect(subject.date).to include("published" => "2010-01-01")
|
886
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/960",
|
887
|
+
"name" => "Office of Scientific and Technical Information (OSTI)")
|
888
|
+
expect(subject.provider).to eq("Crossref")
|
881
889
|
end
|
882
890
|
|
883
|
-
it
|
884
|
-
input =
|
891
|
+
it "journal issue" do
|
892
|
+
input = "https://doi.org/10.6002/ect.2015.0371"
|
885
893
|
subject = described_class.new(input: input)
|
886
894
|
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
|
-
|
895
|
+
expect(subject.errors).to eq(["property '/contributors' is invalid: error_type=minItems"])
|
896
|
+
expect(subject.id).to eq("https://doi.org/10.6002/ect.2015.0371")
|
897
|
+
expect(subject.url).to eq("http://ectrx.org/forms/ectrxcontentshow.php?doi_id=10.6002%2Fect.2015.0371")
|
898
|
+
expect(subject.type).to eq("JournalIssue")
|
899
|
+
expect(subject.contributors.empty?).to be true
|
900
|
+
expect(subject.titles).to eq([{ "title" => ":(unav)" }])
|
901
|
+
expect(subject.date).to eq("published" => "2018-10", "updated" => "2018-10-03")
|
902
|
+
expect(subject.publisher).to eq("id" => "https://api.crossref.org/members/4021",
|
903
|
+
"name" => "Baskent University")
|
895
904
|
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 =
|
905
|
+
expect(subject.references.first).to eq("containerTitle" => "Ergonomics",
|
906
|
+
"contributor" => "IMAMURA",
|
907
|
+
"doi" => "https://doi.org/10.1080/001401398186180",
|
908
|
+
"firstPage" => "1421",
|
909
|
+
"issue" => "10",
|
910
|
+
"key" => "ref0",
|
911
|
+
"publicationYear" => "1998",
|
912
|
+
"title" => "Manual performance in cold conditions while wearing NBC clothing",
|
913
|
+
"volume" => "41")
|
914
|
+
expect(subject.container).to eq("identifier" => "2146-8427", "identifierType" => "ISSN",
|
915
|
+
"issue" => "5", "title" => "Experimental and Clinical Transplantation", "type" => "Journal", "volume" => "16")
|
916
|
+
expect(subject.provider).to eq("Crossref")
|
917
|
+
end
|
918
|
+
|
919
|
+
it "not found error" do
|
920
|
+
input = "https://doi.org/10.7554/elife.01567x"
|
912
921
|
subject = described_class.new(input: input)
|
913
922
|
expect(subject.valid?).to be false
|
914
|
-
expect(subject.id).to eq(
|
915
|
-
expect(subject.provider).to eq(
|
916
|
-
expect(subject.state).to eq(
|
923
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567x")
|
924
|
+
expect(subject.provider).to eq("Crossref")
|
925
|
+
expect(subject.state).to eq("not_found")
|
917
926
|
end
|
918
927
|
end
|
919
928
|
end
|