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,948 +1,946 @@
|
|
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
|
-
context
|
7
|
-
it
|
6
|
+
context "get crossref raw" do
|
7
|
+
it "journal article" do
|
8
8
|
input = "#{fixture_path}crossref.xml"
|
9
|
-
subject = described_class.new(input: input, from:
|
9
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
10
10
|
expect(subject.raw).to eq(File.read(input).strip)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
context
|
15
|
-
it
|
16
|
-
input =
|
17
|
-
subject = described_class.new(input: input, from:
|
18
|
-
# expect(subject.valid?).to be true
|
19
|
-
expect(subject.id).to eq(
|
20
|
-
expect(subject.alternate_identifiers).to eq([{
|
21
|
-
|
22
|
-
expect(subject.type).to eq(
|
23
|
-
expect(subject.url).to eq(
|
24
|
-
expect(subject.
|
25
|
-
expect(subject.
|
26
|
-
|
27
|
-
expect(subject.license).to eq(
|
28
|
-
|
29
|
-
expect(subject.titles).to eq([{
|
30
|
-
expect(subject.date).to eq(
|
31
|
-
|
32
|
-
|
33
|
-
expect(subject.publisher).to eq(
|
34
|
-
expect(subject.container).to eq(
|
35
|
-
|
14
|
+
context "get crossref metadata" do
|
15
|
+
it "DOI with data citation" do
|
16
|
+
input = "10.7554/eLife.01567"
|
17
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
18
|
+
# expect(subject.valid?).to be true
|
19
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
20
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "e01567",
|
21
|
+
"alternateIdentifierType" => "article_number" }])
|
22
|
+
expect(subject.type).to eq("JournalArticle")
|
23
|
+
expect(subject.url).to eq("https://elifesciences.org/articles/01567")
|
24
|
+
expect(subject.contributors.length).to eq(5)
|
25
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
26
|
+
"givenName" => "Martial", "familyName" => "Sankar", "affiliation" => [{ "name" => "Department of Plant Molecular Biology, University of Lausanne, Lausanne, Switzerland" }])
|
27
|
+
expect(subject.license).to eq("id" => "CC-BY-3.0",
|
28
|
+
"url" => "https://creativecommons.org/licenses/by/3.0/legalcode")
|
29
|
+
expect(subject.titles).to eq([{ "title" => "Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth" }])
|
30
|
+
expect(subject.date).to eq("published" => "2014-02-11",
|
31
|
+
"registered" => "2018-08-23",
|
32
|
+
"updated" => "2022-03-26")
|
33
|
+
expect(subject.publisher).to eq("name" => "eLife Sciences Publications, Ltd")
|
34
|
+
expect(subject.container).to eq("firstPage" => "e01567", "identifier" => "2050-084X",
|
35
|
+
"identifierType" => "ISSN", "title" => "eLife", "type" => "Journal", "volume" => "3")
|
36
36
|
expect(subject.references.length).to eq(27)
|
37
|
-
expect(subject.references.last).to eq(
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
expect(subject.funding_references).to eq([{
|
46
|
-
{
|
47
|
-
|
48
|
-
|
49
|
-
{
|
50
|
-
|
51
|
-
|
52
|
-
{
|
53
|
-
|
54
|
-
|
55
|
-
expect(subject.provider).to eq(
|
56
|
-
end
|
57
|
-
|
58
|
-
it
|
59
|
-
input =
|
60
|
-
subject = described_class.new(input: input, from:
|
61
|
-
# expect(subject.valid?).to be true
|
62
|
-
expect(subject.id).to eq(
|
63
|
-
expect(subject.url).to eq(
|
64
|
-
expect(subject.type).to eq(
|
65
|
-
expect(subject.
|
66
|
-
expect(subject.
|
67
|
-
|
68
|
-
expect(subject.contributors).to eq(
|
69
|
-
|
70
|
-
expect(subject.titles).to eq([{
|
71
|
-
expect(subject.license).to eq(
|
72
|
-
|
73
|
-
expect(subject.date).to eq(
|
74
|
-
|
75
|
-
|
76
|
-
expect(subject.publisher).to eq(
|
37
|
+
expect(subject.references.last).to eq("containerTitle" => "Nature Cell Biology",
|
38
|
+
"contributor" => "Yin",
|
39
|
+
"doi" => "https://doi.org/10.1038/ncb2764",
|
40
|
+
"firstPage" => "860",
|
41
|
+
"key" => "bib27",
|
42
|
+
"publicationYear" => "2013",
|
43
|
+
"title" => "A screen for morphological complexity identifies regulators of switch-like transitions between discrete cell shapes",
|
44
|
+
"volume" => "15")
|
45
|
+
expect(subject.funding_references).to eq([{ "funderName" => "SystemsX" },
|
46
|
+
{ "funderIdentifier" => "https://doi.org/10.13039/501100003043",
|
47
|
+
"funderIdentifierType" => "Crossref Funder ID",
|
48
|
+
"funderName" => "EMBO" },
|
49
|
+
{ "funderIdentifier" => "https://doi.org/10.13039/501100001711",
|
50
|
+
"funderIdentifierType" => "Crossref Funder ID",
|
51
|
+
"funderName" => "Swiss National Science Foundation" },
|
52
|
+
{ "funderIdentifier" => "https://doi.org/10.13039/501100006390",
|
53
|
+
"funderIdentifierType" => "Crossref Funder ID",
|
54
|
+
"funderName" => "University of Lausanne" }])
|
55
|
+
expect(subject.provider).to eq("Crossref")
|
56
|
+
end
|
57
|
+
|
58
|
+
it "journal article" do
|
59
|
+
input = "https://doi.org/10.1371/journal.pone.0000030"
|
60
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
61
|
+
# expect(subject.valid?).to be true
|
62
|
+
expect(subject.id).to eq("https://doi.org/10.1371/journal.pone.0000030")
|
63
|
+
expect(subject.url).to eq("https://dx.plos.org/10.1371/journal.pone.0000030")
|
64
|
+
expect(subject.type).to eq("JournalArticle")
|
65
|
+
expect(subject.contributors.length).to eq(6)
|
66
|
+
expect(subject.contributors.first).to eq("givenName" => "Markus", "familyName" => "Ralser",
|
67
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
68
|
+
expect(subject.contributors.last).to eq({ "contributorRoles" => ["Editor"], "familyName" => "Janbon",
|
69
|
+
"givenName" => "Guilhem", "type" => "Person" })
|
70
|
+
expect(subject.titles).to eq([{ "title" => "Triose Phosphate Isomerase Deficiency Is Caused by Altered Dimerization–Not Catalytic Inactivity–of the Mutant Enzymes" }])
|
71
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
72
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
73
|
+
expect(subject.date).to eq("published" => "2006-12-20",
|
74
|
+
"registered" => "2016-12-31",
|
75
|
+
"updated" => "2021-08-06")
|
76
|
+
expect(subject.publisher).to eq("name" => "Public Library of Science (PLoS)")
|
77
77
|
expect(subject.references.length).to eq(73)
|
78
|
-
expect(subject.references.last).to eq(
|
79
|
-
|
80
|
-
|
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, from:
|
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
|
-
|
106
|
-
|
107
|
-
expect(subject.publisher).to eq(
|
108
|
-
expect(subject.funding_references).to eq([{
|
109
|
-
|
78
|
+
expect(subject.references.last).to eq("containerTitle" => "N Engl J Med",
|
79
|
+
"contributor" => "KB Hammond",
|
80
|
+
"doi" => "https://doi.org/10.1056/nejm199109123251104",
|
81
|
+
"firstPage" => "769",
|
82
|
+
"key" => "ref73",
|
83
|
+
"publicationYear" => "1991",
|
84
|
+
"title" => "Efficacy of statewide neonatal screening for cystic fibrosis by assay of trypsinogen concentrations.",
|
85
|
+
"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 = "https://doi.org/10.3389/fpls.2019.00816"
|
93
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
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", "contributorRoles" => ["Author"], "familyName" => "Fortes",
|
100
|
+
"givenName" => "Ana Margarida")
|
101
|
+
expect(subject.titles).to eq([{ "title" => "Transcriptional Modulation of Polyamine Metabolism in Fruit Species Under Abiotic and Biotic Stress" }])
|
102
|
+
expect(subject.license).to eq("id" => "CC-BY-4.0",
|
103
|
+
"url" => "https://creativecommons.org/licenses/by/4.0/legalcode")
|
104
|
+
expect(subject.date).to eq("published" => "2019-07-02",
|
105
|
+
"registered" => "2019-07-02",
|
106
|
+
"updated" => "2019-09-22")
|
107
|
+
expect(subject.publisher).to eq("name" => "Frontiers Media SA")
|
108
|
+
expect(subject.funding_references).to eq([{ "awardNumber" => "CA17111",
|
109
|
+
"funderIdentifier" => "https://doi.org/10.13039/501100000921", "funderIdentifierType" => "Crossref Funder ID", "funderName" => "COST (European Cooperation in Science and Technology)" }])
|
110
110
|
expect(subject.references.length).to eq(70)
|
111
|
-
expect(subject.references.last).to eq(
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
expect(subject.container).to eq(
|
120
|
-
|
121
|
-
expect(subject.provider).to eq(
|
122
|
-
end
|
123
|
-
|
124
|
-
it
|
125
|
-
input =
|
126
|
-
subject = described_class.new(input: input, from:
|
127
|
-
# expect(subject.valid?).to be true
|
128
|
-
expect(subject.id).to eq(
|
129
|
-
expect(subject.url).to eq(
|
130
|
-
expect(subject.type).to eq(
|
131
|
-
expect(subject.
|
132
|
-
expect(subject.titles).to eq([{
|
133
|
-
expect(subject.date).to include(
|
134
|
-
|
135
|
-
|
136
|
-
expect(subject.publisher).to eq(
|
111
|
+
expect(subject.references.last).to eq("containerTitle" => "Acta Hortic.",
|
112
|
+
"contributor" => "Zheng",
|
113
|
+
"doi" => "https://doi.org/10.17660/actahortic.2004.632.41",
|
114
|
+
"firstPage" => "317",
|
115
|
+
"key" => "ref70",
|
116
|
+
"publicationYear" => "2004",
|
117
|
+
"title" => "Effects of polyamines and salicylic acid on postharvest storage of “Ponkan” mandarin",
|
118
|
+
"volume" => "632")
|
119
|
+
expect(subject.container).to eq("firstPage" => "816", "identifier" => "1664-462X",
|
120
|
+
"identifierType" => "ISSN", "title" => "Frontiers in Plant Science", "type" => "Journal", "volume" => "10")
|
121
|
+
expect(subject.provider).to eq("Crossref")
|
122
|
+
end
|
123
|
+
|
124
|
+
it "journal article original language title" do
|
125
|
+
input = "https://doi.org/10.7600/jspfsm.56.60"
|
126
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
127
|
+
# expect(subject.valid?).to be true
|
128
|
+
expect(subject.id).to eq("https://doi.org/10.7600/jspfsm.56.60")
|
129
|
+
expect(subject.url).to eq("https://www.jstage.jst.go.jp/article/jspfsm/56/1/56_1_60/_article/-char/ja")
|
130
|
+
expect(subject.type).to eq("JournalArticle")
|
131
|
+
expect(subject.contributors).to eq([{ "name" => ":(unav)", "type" => "Organization", "contributorRoles" => ["Author"] }])
|
132
|
+
expect(subject.titles).to eq([{ "lang" => "ja", "title" => "自律神経・循環器応答" }])
|
133
|
+
expect(subject.date).to include("published" => "2007",
|
134
|
+
"registered" => "2013-09-10",
|
135
|
+
"updated" => "2021-05-20")
|
136
|
+
expect(subject.publisher).to eq("name" => "The Japanese Society of Physical Fitness and Sports Medicine")
|
137
137
|
expect(subject.references.length).to eq(7)
|
138
|
-
expect(subject.references.first).to eq(
|
139
|
-
|
140
|
-
expect(subject.container).to eq(
|
141
|
-
|
142
|
-
expect(subject.provider).to eq(
|
143
|
-
end
|
144
|
-
|
145
|
-
it
|
146
|
-
input =
|
147
|
-
subject = described_class.new(input: input, from:
|
148
|
-
# expect(subject.valid?).to be true
|
149
|
-
expect(subject.id).to eq(
|
150
|
-
expect(subject.url).to eq(
|
151
|
-
expect(subject.type).to eq(
|
152
|
-
expect(subject.
|
153
|
-
expect(subject.
|
154
|
-
|
155
|
-
expect(subject.titles).to eq([{
|
156
|
-
expect(subject.date).to include(
|
157
|
-
expect(subject.publisher).to eq(
|
138
|
+
expect(subject.references.first).to eq("doi" => "https://doi.org/10.1111/j.1469-7793.2000.00407.x",
|
139
|
+
"key" => "1")
|
140
|
+
expect(subject.container).to eq("firstPage" => "60", "identifier" => "1881-4751",
|
141
|
+
"identifierType" => "ISSN", "issue" => "1", "lastPage" => "60", "title" => "Japanese Journal of Physical Fitness and Sports Medicine", "type" => "Journal", "volume" => "56")
|
142
|
+
expect(subject.provider).to eq("Crossref")
|
143
|
+
end
|
144
|
+
|
145
|
+
it "journal article with RDF for container" do
|
146
|
+
input = "https://doi.org/10.1163/1937240X-00002096"
|
147
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
148
|
+
# expect(subject.valid?).to be true
|
149
|
+
expect(subject.id).to eq("https://doi.org/10.1163/1937240x-00002096")
|
150
|
+
expect(subject.url).to eq("https://academic.oup.com/jcb/article-lookup/doi/10.1163/1937240X-00002096")
|
151
|
+
expect(subject.type).to eq("JournalArticle")
|
152
|
+
expect(subject.contributors.length).to eq(8)
|
153
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Mesquita-Joanes",
|
154
|
+
"givenName" => "Francesc")
|
155
|
+
expect(subject.titles).to eq([{ "title" => "Global distribution of Fabaeformiscandona subacuta: an exotic invasive Ostracoda on the Iberian Peninsula?" }])
|
156
|
+
expect(subject.date).to include("registered" => "2015-09-25", "updated" => "2019-07-05")
|
157
|
+
expect(subject.publisher).to eq("name" => "Oxford University Press (OUP)")
|
158
158
|
expect(subject.references.length).to eq(111)
|
159
|
-
expect(subject.references.last).to eq(
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
expect(subject.container).to eq(
|
166
|
-
|
167
|
-
expect(subject.provider).to eq(
|
168
|
-
end
|
169
|
-
|
170
|
-
it
|
171
|
-
input =
|
172
|
-
subject = described_class.new(input: input, from:
|
173
|
-
# expect(subject.valid?).to be true
|
174
|
-
expect(subject.id).to eq(
|
175
|
-
expect(subject.url).to eq(
|
176
|
-
expect(subject.type).to eq(
|
177
|
-
expect(subject.
|
178
|
-
expect(subject.
|
179
|
-
|
180
|
-
expect(subject.titles).to eq([{
|
181
|
-
expect(subject.date).to eq(
|
182
|
-
|
183
|
-
|
184
|
-
expect(subject.publisher).to eq(
|
159
|
+
expect(subject.references.last).to eq("contributor" => "Zenina",
|
160
|
+
"firstPage" => "156",
|
161
|
+
"key" => "bibr111",
|
162
|
+
"publicationYear" => "2008",
|
163
|
+
"title" => "Ostracod assemblages of the freshened part of Amursky Bay and lower reaches of Razdolnaya River (Sea of Japan)",
|
164
|
+
"volume" => "Vol. 1")
|
165
|
+
expect(subject.container).to eq("firstPage" => "949", "identifier" => "1937-240X",
|
166
|
+
"identifierType" => "ISSN", "issue" => "6", "lastPage" => "961", "title" => "Journal of Crustacean Biology", "type" => "Journal", "volume" => "32")
|
167
|
+
expect(subject.provider).to eq("Crossref")
|
168
|
+
end
|
169
|
+
|
170
|
+
it "book chapter with RDF for container" do
|
171
|
+
input = "10.1007/978-3-642-33191-6_49"
|
172
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
173
|
+
# expect(subject.valid?).to be true
|
174
|
+
expect(subject.id).to eq("https://doi.org/10.1007/978-3-642-33191-6_49")
|
175
|
+
expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-642-33191-6_49")
|
176
|
+
expect(subject.type).to eq("BookChapter")
|
177
|
+
expect(subject.contributors.length).to eq(3)
|
178
|
+
expect(subject.contributors.first).to eq("familyName" => "Chen", "givenName" => "Lili",
|
179
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
180
|
+
expect(subject.titles).to eq([{ "title" => "Human Body Orientation Estimation in Multiview Scenarios" }])
|
181
|
+
expect(subject.date).to eq("published" => "2012",
|
182
|
+
"registered" => "2012-08-21",
|
183
|
+
"updated" => "2020-11-24")
|
184
|
+
expect(subject.publisher).to eq("name" => "Springer Science and Business Media LLC")
|
185
185
|
expect(subject.references.length).to eq(11)
|
186
|
-
expect(subject.references.first).to eq(
|
187
|
-
expect(subject.container).to eq(
|
188
|
-
|
189
|
-
expect(subject.provider).to eq(
|
190
|
-
end
|
191
|
-
|
192
|
-
it
|
193
|
-
input =
|
194
|
-
subject = described_class.new(input: input, from:
|
195
|
-
# expect(subject.valid?).to be true
|
196
|
-
expect(subject.url).to eq(
|
197
|
-
expect(subject.type).to eq(
|
198
|
-
expect(subject.
|
199
|
-
expect(subject.
|
200
|
-
|
201
|
-
|
202
|
-
expect(subject.titles).to eq([{
|
203
|
-
expect(subject.id).to eq(
|
204
|
-
expect(subject.alternate_identifiers).to eq([{
|
205
|
-
|
206
|
-
expect(subject.descriptions.first[
|
207
|
-
expect(subject.date).to include(
|
208
|
-
|
209
|
-
|
210
|
-
expect(subject.publisher).to eq(
|
211
|
-
expect(subject.provider).to eq(
|
212
|
-
end
|
213
|
-
|
214
|
-
it
|
215
|
-
input =
|
216
|
-
subject = described_class.new(input: input, from:
|
217
|
-
# expect(subject.valid?).to be true
|
218
|
-
expect(subject.id).to eq(
|
219
|
-
expect(subject.url).to eq(
|
220
|
-
expect(subject.type).to eq(
|
221
|
-
expect(subject.
|
222
|
-
expect(subject.
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
expect(subject.titles).to eq([{
|
186
|
+
expect(subject.references.first).to eq("key" => "49_CR1")
|
187
|
+
expect(subject.container).to eq("identifier" => "1611-3349", "identifierType" => "ISSN",
|
188
|
+
"title" => "Lecture Notes in Computer Science", "type" => "Book Series")
|
189
|
+
expect(subject.provider).to eq("Crossref")
|
190
|
+
end
|
191
|
+
|
192
|
+
it "posted_content" do
|
193
|
+
input = "https://doi.org/10.1101/097196"
|
194
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
195
|
+
# expect(subject.valid?).to be true
|
196
|
+
expect(subject.url).to eq("http://biorxiv.org/lookup/doi/10.1101/097196")
|
197
|
+
expect(subject.type).to eq("Article")
|
198
|
+
expect(subject.contributors.count).to eq(11)
|
199
|
+
expect(subject.contributors.last).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
200
|
+
"id" => "https://orcid.org/0000-0003-4060-7360",
|
201
|
+
"givenName" => "Timothy", "familyName" => "Clark")
|
202
|
+
expect(subject.titles).to eq([{ "title" => "A Data Citation Roadmap for Scholarly Data Repositories" }])
|
203
|
+
expect(subject.id).to eq("https://doi.org/10.1101/097196")
|
204
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "biorxiv;097196v2",
|
205
|
+
"alternateIdentifierType" => "pisa" }])
|
206
|
+
expect(subject.descriptions.first["description"]).to start_with("This article presents a practical roadmap")
|
207
|
+
expect(subject.date).to include("published" => "2017-10-09",
|
208
|
+
"registered" => "2019-07-16",
|
209
|
+
"updated" => "2020-01-18")
|
210
|
+
expect(subject.publisher).to eq("name" => "Cold Spring Harbor Laboratory")
|
211
|
+
expect(subject.provider).to eq("Crossref")
|
212
|
+
end
|
213
|
+
|
214
|
+
it "peer review" do
|
215
|
+
input = "https://doi.org/10.7554/elife.55167.sa2"
|
216
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
217
|
+
# expect(subject.valid?).to be true
|
218
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.55167.sa2")
|
219
|
+
expect(subject.url).to eq("https://elifesciences.org/articles/55167#sa2")
|
220
|
+
expect(subject.type).to eq("PeerReview")
|
221
|
+
expect(subject.contributors.count).to eq(8)
|
222
|
+
expect(subject.contributors.last).to eq("affiliation" => [{ "name" => "Center for Computational Mathematics, Flatiron Institute, New York, United States" }],
|
223
|
+
"familyName" => "Barnett",
|
224
|
+
"givenName" => "Alex H",
|
225
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
226
|
+
expect(subject.titles).to eq([{ "title" => "Author response: SpikeForest, reproducible web-facing ground-truth validation of automated neural spike sorters" }])
|
227
227
|
expect(subject.alternate_identifiers.empty?).to be(true)
|
228
228
|
expect(subject.descriptions.empty?).to be(true)
|
229
|
-
expect(subject.date).to include(
|
230
|
-
expect(subject.publisher).to eq(
|
231
|
-
expect(subject.provider).to eq(
|
232
|
-
end
|
233
|
-
|
234
|
-
it
|
235
|
-
input =
|
236
|
-
subject = described_class.new(input: input, from:
|
237
|
-
# expect(subject.valid?).to be true
|
238
|
-
expect(subject.url).to eq(
|
239
|
-
expect(subject.type).to eq(
|
240
|
-
expect(subject.
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
expect(subject.titles).to eq([{
|
245
|
-
expect(subject.id).to eq(
|
229
|
+
expect(subject.date).to include("registered" => "2020-05-19", "updated" => "2020-05-19")
|
230
|
+
expect(subject.publisher).to eq("name" => "eLife Sciences Publications, Ltd")
|
231
|
+
expect(subject.provider).to eq("Crossref")
|
232
|
+
end
|
233
|
+
|
234
|
+
it "dissertation" do
|
235
|
+
input = "https://doi.org/10.14264/uql.2020.791"
|
236
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
237
|
+
# expect(subject.valid?).to be true
|
238
|
+
expect(subject.url).to eq("http://espace.library.uq.edu.au/view/UQ:23a1e74")
|
239
|
+
expect(subject.type).to eq("Dissertation")
|
240
|
+
expect(subject.contributors).to eq([{ "familyName" => "Collingwood",
|
241
|
+
"givenName" => "Patricia Maree",
|
242
|
+
"id" => "https://orcid.org/0000-0003-3086-4443",
|
243
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
244
|
+
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" }])
|
245
|
+
expect(subject.id).to eq("https://doi.org/10.14264/uql.2020.791")
|
246
246
|
expect(subject.alternate_identifiers.empty?).to be(true)
|
247
247
|
expect(subject.descriptions.empty?).to be(true)
|
248
|
-
expect(subject.date).to eq(
|
249
|
-
expect(subject.publisher).to eq(
|
250
|
-
expect(subject.provider).to eq(
|
251
|
-
end
|
252
|
-
|
253
|
-
it
|
254
|
-
input =
|
255
|
-
subject = described_class.new(input: input, from:
|
256
|
-
# expect(subject.valid?).to be true
|
257
|
-
expect(subject.id).to eq(
|
258
|
-
expect(subject.url).to eq(
|
259
|
-
expect(subject.type).to eq(
|
260
|
-
expect(subject.
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
expect(subject.license).to eq(
|
265
|
-
expect(subject.titles).to eq([{
|
266
|
-
expect(subject.date).to eq(
|
267
|
-
|
268
|
-
|
269
|
-
expect(subject.publisher).to eq(
|
248
|
+
expect(subject.date).to eq("updated" => "2020-06-08")
|
249
|
+
expect(subject.publisher).to eq("name" => "University of Queensland Library")
|
250
|
+
expect(subject.provider).to eq("Crossref")
|
251
|
+
end
|
252
|
+
|
253
|
+
it "DOI with SICI DOI" do
|
254
|
+
input = "https://doi.org/10.1890/0012-9658(2006)87[2832:tiopma]2.0.co;2"
|
255
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
256
|
+
# expect(subject.valid?).to be true
|
257
|
+
expect(subject.id).to eq("https://doi.org/10.1890/0012-9658(2006)87%255b2832:tiopma%255d2.0.co;2")
|
258
|
+
expect(subject.url).to eq("http://doi.wiley.com/10.1890/0012-9658(2006)87%5B2832:TIOPMA%5D2.0.CO;2")
|
259
|
+
expect(subject.type).to eq("JournalArticle")
|
260
|
+
expect(subject.contributors).to eq([
|
261
|
+
{ "type" => "Person", "contributorRoles" => ["Author"], "givenName" => "A.",
|
262
|
+
"familyName" => "Fenton" }, { "type" => "Person", "contributorRoles" => ["Author"], "givenName" => "S. A.", "familyName" => "Rands" },
|
263
|
+
])
|
264
|
+
expect(subject.license).to eq("url" => "http://doi.wiley.com/10.1002/tdm_license_1.1")
|
265
|
+
expect(subject.titles).to eq([{ "title" => "THE IMPACT OF PARASITE MANIPULATION AND PREDATOR FORAGING BEHAVIOR ON PREDATOR–PREY COMMUNITIES" }])
|
266
|
+
expect(subject.date).to eq("published" => "2006-11",
|
267
|
+
"registered" => "2011-02-20",
|
268
|
+
"updated" => "2019-04-28")
|
269
|
+
expect(subject.publisher).to eq("name" => "Wiley")
|
270
270
|
expect(subject.references.length).to eq(39)
|
271
|
-
expect(subject.references.last).to eq(
|
272
|
-
expect(subject.container).to eq(
|
273
|
-
|
274
|
-
expect(subject.provider).to eq(
|
275
|
-
end
|
276
|
-
|
277
|
-
it
|
278
|
-
input =
|
279
|
-
subject = described_class.new(input: input, from:
|
280
|
-
# expect(subject.valid?).to be true
|
281
|
-
expect(subject.id).to eq(
|
282
|
-
expect(subject.url).to eq(
|
283
|
-
expect(subject.type).to eq(
|
284
|
-
expect(subject.
|
285
|
-
expect(subject.
|
286
|
-
|
287
|
-
|
288
|
-
expect(subject.license).to eq(
|
289
|
-
|
290
|
-
expect(subject.titles).to eq([{
|
291
|
-
expect(subject.date).to include(
|
292
|
-
|
293
|
-
|
294
|
-
expect(subject.publisher).to eq(
|
271
|
+
expect(subject.references.last).to eq("key" => "i0012-9658-87-11-2832-ydenberg1")
|
272
|
+
expect(subject.container).to eq("firstPage" => "2832", "identifier" => "0012-9658",
|
273
|
+
"identifierType" => "ISSN", "issue" => "11", "lastPage" => "2841", "title" => "Ecology", "type" => "Journal", "volume" => "87")
|
274
|
+
expect(subject.provider).to eq("Crossref")
|
275
|
+
end
|
276
|
+
|
277
|
+
it "DOI with ORCID ID" do
|
278
|
+
input = "https://doi.org/10.1155/2012/291294"
|
279
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
280
|
+
# expect(subject.valid?).to be true
|
281
|
+
expect(subject.id).to eq("https://doi.org/10.1155/2012/291294")
|
282
|
+
expect(subject.url).to eq("http://www.hindawi.com/journals/pm/2012/291294")
|
283
|
+
expect(subject.type).to eq("JournalArticle")
|
284
|
+
expect(subject.contributors.length).to eq(7)
|
285
|
+
expect(subject.contributors[2]).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
286
|
+
"id" => "https://orcid.org/0000-0003-2043-4925",
|
287
|
+
"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" }])
|
288
|
+
expect(subject.license).to eq("id" => "CC-BY-3.0",
|
289
|
+
"url" => "https://creativecommons.org/licenses/by/3.0/legalcode")
|
290
|
+
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" }])
|
291
|
+
expect(subject.date).to include("published" => "2012",
|
292
|
+
"registered" => "2016-08-02",
|
293
|
+
"updated" => "2016-08-02")
|
294
|
+
expect(subject.publisher).to eq("name" => "Hindawi Limited")
|
295
295
|
expect(subject.references.length).to eq(27)
|
296
|
-
expect(subject.references.last).to eq(
|
297
|
-
|
298
|
-
expect(subject.container).to eq(
|
299
|
-
|
300
|
-
expect(subject.provider).to eq(
|
301
|
-
end
|
302
|
-
|
303
|
-
it
|
304
|
-
input =
|
305
|
-
subject = described_class.new(input: input, from:
|
306
|
-
# expect(subject.valid?).to be true
|
307
|
-
expect(subject.id).to eq(
|
308
|
-
expect(subject.alternate_identifiers).to eq([{
|
309
|
-
|
310
|
-
expect(subject.url).to eq(
|
311
|
-
expect(subject.type).to eq(
|
312
|
-
expect(subject.
|
313
|
-
expect(subject.
|
314
|
-
|
315
|
-
expect(subject.titles).to eq([{
|
316
|
-
expect(subject.date).to include(
|
317
|
-
|
318
|
-
|
319
|
-
expect(subject.publisher).to eq(
|
296
|
+
expect(subject.references.last).to eq("doi" => "https://doi.org/10.1378/chest.12-0045",
|
297
|
+
"key" => "30")
|
298
|
+
expect(subject.container).to eq("firstPage" => "1", "identifier" => "2090-1844",
|
299
|
+
"identifierType" => "ISSN", "lastPage" => "7", "title" => "Pulmonary Medicine", "type" => "Journal", "volume" => "2012")
|
300
|
+
expect(subject.provider).to eq("Crossref")
|
301
|
+
end
|
302
|
+
|
303
|
+
it "date in future" do
|
304
|
+
input = "https://doi.org/10.1016/j.ejphar.2015.03.018"
|
305
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
306
|
+
# expect(subject.valid?).to be true
|
307
|
+
expect(subject.id).to eq("https://doi.org/10.1016/j.ejphar.2015.03.018")
|
308
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "S0014299915002332",
|
309
|
+
"alternateIdentifierType" => "sequence-number" }])
|
310
|
+
expect(subject.url).to eq("https://linkinghub.elsevier.com/retrieve/pii/S0014299915002332")
|
311
|
+
expect(subject.type).to eq("JournalArticle")
|
312
|
+
expect(subject.contributors.length).to eq(10)
|
313
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
314
|
+
"givenName" => "Sarah E.", "familyName" => "Beck")
|
315
|
+
expect(subject.titles).to eq([{ "title" => "Paving the path to HIV neurotherapy: Predicting SIV CNS disease" }])
|
316
|
+
expect(subject.date).to include("published" => "2015-07",
|
317
|
+
"registered" => "2016-08-16",
|
318
|
+
"updated" => "2020-08-31")
|
319
|
+
expect(subject.publisher).to eq("name" => "Elsevier BV")
|
320
320
|
expect(subject.references.length).to eq(98)
|
321
|
-
expect(subject.references.last).to eq(
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
expect(subject.container).to eq(
|
330
|
-
|
331
|
-
expect(subject.provider).to eq(
|
332
|
-
end
|
333
|
-
|
334
|
-
it
|
335
|
-
input =
|
336
|
-
subject = described_class.new(input: input, from:
|
337
|
-
# expect(subject.valid?).to be true
|
338
|
-
expect(subject.id).to eq(
|
339
|
-
expect(subject.url).to eq(
|
340
|
-
expect(subject.type).to eq(
|
341
|
-
expect(subject.
|
342
|
-
expect(subject.
|
343
|
-
|
344
|
-
expect(subject.titles).to eq([{
|
345
|
-
expect(subject.date).to include(
|
346
|
-
|
347
|
-
|
348
|
-
expect(subject.publisher).to eq(
|
321
|
+
expect(subject.references.last).to eq("containerTitle" => "HIV Med.",
|
322
|
+
"contributor" => "Zoufaly",
|
323
|
+
"doi" => "https://doi.org/10.1111/hiv.12134",
|
324
|
+
"firstPage" => "449",
|
325
|
+
"key" => "10.1016/j.ejphar.2015.03.018_bib94",
|
326
|
+
"publicationYear" => "2014",
|
327
|
+
"title" => "Immune activation despite suppressive highly active antiretroviral therapy is associated with higher risk of viral blips in HIV-1-infected individuals",
|
328
|
+
"volume" => "15")
|
329
|
+
expect(subject.container).to eq("firstPage" => "303", "identifier" => "0014-2999",
|
330
|
+
"identifierType" => "ISSN", "lastPage" => "312", "title" => "European Journal of Pharmacology", "type" => "Journal", "volume" => "759")
|
331
|
+
expect(subject.provider).to eq("Crossref")
|
332
|
+
end
|
333
|
+
|
334
|
+
it "vor with url" do
|
335
|
+
input = "https://doi.org/10.1038/hdy.2013.26"
|
336
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
337
|
+
# expect(subject.valid?).to be true
|
338
|
+
expect(subject.id).to eq("https://doi.org/10.1038/hdy.2013.26")
|
339
|
+
expect(subject.url).to eq("https://www.nature.com/articles/hdy201326")
|
340
|
+
expect(subject.type).to eq("JournalArticle")
|
341
|
+
expect(subject.contributors.length).to eq(2)
|
342
|
+
expect(subject.contributors.first).to eq("familyName" => "Gross", "givenName" => "J B",
|
343
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
344
|
+
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" }])
|
345
|
+
expect(subject.date).to include("published" => "2013-04-10",
|
346
|
+
"registered" => "2019-04-16",
|
347
|
+
"updated" => "2023-05-18")
|
348
|
+
expect(subject.publisher).to eq("name" => "Springer Science and Business Media LLC")
|
349
349
|
expect(subject.references.size).to eq(41)
|
350
|
-
expect(subject.references.last).to eq(
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
expect(subject.container).to eq(
|
358
|
-
|
359
|
-
expect(subject.provider).to eq(
|
360
|
-
end
|
361
|
-
|
362
|
-
it
|
363
|
-
input =
|
364
|
-
subject = described_class.new(input: input, from:
|
365
|
-
# expect(subject.valid?).to be true
|
366
|
-
expect(subject.id).to eq(
|
367
|
-
expect(subject.url).to eq(
|
368
|
-
expect(subject.type).to eq(
|
369
|
-
expect(subject.
|
370
|
-
expect(subject.
|
371
|
-
|
372
|
-
expect(subject.titles).to eq([{
|
373
|
-
expect(subject.descriptions).to eq([{
|
374
|
-
|
375
|
-
expect(subject.date).to include(
|
376
|
-
|
377
|
-
|
378
|
-
expect(subject.publisher).to eq(
|
379
|
-
expect(subject.provider).to eq(
|
380
|
-
end
|
381
|
-
|
382
|
-
it
|
383
|
-
input =
|
384
|
-
subject = described_class.new(input: input, from:
|
385
|
-
# expect(subject.valid?).to be true
|
386
|
-
expect(subject.id).to eq(
|
387
|
-
expect(subject.url).to eq(
|
388
|
-
expect(subject.type).to eq(
|
389
|
-
expect(subject.
|
390
|
-
expect(subject.titles).to eq([{
|
350
|
+
expect(subject.references.last).to eq("containerTitle" => "Biol J Linn Soc",
|
351
|
+
"contributor" => "H Wilkens",
|
352
|
+
"doi" => "https://doi.org/10.1111/j.1095-8312.2003.00230.x",
|
353
|
+
"firstPage" => "545",
|
354
|
+
"key" => "BFhdy201326_CR41",
|
355
|
+
"publicationYear" => "2003",
|
356
|
+
"volume" => "80")
|
357
|
+
expect(subject.container).to eq("firstPage" => "122", "identifier" => "1365-2540",
|
358
|
+
"identifierType" => "ISSN", "issue" => "2", "lastPage" => "130", "title" => "Heredity", "type" => "Journal", "volume" => "111")
|
359
|
+
expect(subject.provider).to eq("Crossref")
|
360
|
+
end
|
361
|
+
|
362
|
+
it "dataset" do
|
363
|
+
input = "10.2210/pdb4hhb/pdb"
|
364
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
365
|
+
# expect(subject.valid?).to be true
|
366
|
+
expect(subject.id).to eq("https://doi.org/10.2210/pdb4hhb/pdb")
|
367
|
+
expect(subject.url).to eq("https://www.wwpdb.org/pdb?id=pdb_00004hhb")
|
368
|
+
expect(subject.type).to eq("Other")
|
369
|
+
expect(subject.contributors.length).to eq(2)
|
370
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
371
|
+
"givenName" => "G.", "familyName" => "Fermi")
|
372
|
+
expect(subject.titles).to eq([{ "title" => "THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT 1.74 ANGSTROMS RESOLUTION" }])
|
373
|
+
expect(subject.descriptions).to eq([{ "description" => "x-ray diffraction structure",
|
374
|
+
"descriptionType" => "Other" }])
|
375
|
+
expect(subject.date).to include("published" => "1984-07-17",
|
376
|
+
"registered" => "2023-03-14",
|
377
|
+
"updated" => "2023-03-14")
|
378
|
+
expect(subject.publisher).to eq("name" => "Worldwide Protein Data Bank")
|
379
|
+
expect(subject.provider).to eq("Crossref")
|
380
|
+
end
|
381
|
+
|
382
|
+
it "component" do
|
383
|
+
input = "10.1371/journal.pmed.0030277.g001"
|
384
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
385
|
+
# expect(subject.valid?).to be true
|
386
|
+
expect(subject.id).to eq("https://doi.org/10.1371/journal.pmed.0030277.g001")
|
387
|
+
expect(subject.url).to eq("https://dx.plos.org/10.1371/journal.pmed.0030277.g001")
|
388
|
+
expect(subject.type).to eq("Other")
|
389
|
+
expect(subject.contributors).to eq([{ "name" => ":(unav)", "type" => "Organization", "contributorRoles" => ["Author"] }])
|
390
|
+
expect(subject.titles).to eq([{ "title" => ":(unav)" }])
|
391
391
|
expect(subject.descriptions.empty?).to be(true)
|
392
|
-
expect(subject.date).to eq(
|
393
|
-
expect(subject.publisher).to eq(
|
394
|
-
expect(subject.provider).to eq(
|
392
|
+
expect(subject.date).to eq("registered" => "2015-10-16", "updated" => "2018-10-19")
|
393
|
+
expect(subject.publisher).to eq("name" => "Public Library of Science (PLoS)")
|
394
|
+
expect(subject.provider).to eq("Crossref")
|
395
395
|
end
|
396
396
|
|
397
|
-
it
|
398
|
-
input =
|
399
|
-
subject = described_class.new(input: input, from:
|
397
|
+
it "dataset usda" do
|
398
|
+
input = "https://doi.org/10.2737/RDS-2018-0001"
|
399
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
400
400
|
# # expect(subject.valid?).to be true
|
401
|
-
expect(subject.id).to eq(
|
402
|
-
expect(subject.url).to eq(
|
403
|
-
expect(subject.type).to eq(
|
404
|
-
expect(subject.
|
405
|
-
expect(subject.
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
expect(subject.titles).to eq([{
|
401
|
+
expect(subject.id).to eq("https://doi.org/10.2737/rds-2018-0001")
|
402
|
+
expect(subject.url).to eq("https://www.fs.usda.gov/rds/archive/Catalog/RDS-2018-0001")
|
403
|
+
expect(subject.type).to eq("Dataset")
|
404
|
+
expect(subject.contributors.length).to eq(4)
|
405
|
+
expect(subject.contributors.first).to eq("familyName" => "Ribic", "givenName" => "Christine A.",
|
406
|
+
"affiliation" => [{ "name" => "U.S. Geological Survey" }],
|
407
|
+
"id" => "https://orcid.org/0000-0003-2583-1778",
|
408
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
409
|
+
expect(subject.titles).to eq([{ "title" => "Fledging times of grassland birds" }])
|
410
410
|
expect(subject.descriptions.empty?).to be(true)
|
411
|
-
expect(subject.date).to eq(
|
412
|
-
expect(subject.publisher).to eq(
|
413
|
-
expect(subject.provider).to eq(
|
414
|
-
end
|
415
|
-
|
416
|
-
it
|
417
|
-
input =
|
418
|
-
subject = described_class.new(input: input, from:
|
419
|
-
# expect(subject.valid?).to be true
|
420
|
-
expect(subject.id).to eq(
|
421
|
-
expect(subject.url).to eq(
|
422
|
-
expect(subject.type).to eq(
|
423
|
-
expect(subject.
|
424
|
-
expect(subject.
|
425
|
-
|
426
|
-
expect(subject.titles).to eq([{
|
427
|
-
expect(subject.date).to eq(
|
428
|
-
|
429
|
-
|
430
|
-
expect(subject.publisher).to eq(
|
431
|
-
expect(subject.provider).to eq(
|
432
|
-
expect(subject.container[
|
433
|
-
expect(subject.container[
|
434
|
-
expect(subject.container[
|
435
|
-
expect(subject.container[
|
436
|
-
expect(subject.container[
|
437
|
-
|
438
|
-
end
|
439
|
-
|
440
|
-
it
|
441
|
-
input =
|
442
|
-
subject = described_class.new(input: input, from:
|
443
|
-
# expect(subject.valid?).to be true
|
444
|
-
expect(subject.id).to eq(
|
445
|
-
expect(subject.url).to eq(
|
446
|
-
expect(subject.type).to eq(
|
447
|
-
expect(subject.
|
448
|
-
|
449
|
-
expect(subject.titles).to eq([{
|
450
|
-
expect(subject.date).to include(
|
451
|
-
|
452
|
-
|
453
|
-
expect(subject.publisher).to eq(
|
454
|
-
expect(subject.provider).to eq(
|
455
|
-
expect(subject.container[
|
456
|
-
expect(subject.container[
|
457
|
-
expect(subject.container[
|
458
|
-
expect(subject.container[
|
459
|
-
end
|
460
|
-
|
461
|
-
it
|
462
|
-
input =
|
463
|
-
subject = described_class.new(input: input, from:
|
464
|
-
# expect(subject.valid?).to be true
|
465
|
-
expect(subject.id).to eq(
|
466
|
-
expect(subject.url).to eq(
|
467
|
-
expect(subject.type).to eq(
|
468
|
-
expect(subject.
|
469
|
-
|
470
|
-
expect(subject.titles).to eq([{
|
471
|
-
expect(subject.date).to eq(
|
472
|
-
expect(subject.publisher).to eq(
|
473
|
-
expect(subject.provider).to eq(
|
474
|
-
expect(subject.container[
|
475
|
-
expect(subject.container[
|
476
|
-
expect(subject.container[
|
477
|
-
expect(subject.container[
|
478
|
-
expect(subject.container[
|
479
|
-
|
480
|
-
end
|
481
|
-
|
482
|
-
it
|
483
|
-
input =
|
484
|
-
subject = described_class.new(input: input, from:
|
485
|
-
# expect(subject.valid?).to be true
|
486
|
-
expect(subject.id).to eq(
|
487
|
-
expect(subject.url).to eq(
|
488
|
-
expect(subject.type).to eq(
|
489
|
-
expect(subject.
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
expect(subject.
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
expect(subject.
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
subject
|
509
|
-
|
510
|
-
expect(subject.
|
511
|
-
|
512
|
-
|
513
|
-
expect(subject.
|
514
|
-
expect(subject.
|
515
|
-
|
516
|
-
|
517
|
-
expect(subject.
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
expect(subject.
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
subject
|
528
|
-
|
529
|
-
expect(subject.
|
530
|
-
expect(subject.
|
531
|
-
expect(subject.
|
532
|
-
expect(subject.
|
533
|
-
|
534
|
-
expect(subject.
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
subject
|
547
|
-
|
548
|
-
|
549
|
-
expect(subject.
|
550
|
-
|
551
|
-
expect(subject.
|
552
|
-
|
553
|
-
expect(subject.
|
554
|
-
|
555
|
-
expect(subject.
|
556
|
-
expect(subject.date).to eq('published' => '1982', 'updated' => '2021-12-04')
|
557
|
-
expect(subject.publisher).to eq('name' => 'Wiley')
|
411
|
+
expect(subject.date).to eq("updated" => "2021-07-01")
|
412
|
+
expect(subject.publisher).to eq("name" => "USDA Forest Service")
|
413
|
+
expect(subject.provider).to eq("Crossref")
|
414
|
+
end
|
415
|
+
|
416
|
+
it "book chapter" do
|
417
|
+
input = "https://doi.org/10.1007/978-3-662-46370-3_13"
|
418
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
419
|
+
# expect(subject.valid?).to be true
|
420
|
+
expect(subject.id).to eq("https://doi.org/10.1007/978-3-662-46370-3_13")
|
421
|
+
expect(subject.url).to eq("https://link.springer.com/10.1007/978-3-662-46370-3_13")
|
422
|
+
expect(subject.type).to eq("BookChapter")
|
423
|
+
expect(subject.contributors.length).to eq(2)
|
424
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "givenName" => "Ronald L.",
|
425
|
+
"familyName" => "Diercks")
|
426
|
+
expect(subject.titles).to eq([{ "title" => "Clinical Symptoms and Physical Examinations" }])
|
427
|
+
expect(subject.date).to eq("published" => "2015",
|
428
|
+
"registered" => "2023-02-09",
|
429
|
+
"updated" => "2023-02-10")
|
430
|
+
expect(subject.publisher).to eq("name" => "Springer Science and Business Media LLC")
|
431
|
+
expect(subject.provider).to eq("Crossref")
|
432
|
+
expect(subject.container["type"]).to eq("Book")
|
433
|
+
expect(subject.container["title"]).to eq("Shoulder Stiffness")
|
434
|
+
expect(subject.container["firstPage"]).to eq("155")
|
435
|
+
expect(subject.container["lastPage"]).to eq("158")
|
436
|
+
expect(subject.container["identifiers"]).to eq([{ "alternateIdentifier" => "978-3-662-46369-7",
|
437
|
+
"alternateIdentifierType" => "ISBN" }])
|
438
|
+
end
|
439
|
+
|
440
|
+
it "another book chapter" do
|
441
|
+
input = "https://doi.org/10.1007/978-3-319-75889-3_1"
|
442
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
443
|
+
# expect(subject.valid?).to be true
|
444
|
+
expect(subject.id).to eq("https://doi.org/10.1007/978-3-319-75889-3_1")
|
445
|
+
expect(subject.url).to eq("http://link.springer.com/10.1007/978-3-319-75889-3_1")
|
446
|
+
expect(subject.type).to eq("BookChapter")
|
447
|
+
expect(subject.contributors).to eq([{ "familyName" => "Jones", "givenName" => "Hunter M.",
|
448
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
449
|
+
expect(subject.titles).to eq([{ "title" => "Climate Change and Increasing Risk of Extreme Heat" }])
|
450
|
+
expect(subject.date).to include("published" => "2018",
|
451
|
+
"registered" => "2018-09-05",
|
452
|
+
"updated" => "2019-10-16")
|
453
|
+
expect(subject.publisher).to eq("name" => "Springer Science and Business Media LLC")
|
454
|
+
expect(subject.provider).to eq("Crossref")
|
455
|
+
expect(subject.container["type"]).to eq("Book Series")
|
456
|
+
expect(subject.container["title"]).to eq("SpringerBriefs in Medical Earth Sciences")
|
457
|
+
expect(subject.container["identifier"]).to eq("2523-3629")
|
458
|
+
expect(subject.container["identifierType"]).to eq("ISSN")
|
459
|
+
end
|
460
|
+
|
461
|
+
it "yet another book chapter" do
|
462
|
+
input = "https://doi.org/10.4018/978-1-4666-1891-6.ch004"
|
463
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
464
|
+
# expect(subject.valid?).to be true
|
465
|
+
expect(subject.id).to eq("https://doi.org/10.4018/978-1-4666-1891-6.ch004")
|
466
|
+
expect(subject.url).to eq("http://services.igi-global.com/resolvedoi/resolve.aspx?doi=10.4018/978-1-4666-1891-6.ch004")
|
467
|
+
expect(subject.type).to eq("BookChapter")
|
468
|
+
expect(subject.contributors).to eq([{ "affiliation" => [{ "name" => "Université de Lyon, France" }],
|
469
|
+
"familyName" => "Bichot", "givenName" => "Charles-Edmond", "type" => "Person", "contributorRoles" => ["Author"] }])
|
470
|
+
expect(subject.titles).to eq([{ "title" => "Unsupervised and Supervised Image Segmentation Using Graph Partitioning" }])
|
471
|
+
expect(subject.date).to eq("registered" => "2018-11-19", "updated" => "2019-07-02")
|
472
|
+
expect(subject.publisher).to eq("name" => "IGI Global")
|
473
|
+
expect(subject.provider).to eq("Crossref")
|
474
|
+
expect(subject.container["type"]).to eq("Book")
|
475
|
+
expect(subject.container["title"]).to eq("Graph-Based Methods in Computer Vision")
|
476
|
+
expect(subject.container["firstPage"]).to eq("72")
|
477
|
+
expect(subject.container["lastPage"]).to eq("94")
|
478
|
+
expect(subject.container["identifiers"]).to eq([{ "alternateIdentifier" => "9781466618916",
|
479
|
+
"alternateIdentifierType" => "ISBN" }])
|
480
|
+
end
|
481
|
+
|
482
|
+
it "missing contributor" do
|
483
|
+
input = "https://doi.org/10.3390/publications6020015"
|
484
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
485
|
+
# expect(subject.valid?).to be true
|
486
|
+
expect(subject.id).to eq("https://doi.org/10.3390/publications6020015")
|
487
|
+
expect(subject.url).to eq("https://www.mdpi.com/2304-6775/6/2/15")
|
488
|
+
expect(subject.type).to eq("JournalArticle")
|
489
|
+
expect(subject.contributors).to eq([{ "familyName" => "Kohls",
|
490
|
+
"givenName" => "Alexander",
|
491
|
+
"id" => "https://orcid.org/0000-0002-3836-8885",
|
492
|
+
"type" => "Person", "contributorRoles" => ["Author"] },
|
493
|
+
{ "familyName" => "Mele",
|
494
|
+
"givenName" => "Salvatore",
|
495
|
+
"id" => "https://orcid.org/0000-0003-0762-2235",
|
496
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
497
|
+
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" }])
|
498
|
+
expect(subject.date).to eq("published" => "2018-04-09",
|
499
|
+
"registered" => "2021-07-22",
|
500
|
+
"updated" => "2021-07-22")
|
501
|
+
expect(subject.publisher).to eq("name" => "MDPI AG")
|
502
|
+
expect(subject.provider).to eq("Crossref")
|
503
|
+
end
|
504
|
+
|
505
|
+
it "book" do
|
506
|
+
input = "https://doi.org/10.1017/9781108348843"
|
507
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
508
|
+
# expect(subject.valid?).to be true
|
509
|
+
expect(subject.id).to eq("https://doi.org/10.1017/9781108348843")
|
510
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "9781108348843",
|
511
|
+
"alternateIdentifierType" => "ISBN" }])
|
512
|
+
expect(subject.url).to eq("https://www.cambridge.org/core/product/identifier/9781108348843/type/book")
|
513
|
+
expect(subject.type).to eq("Book")
|
514
|
+
expect(subject.contributors).to eq([{ "familyName" => "Leung", "givenName" => "Vincent S.",
|
515
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
516
|
+
expect(subject.titles).to eq([{ "title" => "The Politics of the Past in Early China" }])
|
517
|
+
expect(subject.date).to eq("published" => "2019-07-01",
|
518
|
+
"registered" => "2019-07-06",
|
519
|
+
"updated" => "2022-09-22")
|
520
|
+
expect(subject.publisher).to eq("name" => "Cambridge University Press (CUP)")
|
521
|
+
expect(subject.provider).to eq("Crossref")
|
522
|
+
end
|
523
|
+
|
524
|
+
it "another book" do
|
525
|
+
input = "https://doi.org/10.2973/odp.proc.ir.180.2000"
|
526
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
527
|
+
# expect(subject.valid?).to be true
|
528
|
+
expect(subject.id).to eq("https://doi.org/10.2973/odp.proc.ir.180.2000")
|
529
|
+
expect(subject.url).to eq("http://www-odp.tamu.edu/publications/180_IR/180TOC.HTM")
|
530
|
+
expect(subject.type).to eq("Book")
|
531
|
+
expect(subject.contributors.size).to eq(5)
|
532
|
+
expect(subject.contributors[1]).to eq("contributorRoles" => ["Editor"], "familyName" => "Taylor",
|
533
|
+
"givenName" => "B.", "type" => "Person")
|
534
|
+
expect(subject.titles).to eq([{ "title" => "Proceedings of the Ocean Drilling Program, 180 Initial Reports" }])
|
535
|
+
expect(subject.date).to eq("published" => "2000-02-04",
|
536
|
+
"registered" => "2006-10-17",
|
537
|
+
"updated" => "2009-02-02")
|
538
|
+
expect(subject.publisher).to eq("name" => "International Ocean Discovery Program (IODP)")
|
539
|
+
expect(subject.provider).to eq("Crossref")
|
540
|
+
end
|
541
|
+
|
542
|
+
it "yet another book" do
|
543
|
+
input = "https://doi.org/10.1029/ar035"
|
544
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
545
|
+
# expect(subject.valid?).to be true
|
546
|
+
expect(subject.id).to eq("https://doi.org/10.1029/ar035")
|
547
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "0-87590-181-6",
|
548
|
+
"alternateIdentifierType" => "ISBN" }])
|
549
|
+
expect(subject.url).to eq("http://doi.wiley.com/10.1029/AR035")
|
550
|
+
expect(subject.type).to eq("Book")
|
551
|
+
expect(subject.contributors).to eq([{ "familyName" => "McGinnis", "givenName" => "Richard Frank",
|
552
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
553
|
+
expect(subject.titles).to eq([{ "title" => "Biogeography of Lanternfishes (Myctophidae) South of 30°S" }])
|
554
|
+
expect(subject.date).to eq("published" => "1982", "updated" => "2021-12-04")
|
555
|
+
expect(subject.publisher).to eq("name" => "Wiley")
|
558
556
|
expect(subject.references.length).to eq(242)
|
559
|
-
expect(subject.references.first).to eq(
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
expect(subject.container).to eq(
|
568
|
-
|
569
|
-
expect(subject.provider).to eq(
|
570
|
-
end
|
571
|
-
|
572
|
-
it
|
573
|
-
input =
|
574
|
-
subject = described_class.new(input: input, from:
|
575
|
-
# expect(subject.valid?).to be true
|
576
|
-
expect(subject.id).to eq(
|
577
|
-
expect(subject.alternate_identifiers).to eq([{
|
578
|
-
|
579
|
-
expect(subject.url).to eq(
|
580
|
-
expect(subject.type).to eq(
|
581
|
-
expect(subject.
|
582
|
-
expect(subject.
|
583
|
-
|
584
|
-
expect(subject.titles).to eq([{
|
585
|
-
expect(subject.date).to include(
|
586
|
-
|
587
|
-
expect(subject.publisher).to eq(
|
588
|
-
expect(subject.provider).to eq(
|
589
|
-
end
|
590
|
-
|
591
|
-
it
|
592
|
-
input =
|
593
|
-
subject = described_class.new(input: input, from:
|
594
|
-
# expect(subject.valid?).to be true
|
595
|
-
expect(subject.id).to eq(
|
596
|
-
expect(subject.alternate_identifiers).to eq([{
|
597
|
-
|
598
|
-
expect(subject.url).to eq(
|
599
|
-
expect(subject.type).to eq(
|
600
|
-
expect(subject.
|
601
|
-
expect(subject.
|
602
|
-
|
603
|
-
expect(subject.titles).to eq([{
|
604
|
-
expect(subject.date).to eq(
|
605
|
-
|
606
|
-
|
607
|
-
expect(subject.publisher).to eq(
|
608
|
-
expect(subject.provider).to eq(
|
609
|
-
end
|
610
|
-
|
611
|
-
it
|
612
|
-
input =
|
613
|
-
subject = described_class.new(input: input, from:
|
614
|
-
# expect(subject.valid?).to be true
|
615
|
-
expect(subject.id).to eq(
|
616
|
-
expect(subject.url).to eq(
|
617
|
-
expect(subject.type).to eq(
|
618
|
-
expect(subject.
|
619
|
-
|
620
|
-
expect(subject.titles).to eq([{
|
621
|
-
expect(subject.date).to eq(
|
622
|
-
|
623
|
-
expect(subject.publisher).to eq(
|
624
|
-
expect(subject.provider).to eq(
|
625
|
-
end
|
626
|
-
|
627
|
-
it
|
628
|
-
input =
|
629
|
-
subject = described_class.new(input: input, from:
|
630
|
-
# expect(subject.valid?).to be true
|
631
|
-
expect(subject.id).to eq(
|
632
|
-
expect(subject.url).to eq(
|
633
|
-
expect(subject.type).to eq(
|
634
|
-
expect(subject.
|
635
|
-
expect(subject.
|
636
|
-
|
637
|
-
expect(subject.titles).to eq([{
|
638
|
-
expect(subject.date).to include(
|
639
|
-
|
640
|
-
|
641
|
-
expect(subject.publisher).to eq(
|
642
|
-
expect(subject.provider).to eq(
|
643
|
-
end
|
644
|
-
|
645
|
-
it
|
646
|
-
input =
|
647
|
-
subject = described_class.new(input: input, from:
|
648
|
-
# expect(subject.valid?).to be true
|
649
|
-
expect(subject.id).to eq(
|
650
|
-
expect(subject.url).to eq(
|
651
|
-
expect(subject.type).to eq(
|
652
|
-
expect(subject.
|
653
|
-
|
557
|
+
expect(subject.references.first).to eq("containerTitle" => "Palaeogeogr. Palaeoclimatol. Palaeoecol.",
|
558
|
+
"contributor" => "Addicott",
|
559
|
+
"doi" => "https://doi.org/10.1016/0031-0182(70)90103-3",
|
560
|
+
"firstPage" => "287",
|
561
|
+
"key" => "10.1029/AR035:addi70",
|
562
|
+
"publicationYear" => "1970",
|
563
|
+
"title" => "Latitudinal gradients in tertiary mol-luscan faunas of the Pacific coast",
|
564
|
+
"volume" => "8")
|
565
|
+
expect(subject.container).to eq("identifier" => "0066-4634", "identifierType" => "ISSN",
|
566
|
+
"title" => "Antarctic Research Series", "type" => "Book Series", "volume" => "35")
|
567
|
+
expect(subject.provider).to eq("Crossref")
|
568
|
+
end
|
569
|
+
|
570
|
+
it "mEDRA" do
|
571
|
+
input = "https://doi.org/10.3280/ecag2018-001005"
|
572
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
573
|
+
# expect(subject.valid?).to be true
|
574
|
+
expect(subject.id).to eq("https://doi.org/10.3280/ecag2018-001005")
|
575
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "5",
|
576
|
+
"alternateIdentifierType" => "article_number" }])
|
577
|
+
expect(subject.url).to eq("http://www.francoangeli.it/riviste/Scheda_Riviste.asp?IDArticolo=61645")
|
578
|
+
expect(subject.type).to eq("JournalArticle")
|
579
|
+
expect(subject.contributors.length).to eq(2)
|
580
|
+
expect(subject.contributors.first).to eq("familyName" => "Oh", "givenName" => "Sohae Eve",
|
581
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
582
|
+
expect(subject.titles).to eq([{ "title" => "Substitutability between organic and conventional poultry products and organic price premiums" }])
|
583
|
+
expect(subject.date).to include("published" => "2018-05", "registered" => "2018-07-12",
|
584
|
+
"updated" => "2018-10-18")
|
585
|
+
expect(subject.publisher).to eq("name" => "Franco Angeli")
|
586
|
+
expect(subject.provider).to eq("Crossref")
|
587
|
+
end
|
588
|
+
|
589
|
+
it "KISTI" do
|
590
|
+
input = "https://doi.org/10.5012/bkcs.2013.34.10.2889"
|
591
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
592
|
+
# expect(subject.valid?).to be true
|
593
|
+
expect(subject.id).to eq("https://doi.org/10.5012/bkcs.2013.34.10.2889")
|
594
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "JCGMCS_2013_v34n10_2889",
|
595
|
+
"alternateIdentifierType" => "Publisher ID" }])
|
596
|
+
expect(subject.url).to eq("http://koreascience.or.kr/journal/view.jsp?kj=JCGMCS&py=2013&vnc=v34n10&sp=2889")
|
597
|
+
expect(subject.type).to eq("JournalArticle")
|
598
|
+
expect(subject.contributors.length).to eq(7)
|
599
|
+
expect(subject.contributors.first).to eq("familyName" => "Huang", "givenName" => "Guimei",
|
600
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
601
|
+
expect(subject.titles).to eq([{ "title" => "Synthesis, Crystal Structure and Theoretical Calculation of a Novel Nickel(II) Complex with Dibromotyrosine and 1,10-Phenanthroline" }])
|
602
|
+
expect(subject.date).to eq("published" => "2013-10-20",
|
603
|
+
"registered" => "2013-11-25",
|
604
|
+
"updated" => "2016-12-14")
|
605
|
+
expect(subject.publisher).to eq("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, from: "crossref_xml")
|
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", "registered" => "2002-08-08",
|
620
|
+
"updated" => "2020-03-06")
|
621
|
+
expect(subject.publisher).to eq("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, from: "crossref_xml")
|
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("familyName" => "Younes", "givenName" => "Maged",
|
634
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
635
|
+
expect(subject.titles).to eq([{ "title" => "Scientific opinion on the safety of green tea catechins" }])
|
636
|
+
expect(subject.date).to include("published" => "2018-04",
|
637
|
+
"registered" => "2021-09-09",
|
638
|
+
"updated" => "2021-09-09")
|
639
|
+
expect(subject.publisher).to eq("name" => "Wiley")
|
640
|
+
expect(subject.provider).to eq("OP")
|
641
|
+
end
|
642
|
+
|
643
|
+
it "multiple titles" do
|
644
|
+
input = "https://doi.org/10.4000/dms.865"
|
645
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
646
|
+
# expect(subject.valid?).to be true
|
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"] }])
|
654
652
|
expect(subject.titles).to eq([
|
655
|
-
{
|
653
|
+
{ "title" => "Distances, absence, proximités et présences : des concepts en déplacement" }, { "title" => "Distance(s), proximity and presence(s): evolving concepts" },
|
656
654
|
])
|
657
|
-
expect(subject.date).to include(
|
658
|
-
expect(subject.publisher).to eq(
|
659
|
-
expect(subject.provider).to eq(
|
655
|
+
expect(subject.date).to include("published" => "2014-12-14", "updated" => "2023-06-14")
|
656
|
+
expect(subject.publisher).to eq("name" => "OpenEdition")
|
657
|
+
expect(subject.provider).to eq("Crossref")
|
660
658
|
end
|
661
659
|
|
662
|
-
it
|
663
|
-
input =
|
664
|
-
subject = described_class.new(input: input, from:
|
660
|
+
it "multiple titles with missing" do
|
661
|
+
input = "https://doi.org/10.1186/1471-2164-7-187"
|
662
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
665
663
|
expect(subject.valid?).to be false
|
666
664
|
expect(subject.errors).to eq(["property '/descriptions/0' is missing required keys: description"])
|
667
|
-
expect(subject.id).to eq(
|
668
|
-
expect(subject.url).to eq(
|
669
|
-
expect(subject.type).to eq(
|
670
|
-
expect(subject.
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
expect(subject.titles).to eq([{
|
686
|
-
expect(subject.date).to include(
|
687
|
-
|
688
|
-
|
689
|
-
expect(subject.publisher).to eq(
|
690
|
-
expect(subject.provider).to eq(
|
691
|
-
end
|
692
|
-
|
693
|
-
it
|
694
|
-
input =
|
695
|
-
subject = described_class.new(input: input, from:
|
696
|
-
# expect(subject.valid?).to be true
|
697
|
-
expect(subject.id).to eq(
|
698
|
-
expect(subject.url).to eq(
|
699
|
-
expect(subject.type).to eq(
|
700
|
-
expect(subject.
|
701
|
-
expect(subject.
|
702
|
-
|
703
|
-
|
665
|
+
expect(subject.id).to eq("https://doi.org/10.1186/1471-2164-7-187")
|
666
|
+
expect(subject.url).to eq("https://bmcgenomics.biomedcentral.com/articles/10.1186/1471-2164-7-187")
|
667
|
+
expect(subject.type).to eq("JournalArticle")
|
668
|
+
expect(subject.contributors).to eq([{ "familyName" => "Myers",
|
669
|
+
"givenName" => "Chad L",
|
670
|
+
"type" => "Person", "contributorRoles" => ["Author"] },
|
671
|
+
{ "familyName" => "Barrett",
|
672
|
+
"givenName" => "Daniel R",
|
673
|
+
"type" => "Person", "contributorRoles" => ["Author"] },
|
674
|
+
{ "familyName" => "Hibbs",
|
675
|
+
"givenName" => "Matthew A",
|
676
|
+
"type" => "Person", "contributorRoles" => ["Author"] },
|
677
|
+
{ "familyName" => "Huttenhower",
|
678
|
+
"givenName" => "Curtis",
|
679
|
+
"type" => "Person", "contributorRoles" => ["Author"] },
|
680
|
+
{ "familyName" => "Troyanskaya",
|
681
|
+
"givenName" => "Olga G",
|
682
|
+
"type" => "Person", "contributorRoles" => ["Author"] }])
|
683
|
+
expect(subject.titles).to eq([{ "title" => "Finding function: evaluation methods for functional genomic data" }])
|
684
|
+
expect(subject.date).to include("published" => "2006-07-25",
|
685
|
+
"registered" => "2021-08-31",
|
686
|
+
"updated" => "2021-09-01")
|
687
|
+
expect(subject.publisher).to eq("name" => "Springer Science and Business Media LLC")
|
688
|
+
expect(subject.provider).to eq("Crossref")
|
689
|
+
end
|
690
|
+
|
691
|
+
it "markup" do
|
692
|
+
input = "https://doi.org/10.1098/rspb.2017.0132"
|
693
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
694
|
+
# expect(subject.valid?).to be true
|
695
|
+
expect(subject.id).to eq("https://doi.org/10.1098/rspb.2017.0132")
|
696
|
+
expect(subject.url).to eq("https://royalsocietypublishing.org/doi/10.1098/rspb.2017.0132")
|
697
|
+
expect(subject.type).to eq("JournalArticle")
|
698
|
+
expect(subject.contributors.size).to eq(6)
|
699
|
+
expect(subject.contributors.first).to eq(
|
700
|
+
"affiliation" => [{ "name" => "School of Biological Sciences, Centre for Evolutionary Biology, University of Western Australia, Crawley, WA 6009, Australia" }], "familyName" => "Dougherty", "givenName" => "Liam R.",
|
701
|
+
"id" => "https://orcid.org/0000-0003-1406-0680", "type" => "Person", "contributorRoles" => ["Author"],
|
704
702
|
)
|
705
|
-
expect(subject.titles).to eq([{
|
706
|
-
expect(subject.date).to include(
|
707
|
-
|
708
|
-
|
709
|
-
expect(subject.publisher).to eq(
|
710
|
-
expect(subject.provider).to eq(
|
711
|
-
end
|
712
|
-
|
713
|
-
it
|
714
|
-
input =
|
715
|
-
subject = described_class.new(input: input, from:
|
716
|
-
# expect(subject.valid?).to be true
|
717
|
-
expect(subject.id).to eq(
|
718
|
-
expect(subject.url).to eq(
|
719
|
-
expect(subject.type).to eq(
|
720
|
-
expect(subject.
|
721
|
-
expect(subject.
|
722
|
-
expect(subject.titles).to eq([{
|
723
|
-
expect(subject.license).to eq(
|
724
|
-
expect(subject.date).to eq(
|
725
|
-
|
726
|
-
|
727
|
-
expect(subject.publisher).to eq(
|
728
|
-
end
|
729
|
-
|
730
|
-
it
|
731
|
-
input =
|
732
|
-
subject = described_class.new(input: input, from:
|
733
|
-
# expect(subject.valid?).to be true
|
734
|
-
expect(subject.id).to eq(
|
735
|
-
expect(subject.alternate_identifiers).to eq([{
|
736
|
-
|
737
|
-
expect(subject.url).to eq(
|
738
|
-
expect(subject.type).to eq(
|
739
|
-
expect(subject.
|
740
|
-
expect(subject.
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
expect(subject.titles).to eq([{
|
746
|
-
expect(subject.date).to eq(
|
747
|
-
expect(subject.publisher).to eq(
|
748
|
-
end
|
749
|
-
|
750
|
-
it
|
751
|
-
input =
|
752
|
-
subject = described_class.new(input: input, from:
|
753
|
-
# expect(subject.valid?).to be true
|
754
|
-
expect(subject.id).to eq(
|
755
|
-
expect(subject.url).to eq(
|
756
|
-
expect(subject.type).to eq(
|
757
|
-
expect(subject.
|
758
|
-
expect(subject.
|
759
|
-
|
760
|
-
|
761
|
-
expect(subject.titles).to eq([{
|
762
|
-
expect(subject.license).to eq(
|
763
|
-
expect(subject.date).to include(
|
764
|
-
|
765
|
-
|
766
|
-
expect(subject.publisher).to eq(
|
703
|
+
expect(subject.titles).to eq([{ "title" => "Sexual conflict and correlated evolution between male persistence and female resistance traits in the seed beetle" }])
|
704
|
+
expect(subject.date).to include("published" => "2017-05-24",
|
705
|
+
"registered" => "2021-02-14",
|
706
|
+
"updated" => "2021-02-19")
|
707
|
+
expect(subject.publisher).to eq("name" => "The Royal Society")
|
708
|
+
expect(subject.provider).to eq("Crossref")
|
709
|
+
end
|
710
|
+
|
711
|
+
it "empty given name" do
|
712
|
+
input = "https://doi.org/10.1111/J.1865-1682.2010.01171.X"
|
713
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
714
|
+
# expect(subject.valid?).to be true
|
715
|
+
expect(subject.id).to eq("https://doi.org/10.1111/j.1865-1682.2010.01171.x")
|
716
|
+
expect(subject.url).to eq("https://onlinelibrary.wiley.com/doi/10.1111/j.1865-1682.2010.01171.x")
|
717
|
+
expect(subject.type).to eq("JournalArticle")
|
718
|
+
expect(subject.contributors.length).to eq(5)
|
719
|
+
expect(subject.contributors[3]).to eq("familyName" => "Ehtisham-ul-Haq", "type" => "Person", "contributorRoles" => ["Author"])
|
720
|
+
expect(subject.titles).to eq([{ "title" => "Serological Evidence of Brucella abortus Prevalence in Punjab Province, Pakistan - A Cross-Sectional Study" }])
|
721
|
+
expect(subject.license).to eq("url" => "http://doi.wiley.com/10.1002/tdm_license_1.1")
|
722
|
+
expect(subject.date).to eq("published" => "2010-12",
|
723
|
+
"registered" => "2010-11-11",
|
724
|
+
"updated" => "2023-02-09")
|
725
|
+
expect(subject.publisher).to eq("name" => "Hindawi Limited")
|
726
|
+
end
|
727
|
+
|
728
|
+
it "invalid date" do
|
729
|
+
input = "https://doi.org/10.1055/s-0039-1690894"
|
730
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
731
|
+
# expect(subject.valid?).to be true
|
732
|
+
expect(subject.id).to eq("https://doi.org/10.1055/s-0039-1690894")
|
733
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "s-0039-1690894",
|
734
|
+
"alternateIdentifierType" => "sequence-number" }])
|
735
|
+
expect(subject.url).to eq("http://www.thieme-connect.de/DOI/DOI?10.1055/s-0039-1690894")
|
736
|
+
expect(subject.type).to eq("JournalArticle")
|
737
|
+
expect(subject.contributors.length).to eq(4)
|
738
|
+
expect(subject.contributors[3]).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" }],
|
739
|
+
"familyName" => "Ma",
|
740
|
+
"givenName" => "Jun-An",
|
741
|
+
"id" => "https://orcid.org/0000-0002-3902-6799",
|
742
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
743
|
+
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" }])
|
744
|
+
expect(subject.date).to eq("published" => "2020-04-08", "updated" => "2020-06-16")
|
745
|
+
expect(subject.publisher).to eq("name" => "Georg Thieme Verlag KG")
|
746
|
+
end
|
747
|
+
|
748
|
+
it "journal article with" do
|
749
|
+
input = "https://doi.org/10.1111/nph.14619"
|
750
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
751
|
+
# expect(subject.valid?).to be true
|
752
|
+
expect(subject.id).to eq("https://doi.org/10.1111/nph.14619")
|
753
|
+
expect(subject.url).to eq("https://onlinelibrary.wiley.com/doi/10.1111/nph.14619")
|
754
|
+
expect(subject.type).to eq("JournalArticle")
|
755
|
+
expect(subject.contributors.length).to eq(3)
|
756
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"],
|
757
|
+
"id" => "https://orcid.org/0000-0002-4156-3761",
|
758
|
+
"givenName" => "Nico", "familyName" => "Dissmeyer", "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" }])
|
759
|
+
expect(subject.titles).to eq([{ "title" => "Life and death of proteins after protease cleavage: protein degradation by the N-end rule pathway" }])
|
760
|
+
expect(subject.license).to eq("url" => "http://onlinelibrary.wiley.com/termsAndConditions#vor")
|
761
|
+
expect(subject.date).to include("published" => "2018-05",
|
762
|
+
"registered" => "2018-08-03",
|
763
|
+
"updated" => "2021-07-07")
|
764
|
+
expect(subject.publisher).to eq("name" => "Wiley")
|
767
765
|
expect(subject.references.length).to eq(49)
|
768
|
-
expect(subject.references.last).to eq(
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
expect(subject.container).to eq(
|
777
|
-
|
778
|
-
expect(subject.provider).to eq(
|
779
|
-
end
|
780
|
-
|
781
|
-
it
|
782
|
-
input =
|
783
|
-
subject = described_class.new(input: input, from:
|
784
|
-
# expect(subject.valid?).to be true
|
785
|
-
expect(subject.id).to eq(
|
786
|
-
expect(subject.url).to eq(
|
787
|
-
expect(subject.type).to eq(
|
788
|
-
expect(subject.
|
789
|
-
expect(subject.
|
790
|
-
expect(subject.titles).to eq([{
|
791
|
-
expect(subject.date).to include(
|
792
|
-
|
793
|
-
|
794
|
-
expect(subject.publisher).to eq(
|
795
|
-
expect(subject.provider).to eq(
|
796
|
-
end
|
797
|
-
|
798
|
-
it
|
799
|
-
input =
|
800
|
-
subject = described_class.new(input: input, from:
|
801
|
-
# expect(subject.valid?).to be true
|
802
|
-
expect(subject.id).to eq(
|
803
|
-
expect(subject.url).to eq(
|
804
|
-
expect(subject.type).to eq(
|
805
|
-
expect(subject.
|
806
|
-
expect(subject.
|
807
|
-
|
808
|
-
expect(subject.titles).to eq([{
|
809
|
-
expect(subject.date).to include(
|
810
|
-
|
811
|
-
|
812
|
-
expect(subject.publisher).to eq(
|
813
|
-
expect(subject.provider).to eq(
|
814
|
-
end
|
815
|
-
|
816
|
-
it
|
817
|
-
input =
|
818
|
-
subject = described_class.new(input: input, from:
|
819
|
-
# expect(subject.valid?).to be true
|
820
|
-
expect(subject.id).to eq(
|
821
|
-
expect(subject.url).to eq(
|
822
|
-
expect(subject.type).to eq(
|
823
|
-
expect(subject.
|
824
|
-
expect(subject.
|
825
|
-
|
826
|
-
expect(subject.titles).to eq([{
|
827
|
-
expect(subject.date).to include(
|
828
|
-
|
829
|
-
|
830
|
-
expect(subject.publisher).to eq(
|
831
|
-
expect(subject.container).to eq(
|
832
|
-
|
833
|
-
expect(subject.provider).to eq(
|
834
|
-
end
|
835
|
-
|
836
|
-
it
|
837
|
-
input =
|
838
|
-
subject = described_class.new(input: input, from:
|
839
|
-
# expect(subject.valid?).to be true
|
840
|
-
expect(subject.id).to eq(
|
841
|
-
expect(subject.url).to eq(
|
842
|
-
expect(subject.type).to eq(
|
843
|
-
expect(subject.
|
844
|
-
expect(subject.
|
845
|
-
|
846
|
-
expect(subject.titles).to eq([{
|
847
|
-
expect(subject.date).to include(
|
848
|
-
|
849
|
-
|
850
|
-
expect(subject.publisher).to eq(
|
851
|
-
expect(subject.container).to eq(
|
852
|
-
|
853
|
-
expect(subject.provider).to eq(
|
854
|
-
end
|
855
|
-
|
856
|
-
it
|
857
|
-
input =
|
858
|
-
subject = described_class.new(input: input, from:
|
859
|
-
# expect(subject.valid?).to be true
|
860
|
-
expect(subject.url).to eq(
|
861
|
-
expect(subject.type).to eq(
|
862
|
-
expect(subject.
|
863
|
-
expect(subject.
|
864
|
-
|
865
|
-
|
866
|
-
expect(subject.titles).to eq([{
|
867
|
-
expect(subject.id).to eq(
|
766
|
+
expect(subject.references.last).to eq("containerTitle" => "Proteomics",
|
767
|
+
"contributor" => "Zhang",
|
768
|
+
"doi" => "https://doi.org/10.1002/pmic.201400530",
|
769
|
+
"firstPage" => "2447",
|
770
|
+
"key" => "10.1111/nph.14619-BIB0049|nph14619-cit-0049",
|
771
|
+
"publicationYear" => "2015",
|
772
|
+
"title" => "Quantitative proteomics analysis of the Arg/N-end rule pathway of targeted degradation in Arabidopsis roots",
|
773
|
+
"volume" => "15")
|
774
|
+
expect(subject.container).to eq("firstPage" => "929", "identifier" => "0028-646X",
|
775
|
+
"identifierType" => "ISSN", "issue" => "3", "lastPage" => "935", "title" => "New Phytologist", "type" => "Journal", "volume" => "218")
|
776
|
+
expect(subject.provider).to eq("Crossref")
|
777
|
+
end
|
778
|
+
|
779
|
+
it "author literal" do
|
780
|
+
input = "https://doi.org/10.1038/ng.3834"
|
781
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
782
|
+
# expect(subject.valid?).to be true
|
783
|
+
expect(subject.id).to eq("https://doi.org/10.1038/ng.3834")
|
784
|
+
expect(subject.url).to eq("https://www.nature.com/articles/ng.3834")
|
785
|
+
expect(subject.type).to eq("JournalArticle")
|
786
|
+
expect(subject.contributors.length).to eq(14)
|
787
|
+
expect(subject.contributors.last).to eq("name" => "GTEx Consortium", "type" => "Organization", "contributorRoles" => ["Author"])
|
788
|
+
expect(subject.titles).to eq([{ "title" => "The impact of structural variation on human gene expression" }])
|
789
|
+
expect(subject.date).to include("published" => "2017-04-03",
|
790
|
+
"registered" => "2019-11-02",
|
791
|
+
"updated" => "2023-05-18")
|
792
|
+
expect(subject.publisher).to eq("name" => "Springer Science and Business Media LLC")
|
793
|
+
expect(subject.provider).to eq("Crossref")
|
794
|
+
end
|
795
|
+
|
796
|
+
it "affiliation is space" do
|
797
|
+
input = "https://doi.org/10.1177/0042098011428175"
|
798
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
799
|
+
# expect(subject.valid?).to be true
|
800
|
+
expect(subject.id).to eq("https://doi.org/10.1177/0042098011428175")
|
801
|
+
expect(subject.url).to eq("http://journals.sagepub.com/doi/10.1177/0042098011428175")
|
802
|
+
expect(subject.type).to eq("JournalArticle")
|
803
|
+
expect(subject.contributors.length).to eq(1)
|
804
|
+
expect(subject.contributors.first).to eq("familyName" => "Petrovici", "givenName" => "Norbert",
|
805
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
806
|
+
expect(subject.titles).to eq([{ "title" => "Workers and the City: Rethinking the Geographies of Power in Post-socialist Urbanisation" }])
|
807
|
+
expect(subject.date).to include("published" => "2011-12-22",
|
808
|
+
"registered" => "2021-05-16",
|
809
|
+
"updated" => "2021-05-16")
|
810
|
+
expect(subject.publisher).to eq("name" => "SAGE Publications")
|
811
|
+
expect(subject.provider).to eq("Crossref")
|
812
|
+
end
|
813
|
+
|
814
|
+
it "multiple issn" do
|
815
|
+
input = "https://doi.org/10.1007/978-3-642-34922-5_19"
|
816
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
817
|
+
# expect(subject.valid?).to be true
|
818
|
+
expect(subject.id).to eq("https://doi.org/10.1007/978-3-642-34922-5_19")
|
819
|
+
expect(subject.url).to eq("https://link.springer.com/10.1007/978-3-642-34922-5_19")
|
820
|
+
expect(subject.type).to eq("BookChapter")
|
821
|
+
expect(subject.contributors.length).to eq(3)
|
822
|
+
expect(subject.contributors.first).to eq("familyName" => "Razib", "givenName" => "Ali",
|
823
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
824
|
+
expect(subject.titles).to eq([{ "title" => "Log-Domain Arithmetic for High-Speed Fuzzy Control on a Field-Programmable Gate Array" }])
|
825
|
+
expect(subject.date).to include("published" => "2013",
|
826
|
+
"registered" => "2023-02-17",
|
827
|
+
"updated" => "2023-02-17")
|
828
|
+
expect(subject.publisher).to eq("name" => "Springer Science and Business Media LLC")
|
829
|
+
expect(subject.container).to eq("identifier" => "1860-0808", "identifierType" => "ISSN",
|
830
|
+
"title" => "Studies in Fuzziness and Soft Computing", "type" => "Book Series")
|
831
|
+
expect(subject.provider).to eq("Crossref")
|
832
|
+
end
|
833
|
+
|
834
|
+
it "article id as page number" do
|
835
|
+
input = "https://doi.org/10.1103/physrevlett.120.117701"
|
836
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
837
|
+
# expect(subject.valid?).to be true
|
838
|
+
expect(subject.id).to eq("https://doi.org/10.1103/physrevlett.120.117701")
|
839
|
+
expect(subject.url).to eq("https://link.aps.org/doi/10.1103/PhysRevLett.120.117701")
|
840
|
+
expect(subject.type).to eq("JournalArticle")
|
841
|
+
expect(subject.contributors.length).to eq(5)
|
842
|
+
expect(subject.contributors.first).to eq("familyName" => "Marrazzo", "givenName" => "Antimo",
|
843
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
844
|
+
expect(subject.titles).to eq([{ "title" => "Prediction of a Large-Gap and Switchable Kane-Mele Quantum Spin Hall Insulator" }])
|
845
|
+
expect(subject.date).to include("published" => "2018-03-13",
|
846
|
+
"registered" => "2018-03-13",
|
847
|
+
"updated" => "2018-03-13")
|
848
|
+
expect(subject.publisher).to eq("name" => "American Physical Society (APS)")
|
849
|
+
expect(subject.container).to eq("firstPage" => "117701", "identifier" => "1079-7114",
|
850
|
+
"identifierType" => "ISSN", "issue" => "11", "title" => "Physical Review Letters", "type" => "Journal", "volume" => "120")
|
851
|
+
expect(subject.provider).to eq("Crossref")
|
852
|
+
end
|
853
|
+
|
854
|
+
it "posted content copernicus" do
|
855
|
+
input = "https://doi.org/10.5194/CP-2020-95"
|
856
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
857
|
+
# expect(subject.valid?).to be true
|
858
|
+
expect(subject.url).to eq("https://cp.copernicus.org/preprints/cp-2020-95/cp-2020-95.pdf")
|
859
|
+
expect(subject.type).to eq("Article")
|
860
|
+
expect(subject.contributors.count).to eq(6)
|
861
|
+
expect(subject.contributors.first).to eq("type" => "Person", "contributorRoles" => ["Author"], "familyName" => "Shao",
|
862
|
+
"givenName" => "Jun",
|
863
|
+
"id" => "https://orcid.org/0000-0001-6130-6474")
|
864
|
+
expect(subject.titles).to eq([{ "title" => "The Atmospheric Bridge Communicated the δ<sup>13</sup>C Decline during the Last Deglaciation to the Global Upper Ocean" }])
|
865
|
+
expect(subject.id).to eq("https://doi.org/10.5194/cp-2020-95")
|
868
866
|
expect(subject.alternate_identifiers.empty?).to be(true)
|
869
|
-
expect(subject.descriptions.first[
|
870
|
-
expect(subject.date).to include(
|
871
|
-
expect(subject.publisher).to eq(
|
872
|
-
expect(subject.provider).to eq(
|
873
|
-
end
|
874
|
-
|
875
|
-
it
|
876
|
-
input =
|
877
|
-
subject = described_class.new(input: input, from:
|
878
|
-
# expect(subject.valid?).to be true
|
879
|
-
expect(subject.url).to eq(
|
880
|
-
expect(subject.type).to eq(
|
881
|
-
expect(subject.
|
882
|
-
expect(subject.
|
883
|
-
|
884
|
-
expect(subject.contributors
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
expect(subject.
|
867
|
+
expect(subject.descriptions.first["description"]).to start_with("Abstract. During the early last glacial termination")
|
868
|
+
expect(subject.date).to include("registered" => "2022-03-17", "updated" => "2022-03-17")
|
869
|
+
expect(subject.publisher).to eq("name" => "Copernicus GmbH")
|
870
|
+
expect(subject.provider).to eq("Crossref")
|
871
|
+
end
|
872
|
+
|
873
|
+
it "book oup" do
|
874
|
+
input = "10.1093/oxfordhb/9780198746140.013.5"
|
875
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
876
|
+
# expect(subject.valid?).to be true
|
877
|
+
expect(subject.url).to eq("https://academic.oup.com/edited-volume/28081/chapter/212116415")
|
878
|
+
expect(subject.type).to eq("Book")
|
879
|
+
expect(subject.contributors.count).to eq(3)
|
880
|
+
expect(subject.contributors.first).to eq("familyName" => "Clayton", "givenName" => "Barbra R.",
|
881
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
882
|
+
expect(subject.contributors[2]).to eq("contributorRoles" => ["Editor"],
|
883
|
+
"familyName" => "Shields",
|
884
|
+
"givenName" => "James Mark",
|
885
|
+
"type" => "Person")
|
886
|
+
expect(subject.titles).to eq([{ "title" => "The Changing Way of the Bodhisattva" }])
|
887
|
+
expect(subject.id).to eq("https://doi.org/10.1093/oxfordhb/9780198746140.013.5")
|
889
888
|
expect(subject.alternate_identifiers.empty?).to be(true)
|
890
|
-
expect(subject.descriptions.first[
|
891
|
-
expect(subject.date).to include(
|
892
|
-
|
893
|
-
|
894
|
-
expect(subject.publisher).to eq(
|
895
|
-
expect(subject.provider).to eq(
|
896
|
-
end
|
897
|
-
|
898
|
-
it
|
899
|
-
input =
|
900
|
-
subject = described_class.new(input: input, from:
|
901
|
-
# expect(subject.valid?).to be true
|
902
|
-
expect(subject.url).to eq(
|
903
|
-
expect(subject.type).to eq(
|
904
|
-
expect(subject.
|
905
|
-
expect(subject.
|
906
|
-
|
907
|
-
expect(subject.
|
908
|
-
expect(subject.
|
909
|
-
expect(subject.
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
'alternateIdentifierType' => 'sequence-number' }])
|
889
|
+
expect(subject.descriptions.first["description"]).to start_with("This chapter explores the nature of the connections")
|
890
|
+
expect(subject.date).to include("published" => "2018-04-05",
|
891
|
+
"registered" => "2022-07-05",
|
892
|
+
"updated" => "2022-08-02")
|
893
|
+
expect(subject.publisher).to eq("name" => "Oxford University Press (OUP)")
|
894
|
+
expect(subject.provider).to eq("Crossref")
|
895
|
+
end
|
896
|
+
|
897
|
+
it "report osti" do
|
898
|
+
input = "10.2172/972169"
|
899
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
900
|
+
# expect(subject.valid?).to be true
|
901
|
+
expect(subject.url).to eq("http://www.osti.gov/servlets/purl/972169-1QXROM")
|
902
|
+
expect(subject.type).to eq("Report")
|
903
|
+
expect(subject.contributors.count).to eq(4)
|
904
|
+
expect(subject.contributors.first).to eq("familyName" => "Denholm", "givenName" => "P.",
|
905
|
+
"type" => "Person", "contributorRoles" => ["Author"])
|
906
|
+
expect(subject.titles).to eq([{ "title" => "Role of Energy Storage with Renewable Electricity Generation" }])
|
907
|
+
expect(subject.id).to eq("https://doi.org/10.2172/972169")
|
908
|
+
expect(subject.alternate_identifiers).to eq([{ "alternateIdentifier" => "NREL/TP-6A2-47187",
|
909
|
+
"alternateIdentifierType" => "report-number" },
|
910
|
+
{ "alternateIdentifier" => "972169",
|
911
|
+
"alternateIdentifierType" => "sequence-number" }])
|
914
912
|
expect(subject.descriptions.empty?).to be(true)
|
915
|
-
expect(subject.date).to include(
|
916
|
-
|
917
|
-
|
918
|
-
expect(subject.publisher).to eq(
|
919
|
-
expect(subject.provider).to eq(
|
920
|
-
end
|
921
|
-
|
922
|
-
it
|
923
|
-
input =
|
924
|
-
subject = described_class.new(input: input, from:
|
925
|
-
# expect(subject.valid?).to be true
|
926
|
-
expect(subject.id).to eq(
|
927
|
-
expect(subject.url).to eq(
|
928
|
-
expect(subject.type).to eq(
|
929
|
-
expect(subject.
|
930
|
-
expect(subject.titles).to eq([{
|
931
|
-
expect(subject.date).to eq(
|
932
|
-
expect(subject.publisher).to eq(
|
913
|
+
expect(subject.date).to include("published" => "2010-01-01",
|
914
|
+
"registered" => "2010-02-18",
|
915
|
+
"updated" => "2010-02-18")
|
916
|
+
expect(subject.publisher).to eq("name" => "Office of Scientific and Technical Information (OSTI)")
|
917
|
+
expect(subject.provider).to eq("Crossref")
|
918
|
+
end
|
919
|
+
|
920
|
+
it "journal issue" do
|
921
|
+
input = "https://doi.org/10.6002/ect.2015.0371"
|
922
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
923
|
+
# expect(subject.valid?).to be true
|
924
|
+
expect(subject.id).to eq("https://doi.org/10.6002/ect.2015.0371")
|
925
|
+
expect(subject.url).to eq("http://ectrx.org/forms/ectrxcontentshow.php?doi_id=10.6002/ect.2015.0371")
|
926
|
+
expect(subject.type).to eq("JournalIssue")
|
927
|
+
expect(subject.contributors).to eq([{ "name" => ":(unav)", "type" => "Organization", "contributorRoles" => ["Author"] }])
|
928
|
+
expect(subject.titles).to eq([{ "title" => ":(unav)" }])
|
929
|
+
expect(subject.date).to eq("published" => "2018-10", "updated" => "2018-10-03")
|
930
|
+
expect(subject.publisher).to eq("name" => "Baskent University")
|
933
931
|
expect(subject.references.length).to eq(1)
|
934
|
-
expect(subject.container).to eq(
|
935
|
-
|
936
|
-
expect(subject.provider).to eq(
|
932
|
+
expect(subject.container).to eq("identifier" => "2146-8427", "identifierType" => "ISSN",
|
933
|
+
"issue" => "5", "title" => "Experimental and Clinical Transplantation", "type" => "Journal", "volume" => "16")
|
934
|
+
expect(subject.provider).to eq("Crossref")
|
937
935
|
end
|
938
936
|
|
939
|
-
it
|
940
|
-
input =
|
941
|
-
subject = described_class.new(input: input, from:
|
937
|
+
it "not found error" do
|
938
|
+
input = "https://doi.org/10.7554/elife.01567x"
|
939
|
+
subject = described_class.new(input: input, from: "crossref_xml")
|
942
940
|
expect(subject.valid?).to be false
|
943
|
-
expect(subject.id).to eq(
|
944
|
-
expect(subject.provider).to eq(
|
945
|
-
expect(subject.state).to eq(
|
941
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567x")
|
942
|
+
expect(subject.provider).to eq("Crossref")
|
943
|
+
expect(subject.state).to eq("not_found")
|
946
944
|
end
|
947
945
|
end
|
948
946
|
end
|