bolognese 1.8.4 → 1.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/readers/crossref_reader.rb +20 -8
- data/lib/bolognese/utils.rb +7 -4
- data/lib/bolognese/version.rb +1 -1
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/report_osti.yml +138 -0
- data/spec/readers/crossref_reader_spec.rb +24 -5
- data/spec/writers/datacite_writer_spec.rb +3 -3
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2844940808f11b8faa885e34806bea245ab3c8d772bec2877de19a1122e49895
|
4
|
+
data.tar.gz: cc6167a8111867f03168c121a11db290671f2bbaf8a3ea2e295faa339b81ed12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb45a458092cde73a13a28a8208c4c115f0a6386afdb53cf9b25c89ff85de8767c7c0d6a368c056a3f736961e2e5ea9589ec38f212c038b105ceb32e6d435d9c
|
7
|
+
data.tar.gz: 43edabbc11bf430fd372c209bade25085e84ba73f4d64a52221cc143756ba374c703b485e1770afdede0939c5a33f40dda0017b0ead213d98704bd00f9cc0316
|
data/Gemfile.lock
CHANGED
@@ -31,7 +31,7 @@ module Bolognese
|
|
31
31
|
end
|
32
32
|
|
33
33
|
# model should be one of book, conference, database, dissertation, journal, peer_review, posted_content,
|
34
|
-
#
|
34
|
+
# report_paper, sa_component, standard
|
35
35
|
model = meta.dig("crossref").to_h.keys.last
|
36
36
|
|
37
37
|
resource_type = nil
|
@@ -82,6 +82,9 @@ module Bolognese
|
|
82
82
|
when "database"
|
83
83
|
bibliographic_metadata = meta.dig("crossref", "database", "dataset").to_h
|
84
84
|
resource_type = "dataset"
|
85
|
+
when "report_paper"
|
86
|
+
bibliographic_metadata = meta.dig("crossref", "report_paper", "report_paper_metadata").to_h
|
87
|
+
resource_type = "report"
|
85
88
|
end
|
86
89
|
|
87
90
|
resource_type = (resource_type || model).to_s.underscore.camelcase.presence
|
@@ -156,7 +159,7 @@ module Bolognese
|
|
156
159
|
end
|
157
160
|
|
158
161
|
id = normalize_doi(options[:doi] || options[:id] || bibliographic_metadata.dig("doi_data", "doi"))
|
159
|
-
identifiers =
|
162
|
+
identifiers = crossref_alternate_identifiers(bibliographic_metadata)
|
160
163
|
|
161
164
|
{ "id" => id,
|
162
165
|
"types" => types,
|
@@ -187,14 +190,23 @@ module Bolognese
|
|
187
190
|
|
188
191
|
def crossref_alternate_identifiers(bibliographic_metadata)
|
189
192
|
if bibliographic_metadata.dig("publisher_item", "item_number").present?
|
190
|
-
|
191
|
-
|
193
|
+
Array.wrap(bibliographic_metadata.dig("publisher_item", "item_number")).map do |item|
|
194
|
+
if item.is_a?(String)
|
195
|
+
{ "identifier" => item,
|
196
|
+
"identifierType" => "Publisher ID" }
|
197
|
+
else
|
198
|
+
{ "identifier" => item.fetch("__content__", nil),
|
199
|
+
"identifierType" => item.fetch("item_number_type", nil) || "Publisher ID" }
|
200
|
+
end
|
201
|
+
end
|
192
202
|
elsif parse_attributes(bibliographic_metadata.fetch("item_number", nil)).present?
|
193
|
-
{ "identifier" => parse_attributes(bibliographic_metadata.fetch("item_number", nil)),
|
194
|
-
"identifierType" => "Publisher ID" }
|
203
|
+
[{ "identifier" => parse_attributes(bibliographic_metadata.fetch("item_number", nil)),
|
204
|
+
"identifierType" => "Publisher ID" }]
|
195
205
|
elsif parse_attributes(bibliographic_metadata.fetch("isbn", nil)).present?
|
196
|
-
{ "identifier" => parse_attributes(bibliographic_metadata.fetch("isbn", nil), first: true),
|
197
|
-
|
206
|
+
[{ "identifier" => parse_attributes(bibliographic_metadata.fetch("isbn", nil), first: true),
|
207
|
+
"identifierType" => "ISBN" }]
|
208
|
+
else
|
209
|
+
[]
|
198
210
|
end
|
199
211
|
end
|
200
212
|
|
data/lib/bolognese/utils.rb
CHANGED
@@ -117,7 +117,7 @@ module Bolognese
|
|
117
117
|
"EditedBook" => "Book",
|
118
118
|
"JournalArticle" => "ScholarlyArticle",
|
119
119
|
"Journal" => nil,
|
120
|
-
"Report" =>
|
120
|
+
"Report" => "Report",
|
121
121
|
"BookSeries" => nil,
|
122
122
|
"ReportSeries" => nil,
|
123
123
|
"BookTrack" => nil,
|
@@ -146,7 +146,7 @@ module Bolognese
|
|
146
146
|
"EditedBook" => "book",
|
147
147
|
"JournalArticle" => "article",
|
148
148
|
"Journal" => nil,
|
149
|
-
"Report" =>
|
149
|
+
"Report" => "techreport",
|
150
150
|
"BookSeries" => nil,
|
151
151
|
"ReportSeries" => nil,
|
152
152
|
"BookTrack" => nil,
|
@@ -214,6 +214,7 @@ module Bolognese
|
|
214
214
|
"ImageObject" => "Image",
|
215
215
|
"Movie" => "Audiovisual",
|
216
216
|
"PublicationIssue" => "Text",
|
217
|
+
"Report" => "Text",
|
217
218
|
"ScholarlyArticle" => "Text",
|
218
219
|
"Thesis" => "Text",
|
219
220
|
"Service" => "Service",
|
@@ -258,6 +259,7 @@ module Bolognese
|
|
258
259
|
"ImageObject" => "graphic",
|
259
260
|
"Movie" => "motion_picture",
|
260
261
|
"PublicationIssue" => nil,
|
262
|
+
"Report" => "report",
|
261
263
|
"ScholarlyArticle" => "article-journal",
|
262
264
|
"Service" => nil,
|
263
265
|
"Thesis" => "thesis",
|
@@ -278,6 +280,7 @@ module Bolognese
|
|
278
280
|
"Event" => nil,
|
279
281
|
"ImageObject" => "FIGURE",
|
280
282
|
"Movie" => "MPCT",
|
283
|
+
"Report" => "RPRT",
|
281
284
|
"PublicationIssue" => nil,
|
282
285
|
"ScholarlyArticle" => "JOUR",
|
283
286
|
"Service" => nil,
|
@@ -298,11 +301,11 @@ module Bolognese
|
|
298
301
|
"EditedBook" => "BOOK",
|
299
302
|
"JournalArticle" => "JOUR",
|
300
303
|
"Journal" => nil,
|
301
|
-
"Report" =>
|
304
|
+
"Report" => "RPRT",
|
302
305
|
"BookSeries" => nil,
|
303
306
|
"ReportSeries" => nil,
|
304
307
|
"BookTrack" => nil,
|
305
|
-
"Standard" =>
|
308
|
+
"Standard" => "STAND",
|
306
309
|
"BookSection" => "CHAP",
|
307
310
|
"BookPart" => "CHAP",
|
308
311
|
"Book" => "BOOK",
|
data/lib/bolognese/version.rb
CHANGED
@@ -0,0 +1,138 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://doi.org/ra/10.2172
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Mozilla/5.0 (compatible; Maremma/4.7.1; mailto:info@datacite.org)
|
12
|
+
Accept:
|
13
|
+
- text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
|
14
|
+
response:
|
15
|
+
status:
|
16
|
+
code: 200
|
17
|
+
message: ''
|
18
|
+
headers:
|
19
|
+
Date:
|
20
|
+
- Wed, 29 Jul 2020 21:23:48 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json;charset=UTF-8
|
23
|
+
Connection:
|
24
|
+
- keep-alive
|
25
|
+
Set-Cookie:
|
26
|
+
- __cfduid=d01ef02c612a86c1cf7a059f5c9c803201596057828; expires=Fri, 28-Aug-20
|
27
|
+
21:23:48 GMT; path=/; domain=.doi.org; HttpOnly; SameSite=Lax; Secure
|
28
|
+
Cf-Cache-Status:
|
29
|
+
- DYNAMIC
|
30
|
+
Cf-Request-Id:
|
31
|
+
- 043e0ed580000096d473a7a200000001
|
32
|
+
Expect-Ct:
|
33
|
+
- max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
|
34
|
+
Strict-Transport-Security:
|
35
|
+
- max-age=31536000; includeSubDomains; preload
|
36
|
+
Server:
|
37
|
+
- cloudflare
|
38
|
+
Cf-Ray:
|
39
|
+
- 5ba9e7359f0c96d4-FRA
|
40
|
+
body:
|
41
|
+
encoding: ASCII-8BIT
|
42
|
+
string: |-
|
43
|
+
[
|
44
|
+
{
|
45
|
+
"DOI": "10.2172",
|
46
|
+
"RA": "Crossref"
|
47
|
+
}
|
48
|
+
]
|
49
|
+
http_version:
|
50
|
+
recorded_at: Wed, 29 Jul 2020 21:23:48 GMT
|
51
|
+
- request:
|
52
|
+
method: get
|
53
|
+
uri: https://api.crossref.org/works/10.2172/972169/transform/application/vnd.crossref.unixsd+xml
|
54
|
+
body:
|
55
|
+
encoding: US-ASCII
|
56
|
+
string: ''
|
57
|
+
headers:
|
58
|
+
User-Agent:
|
59
|
+
- Mozilla/5.0 (compatible; Maremma/4.7.1; mailto:info@datacite.org)
|
60
|
+
Accept:
|
61
|
+
- text/xml
|
62
|
+
response:
|
63
|
+
status:
|
64
|
+
code: 200
|
65
|
+
message: OK
|
66
|
+
headers:
|
67
|
+
Link:
|
68
|
+
- <http://dx.doi.org/10.2172/972169>; rel="canonical"
|
69
|
+
Access-Control-Allow-Origin:
|
70
|
+
- "*"
|
71
|
+
Access-Control-Allow-Headers:
|
72
|
+
- X-Requested-With
|
73
|
+
Content-Length:
|
74
|
+
- '4217'
|
75
|
+
Server:
|
76
|
+
- http-kit
|
77
|
+
Date:
|
78
|
+
- Wed, 29 Jul 2020 21:23:49 GMT
|
79
|
+
X-Rate-Limit-Limit:
|
80
|
+
- '50'
|
81
|
+
X-Rate-Limit-Interval:
|
82
|
+
- 1s
|
83
|
+
Connection:
|
84
|
+
- close
|
85
|
+
body:
|
86
|
+
encoding: ASCII-8BIT
|
87
|
+
string: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<crossref_result xmlns=\"http://www.crossref.org/qrschema/3.0\"
|
88
|
+
version=\"3.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.crossref.org/qrschema/3.0
|
89
|
+
http://www.crossref.org/schemas/crossref_query_output3.0.xsd\">\r\n <query_result>\r\n
|
90
|
+
\ <head>\r\n <doi_batch_id>none</doi_batch_id>\r\n </head>\r\n <body>\r\n
|
91
|
+
\ <query status=\"resolved\">\r\n <doi type=\"report-paper_title\">10.2172/972169</doi>\r\n
|
92
|
+
\ <crm-item name=\"publisher-name\" type=\"string\">Office of Scientific
|
93
|
+
and Technical Information (OSTI)</crm-item>\r\n <crm-item name=\"prefix-name\"
|
94
|
+
type=\"string\">Office of Scientific and Technical Information</crm-item>\r\n
|
95
|
+
\ <crm-item name=\"member-id\" type=\"number\">960</crm-item>\r\n <crm-item
|
96
|
+
name=\"citation-id\" type=\"number\">41225045</crm-item>\r\n <crm-item
|
97
|
+
name=\"book-id\" type=\"number\">584445</crm-item>\r\n <crm-item name=\"deposit-timestamp\"
|
98
|
+
type=\"number\">20100218105553</crm-item>\r\n <crm-item name=\"owner-prefix\"
|
99
|
+
type=\"string\">10.2172</crm-item>\r\n <crm-item name=\"last-update\"
|
100
|
+
type=\"date\">2010-02-19T03:56:05Z</crm-item>\r\n <crm-item name=\"created\"
|
101
|
+
type=\"date\">2010-02-19T03:56:03Z</crm-item>\r\n <crm-item name=\"citedby-count\"
|
102
|
+
type=\"number\">159</crm-item>\r\n <doi_record>\r\n <crossref
|
103
|
+
xmlns=\"http://www.crossref.org/xschema/1.0\" xsi:schemaLocation=\"http://www.crossref.org/xschema/1.0
|
104
|
+
http://doi.crossref.org/schemas/unixref1.0.xsd\">\r\n <report-paper
|
105
|
+
publication_type=\"full_text\">\r\n <report-paper_metadata language=\"en\">\r\n
|
106
|
+
\ <contributors>\r\n <person_name sequence=\"first\"
|
107
|
+
contributor_role=\"author\">\r\n <given_name>P.</given_name>\r\n
|
108
|
+
\ <surname>Denholm</surname>\r\n </person_name>\r\n
|
109
|
+
\ <person_name sequence=\"additional\" contributor_role=\"author\">\r\n
|
110
|
+
\ <given_name>E.</given_name>\r\n <surname>Ela</surname>\r\n
|
111
|
+
\ </person_name>\r\n <person_name sequence=\"additional\"
|
112
|
+
contributor_role=\"author\">\r\n <given_name>B.</given_name>\r\n
|
113
|
+
\ <surname>Kirby</surname>\r\n </person_name>\r\n
|
114
|
+
\ <person_name sequence=\"additional\" contributor_role=\"author\">\r\n
|
115
|
+
\ <given_name>M.</given_name>\r\n <surname>Milligan</surname>\r\n
|
116
|
+
\ </person_name>\r\n </contributors>\r\n <titles>\r\n
|
117
|
+
\ <title>Role of Energy Storage with Renewable Electricity
|
118
|
+
Generation</title>\r\n </titles>\r\n <publication_date
|
119
|
+
media_type=\"online\">\r\n <month>01</month>\r\n <day>01</day>\r\n
|
120
|
+
\ <year>2010</year>\r\n </publication_date>\r\n
|
121
|
+
\ <approval_date>\r\n <month>02</month>\r\n
|
122
|
+
\ <day>18</day>\r\n <year>2010</year>\r\n
|
123
|
+
\ </approval_date>\r\n <institution>\r\n <institution_name>National
|
124
|
+
Renewable Energy Laboratory (NREL)</institution_name>\r\n <institution_acronym>NREL</institution_acronym>\r\n
|
125
|
+
\ <institution_place>Golden, CO (United States)</institution_place>\r\n
|
126
|
+
\ </institution>\r\n <institution>\r\n <institution_name>USDOE</institution_name>\r\n
|
127
|
+
\ </institution>\r\n <publisher_item>\r\n <item_number
|
128
|
+
item_number_type=\"report-number\">NREL/TP-6A2-47187</item_number>\r\n <item_number
|
129
|
+
item_number_type=\"sequence-number\">972169</item_number>\r\n </publisher_item>\r\n
|
130
|
+
\ <contract_number>AC36-99-GO10337</contract_number>\r\n <doi_data>\r\n
|
131
|
+
\ <doi>10.2172/972169</doi>\r\n <timestamp>20100218105553</timestamp>\r\n
|
132
|
+
\ <resource>http://www.osti.gov/servlets/purl/972169-1QXROM/</resource>\r\n
|
133
|
+
\ </doi_data>\r\n </report-paper_metadata>\r\n
|
134
|
+
\ </report-paper>\r\n </crossref>\r\n </doi_record>\r\n
|
135
|
+
\ </query>\r\n </body>\r\n </query_result>\r\n</crossref_result>"
|
136
|
+
http_version:
|
137
|
+
recorded_at: Wed, 29 Jul 2020 21:23:49 GMT
|
138
|
+
recorded_with: VCR 3.0.3
|
@@ -19,7 +19,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
19
19
|
it "DOI with data citation" do
|
20
20
|
expect(subject.valid?).to be true
|
21
21
|
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
22
|
-
expect(subject.identifiers).to eq([{"identifier"=>"e01567", "identifierType"=>"
|
22
|
+
expect(subject.identifiers).to eq([{"identifier"=>"e01567", "identifierType"=>"article_number"}])
|
23
23
|
expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
|
24
24
|
expect(subject.url).to eq("https://elifesciences.org/articles/01567")
|
25
25
|
expect(subject.creators.length).to eq(5)
|
@@ -82,7 +82,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
82
82
|
subject = Bolognese::Metadata.new(input: input)
|
83
83
|
expect(subject.valid?).to be true
|
84
84
|
expect(subject.id).to eq("https://doi.org/10.3389/fpls.2019.00816")
|
85
|
-
expect(subject.identifiers).to eq([{"identifier"=>"816", "identifierType"=>"
|
85
|
+
expect(subject.identifiers).to eq([{"identifier"=>"816", "identifierType"=>"article_number"}])
|
86
86
|
expect(subject.url).to eq("https://www.frontiersin.org/article/10.3389/fpls.2019.00816/full")
|
87
87
|
expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
|
88
88
|
expect(subject.creators.length).to eq(4)
|
@@ -229,7 +229,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
229
229
|
subject = Bolognese::Metadata.new(input: input)
|
230
230
|
expect(subject.valid?).to be true
|
231
231
|
expect(subject.id).to eq("https://doi.org/10.1016/j.ejphar.2015.03.018")
|
232
|
-
expect(subject.identifiers).to eq([{"identifier"=>"S0014299915002332", "identifierType"=>"
|
232
|
+
expect(subject.identifiers).to eq([{"identifier"=>"S0014299915002332", "identifierType"=>"sequence-number"}])
|
233
233
|
expect(subject.url).to eq("https://linkinghub.elsevier.com/retrieve/pii/S0014299915002332")
|
234
234
|
expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
|
235
235
|
expect(subject.creators.length).to eq(10)
|
@@ -433,7 +433,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
433
433
|
subject = Bolognese::Metadata.new(input: input)
|
434
434
|
expect(subject.valid?).to be true
|
435
435
|
expect(subject.id).to eq("https://doi.org/10.3280/ecag2018-001005")
|
436
|
-
expect(subject.identifiers).to eq([{"identifier"=>"5", "identifierType"=>"
|
436
|
+
expect(subject.identifiers).to eq([{"identifier"=>"5", "identifierType"=>"article_number"}])
|
437
437
|
expect(subject.url).to eq("http://www.francoangeli.it/riviste/Scheda_Riviste.asp?IDArticolo=61645")
|
438
438
|
expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
|
439
439
|
expect(subject.creators.length).to eq(2)
|
@@ -547,7 +547,7 @@ describe Bolognese::Metadata, vcr: true do
|
|
547
547
|
subject = Bolognese::Metadata.new(input: input)
|
548
548
|
expect(subject.valid?).to be true
|
549
549
|
expect(subject.id).to eq("https://doi.org/10.1055/s-0039-1690894")
|
550
|
-
expect(subject.identifiers).to eq([{"identifier"=>"s-0039-1690894", "identifierType"=>"
|
550
|
+
expect(subject.identifiers).to eq([{"identifier"=>"s-0039-1690894", "identifierType"=>"sequence-number"}])
|
551
551
|
expect(subject.url).to eq("http://www.thieme-connect.de/DOI/DOI?10.1055/s-0039-1690894")
|
552
552
|
expect(subject.types).to eq("bibtex"=>"article", "citeproc"=>"article-journal", "resourceType"=>"JournalArticle", "resourceTypeGeneral"=>"Text", "ris"=>"JOUR", "schemaOrg"=>"ScholarlyArticle")
|
553
553
|
expect(subject.creators.length).to eq(4)
|
@@ -643,6 +643,25 @@ describe Bolognese::Metadata, vcr: true do
|
|
643
643
|
expect(subject.agency).to eq("crossref")
|
644
644
|
end
|
645
645
|
|
646
|
+
it "report osti" do
|
647
|
+
input = "10.2172/972169"
|
648
|
+
subject = Bolognese::Metadata.new(input: input)
|
649
|
+
expect(subject.valid?).to be true
|
650
|
+
expect(subject.url).to eq("http://www.osti.gov/servlets/purl/972169-1QXROM/")
|
651
|
+
expect(subject.types).to eq("bibtex"=>"techreport", "citeproc"=>"report", "resourceType"=>"Report", "resourceTypeGeneral"=>"Text", "ris"=>"RPRT", "schemaOrg"=>"Report")
|
652
|
+
expect(subject.creators.count).to eq(4)
|
653
|
+
expect(subject.creators.first).to eq("familyName"=>"Denholm", "givenName"=>"P.", "name"=>"Denholm, P.", "nameType"=>"Personal")
|
654
|
+
expect(subject.contributors.count).to eq(0)
|
655
|
+
expect(subject.titles).to eq([{"title"=>"Role of Energy Storage with Renewable Electricity Generation"}])
|
656
|
+
expect(subject.id).to eq("https://doi.org/10.2172/972169")
|
657
|
+
expect(subject.identifiers).to eq( [{"identifier"=>"NREL/TP-6A2-47187", "identifierType"=>"report-number"}, {"identifier"=>"972169", "identifierType"=>"sequence-number"}])
|
658
|
+
expect(subject.descriptions).to be_empty
|
659
|
+
expect(subject.dates).to include({"date"=>"2010-01-01", "dateType"=>"Issued"})
|
660
|
+
expect(subject.publication_year).to eq("2010")
|
661
|
+
expect(subject.publisher).to eq("Office of Scientific and Technical Information (OSTI)")
|
662
|
+
expect(subject.agency).to eq("crossref")
|
663
|
+
end
|
664
|
+
|
646
665
|
it "journal issue" do
|
647
666
|
input = "https://doi.org/10.6002/ect.2015.0371"
|
648
667
|
subject = Bolognese::Metadata.new(input: input)
|
@@ -386,11 +386,11 @@ describe Bolognese::Metadata, vcr: true do
|
|
386
386
|
input = "10.7554/eLife.01567"
|
387
387
|
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
388
388
|
expect(subject.valid?).to be true
|
389
|
-
expect(subject.identifiers).to eq(
|
390
|
-
subject.identifiers = [{ "identifierType" => "
|
389
|
+
expect(subject.identifiers).to eq([{"identifier"=>"e01567", "identifierType"=>"article_number"}])
|
390
|
+
subject.identifiers = [{ "identifierType" => "article_number", "identifier" => "abc" }]
|
391
391
|
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
392
392
|
expect(datacite.dig("identifier", "__content__")).to eq("10.7554/elife.01567")
|
393
|
-
expect(subject.identifiers).to eq([{"identifier"=>"abc", "identifierType"=>"
|
393
|
+
expect(subject.identifiers).to eq([{"identifier"=>"abc", "identifierType"=>"article_number"}])
|
394
394
|
end
|
395
395
|
|
396
396
|
it "validates against schema" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bolognese
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|
@@ -928,6 +928,7 @@ files:
|
|
928
928
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/not_found_error.yml
|
929
929
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content.yml
|
930
930
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/posted_content_copernicus.yml
|
931
|
+
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/report_osti.yml
|
931
932
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/vor_with_url.yml
|
932
933
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book.yml
|
933
934
|
- spec/fixtures/vcr_cassettes/Bolognese_Metadata/get_crossref_metadata/yet_another_book_chapter.yml
|