bolognese 0.10.8 → 0.10.9
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 +1 -30
- data/lib/bolognese/readers/datacite_reader.rb +3 -3
- data/lib/bolognese/utils.rb +29 -0
- data/lib/bolognese/version.rb +1 -1
- data/spec/readers/crossref_reader_spec.rb +15 -0
- data/spec/readers/datacite_reader_spec.rb +14 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d872984b3da9e316c667a4d17baa6d07d924bdd79243e995691644f79ac628e1
|
4
|
+
data.tar.gz: 9c32234806fa73225b8dbc252dc90fbe5b1f6fc2744ce7b0f282fb8f161d87dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbc8e5ebf4afca31d432fe1a8825d7b9cec9e595b05db7e8ab3c23f9af1b8d08c2f4a2e71d30357fd911ba9629ab86e0cf4bca7938a6687ce90d7849bc7fa944
|
7
|
+
data.tar.gz: e30767699d4862e255655f83d197630f31c60e37d63ee3194cc87dab7e202420959785ad041103a02def4ccae6b695c097fad7a38768b202e6fcf531e9e5309b
|
data/Gemfile.lock
CHANGED
@@ -3,35 +3,6 @@ module Bolognese
|
|
3
3
|
module CrossrefReader
|
4
4
|
# CrossRef types from https://api.crossref.org/types
|
5
5
|
|
6
|
-
CR_TO_BIB_TRANSLATIONS = {
|
7
|
-
"Proceedings" => "proceedings",
|
8
|
-
"ReferenceBook" => "book",
|
9
|
-
"JournalIssue" => nil,
|
10
|
-
"ProceedingsArticle" => nil,
|
11
|
-
"Other" => nil,
|
12
|
-
"Dissertation" => "phdthesis",
|
13
|
-
"Dataset" => nil,
|
14
|
-
"EditedBook" => "book",
|
15
|
-
"JournalArticle" => "article",
|
16
|
-
"Journal" => nil,
|
17
|
-
"Report" => nil,
|
18
|
-
"BookSeries" => nil,
|
19
|
-
"ReportSeries" => nil,
|
20
|
-
"BookTrack" => nil,
|
21
|
-
"Standard" => nil,
|
22
|
-
"BookSection" => "inbook",
|
23
|
-
"BookPart" => nil,
|
24
|
-
"Book" => "book",
|
25
|
-
"BookChapter" => "inbook",
|
26
|
-
"StandardSeries" => nil,
|
27
|
-
"Monograph" => "book",
|
28
|
-
"Component" => nil,
|
29
|
-
"ReferenceEntry" => nil,
|
30
|
-
"JournalVolume" => nil,
|
31
|
-
"BookSet" => nil,
|
32
|
-
"PostedContent" => "article"
|
33
|
-
}
|
34
|
-
|
35
6
|
CONTACT_EMAIL = "tech@datacite.org"
|
36
7
|
|
37
8
|
def get_crossref(id: nil, **options)
|
@@ -112,7 +83,7 @@ module Bolognese
|
|
112
83
|
"type" => type,
|
113
84
|
"additional_type" => additional_type,
|
114
85
|
"citeproc_type" => Bolognese::Utils::CR_TO_CP_TRANSLATIONS[additional_type] || "article-journal",
|
115
|
-
"bibtex_type" => CR_TO_BIB_TRANSLATIONS[additional_type] || "misc",
|
86
|
+
"bibtex_type" => Bolognese::Utils::CR_TO_BIB_TRANSLATIONS[additional_type] || "misc",
|
116
87
|
"ris_type" => Bolognese::Utils::CR_TO_RIS_TRANSLATIONS[additional_type] || "JOUR",
|
117
88
|
"resource_type_general" => Bolognese::Utils::SO_TO_DC_TRANSLATIONS[type],
|
118
89
|
"doi" => doi,
|
@@ -94,9 +94,9 @@ module Bolognese
|
|
94
94
|
{ "id" => id,
|
95
95
|
"type" => type,
|
96
96
|
"additional_type" => additional_type,
|
97
|
-
"citeproc_type" => Bolognese::Utils::SO_TO_CP_TRANSLATIONS[type] || "article",
|
98
|
-
"bibtex_type" => Bolognese::Utils::SO_TO_BIB_TRANSLATIONS[type] || "misc",
|
99
|
-
"ris_type" => Bolognese::Utils::DC_TO_RIS_TRANSLATIONS[resource_type_general.to_s.dasherize] || "GEN",
|
97
|
+
"citeproc_type" => Bolognese::Utils::CR_TO_CP_TRANSLATIONS[additional_type.to_s.underscore.camelcase] || Bolognese::Utils::SO_TO_CP_TRANSLATIONS[type] || "article",
|
98
|
+
"bibtex_type" => Bolognese::Utils::CR_TO_BIB_TRANSLATIONS[additional_type.to_s.underscore.camelcase] || Bolognese::Utils::SO_TO_BIB_TRANSLATIONS[type] || "misc",
|
99
|
+
"ris_type" => Bolognese::Utils::CR_TO_RIS_TRANSLATIONS[additional_type.to_s.underscore.camelcase] || Bolognese::Utils::DC_TO_RIS_TRANSLATIONS[resource_type_general.to_s.dasherize] || "GEN",
|
100
100
|
"resource_type_general" => resource_type_general,
|
101
101
|
"doi" => doi,
|
102
102
|
"url" => options.fetch(:url, nil),
|
data/lib/bolognese/utils.rb
CHANGED
@@ -99,6 +99,35 @@ module Bolognese
|
|
99
99
|
"PostedContent" => "ScholarlyArticle"
|
100
100
|
}
|
101
101
|
|
102
|
+
CR_TO_BIB_TRANSLATIONS = {
|
103
|
+
"Proceedings" => "proceedings",
|
104
|
+
"ReferenceBook" => "book",
|
105
|
+
"JournalIssue" => nil,
|
106
|
+
"ProceedingsArticle" => nil,
|
107
|
+
"Other" => nil,
|
108
|
+
"Dissertation" => "phdthesis",
|
109
|
+
"Dataset" => nil,
|
110
|
+
"EditedBook" => "book",
|
111
|
+
"JournalArticle" => "article",
|
112
|
+
"Journal" => nil,
|
113
|
+
"Report" => nil,
|
114
|
+
"BookSeries" => nil,
|
115
|
+
"ReportSeries" => nil,
|
116
|
+
"BookTrack" => nil,
|
117
|
+
"Standard" => nil,
|
118
|
+
"BookSection" => "inbook",
|
119
|
+
"BookPart" => nil,
|
120
|
+
"Book" => "book",
|
121
|
+
"BookChapter" => "inbook",
|
122
|
+
"StandardSeries" => nil,
|
123
|
+
"Monograph" => "book",
|
124
|
+
"Component" => nil,
|
125
|
+
"ReferenceEntry" => nil,
|
126
|
+
"JournalVolume" => nil,
|
127
|
+
"BookSet" => nil,
|
128
|
+
"PostedContent" => "article"
|
129
|
+
}
|
130
|
+
|
102
131
|
CR_TO_JATS_TRANSLATIONS = {
|
103
132
|
"Proceedings" => "working-paper",
|
104
133
|
"ReferenceBook" => "book",
|
data/lib/bolognese/version.rb
CHANGED
@@ -20,6 +20,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
20
20
|
expect(subject.type).to eq("ScholarlyArticle")
|
21
21
|
expect(subject.b_url).to eq("https://elifesciences.org/articles/01567")
|
22
22
|
expect(subject.additional_type).to eq("JournalArticle")
|
23
|
+
expect(subject.bibtex_type).to eq("article")
|
24
|
+
expect(subject.ris_type).to eq("JOUR")
|
25
|
+
expect(subject.citeproc_type).to eq("article-journal")
|
23
26
|
expect(subject.resource_type_general).to eq("Text")
|
24
27
|
expect(subject.author.length).to eq(5)
|
25
28
|
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Martial Sankar", "givenName"=>"Martial", "familyName"=>"Sankar")
|
@@ -53,6 +56,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
53
56
|
expect(subject.b_url).to eq("http://dx.plos.org/10.1371/journal.pone.0000030")
|
54
57
|
expect(subject.type).to eq("ScholarlyArticle")
|
55
58
|
expect(subject.additional_type).to eq("JournalArticle")
|
59
|
+
expect(subject.bibtex_type).to eq("article")
|
60
|
+
expect(subject.ris_type).to eq("JOUR")
|
61
|
+
expect(subject.citeproc_type).to eq("article-journal")
|
56
62
|
expect(subject.resource_type_general).to eq("Text")
|
57
63
|
expect(subject.author.length).to eq(5)
|
58
64
|
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Markus Ralser", "givenName"=>"Markus", "familyName"=>"Ralser")
|
@@ -76,6 +82,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
76
82
|
expect(subject.b_url).to eq("http://biorxiv.org/lookup/doi/10.1101/097196")
|
77
83
|
expect(subject.type).to eq("ScholarlyArticle")
|
78
84
|
expect(subject.additional_type).to eq("PostedContent")
|
85
|
+
expect(subject.bibtex_type).to eq("article")
|
86
|
+
expect(subject.ris_type).to eq("JOUR")
|
87
|
+
expect(subject.citeproc_type).to eq("article-journal")
|
79
88
|
expect(subject.resource_type_general).to eq("Text")
|
80
89
|
expect(subject.author.count).to eq(11)
|
81
90
|
expect(subject.author.last).to eq("type"=>"Person", "id"=>"http://orcid.org/0000-0003-4060-7360", "name"=>"Timothy Clark", "givenName"=>"Timothy", "familyName"=>"Clark")
|
@@ -160,6 +169,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
160
169
|
expect(subject.type).to eq("ScholarlyArticle")
|
161
170
|
expect(subject.additional_type).to eq("SaComponent")
|
162
171
|
expect(subject.resource_type_general).to eq("Text")
|
172
|
+
expect(subject.bibtex_type).to eq("misc")
|
173
|
+
expect(subject.ris_type).to eq("JOUR")
|
174
|
+
expect(subject.citeproc_type).to eq("article-journal")
|
163
175
|
expect(subject.author.length).to eq(2)
|
164
176
|
expect(subject.author.first).to eq("type"=>"Person", "name"=>"G. Fermi", "givenName"=>"G.", "familyName"=>"Fermi")
|
165
177
|
expect(subject.title).to eq("THE CRYSTAL STRUCTURE OF HUMAN DEOXYHAEMOGLOBIN AT 1.74 ANGSTROMS RESOLUTION")
|
@@ -180,6 +192,9 @@ describe Bolognese::Metadata, vcr: true do
|
|
180
192
|
expect(subject.type).to eq("Chapter")
|
181
193
|
expect(subject.additional_type).to eq("BookChapter")
|
182
194
|
expect(subject.resource_type_general).to eq("Text")
|
195
|
+
expect(subject.bibtex_type).to eq("inbook")
|
196
|
+
expect(subject.ris_type).to eq("CHAP")
|
197
|
+
expect(subject.citeproc_type).to eq("chapter")
|
183
198
|
expect(subject.author.length).to eq(2)
|
184
199
|
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Ronald L. Diercks", "givenName"=>"Ronald L.", "familyName"=>"Diercks")
|
185
200
|
expect(subject.title).to eq("Clinical Symptoms and Physical Examinations")
|
@@ -21,6 +21,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
21
21
|
expect(subject.type).to eq("Dataset")
|
22
22
|
expect(subject.additional_type).to eq("DataPackage")
|
23
23
|
expect(subject.resource_type_general).to eq("Dataset")
|
24
|
+
expect(subject.ris_type).to eq("DATA")
|
25
|
+
expect(subject.citeproc_type).to eq("dataset")
|
24
26
|
expect(subject.author.length).to eq(8)
|
25
27
|
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Benjamin Ollomo", "givenName"=>"Benjamin", "familyName"=>"Ollomo")
|
26
28
|
expect(subject.title).to eq("Data from: A new malaria agent in African hominids.")
|
@@ -42,6 +44,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
42
44
|
expect(subject.type).to eq("ScholarlyArticle")
|
43
45
|
expect(subject.additional_type).to eq("BlogPosting")
|
44
46
|
expect(subject.resource_type_general).to eq("Text")
|
47
|
+
expect(subject.ris_type).to eq("RPRT")
|
48
|
+
expect(subject.citeproc_type).to eq("article-journal")
|
45
49
|
expect(subject.author).to eq("type"=>"Person", "id"=>"https://orcid.org/0000-0003-1419-2405", "name"=>"Fenner, Martin", "givenName"=>"Martin", "familyName"=>"Fenner")
|
46
50
|
expect(subject.title).to eq("Eating your own Dog Food")
|
47
51
|
expect(subject.alternate_name).to eq("type"=>"Local accession number", "name"=>"MS-49-3632-5083")
|
@@ -79,6 +83,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
79
83
|
expect(subject.identifier).to eq("https://doi.org/10.5281/zenodo.48440")
|
80
84
|
expect(subject.type).to eq("SoftwareSourceCode")
|
81
85
|
expect(subject.resource_type_general).to eq("Software")
|
86
|
+
expect(subject.ris_type).to eq("COMP")
|
87
|
+
expect(subject.citeproc_type).to eq("article")
|
82
88
|
expect(subject.author).to eq("type"=>"Person", "name"=>"Kristian Garza", "givenName"=>"Kristian", "familyName"=>"Garza")
|
83
89
|
expect(subject.title).to eq("Analysis Tools For Crossover Experiment Of Ui Using Choice Architecture")
|
84
90
|
expect(subject.description["text"]).to start_with("This tools are used to analyse the data produced by the Crosssover Experiment")
|
@@ -203,6 +209,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
203
209
|
expect(subject.type).to eq("Collection")
|
204
210
|
expect(subject.additional_type).to eq("Project")
|
205
211
|
expect(subject.resource_type_general).to eq("Collection")
|
212
|
+
expect(subject.ris_type).to eq("GEN")
|
213
|
+
expect(subject.citeproc_type).to eq("article")
|
206
214
|
expect(subject.author.length).to eq(24)
|
207
215
|
expect(subject.author.first).to eq("type"=>"Person", "id"=>"https://orcid.org/0000-0001-5331-6592", "name"=>"Farquhar, Adam", "givenName"=>"Adam", "familyName"=>"Farquhar")
|
208
216
|
expect(subject.title).to eq("Technical and Human Infrastructure for Open Research (THOR)")
|
@@ -226,6 +234,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
226
234
|
expect(subject.type).to eq("ScholarlyArticle")
|
227
235
|
expect(subject.additional_type).to eq("BlogPosting")
|
228
236
|
expect(subject.resource_type_general).to eq("Text")
|
237
|
+
expect(subject.ris_type).to eq("RPRT")
|
238
|
+
expect(subject.citeproc_type).to eq("article-journal")
|
229
239
|
expect(subject.author).to eq("type"=>"Person", "id"=>"https://orcid.org/0000-0003-1419-2405", "name"=>"Fenner, Martin", "givenName"=>"Martin", "familyName"=>"Fenner")
|
230
240
|
expect(subject.title).to eq("Eating your own Dog Food")
|
231
241
|
expect(subject.alternate_name).to eq("type"=>"Local accession number", "name"=>"MS-49-3632-5083")
|
@@ -244,6 +254,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
244
254
|
expect(subject.type).to eq("Book")
|
245
255
|
expect(subject.additional_type).to eq("Monograph")
|
246
256
|
expect(subject.resource_type_general).to eq("Text")
|
257
|
+
expect(subject.ris_type).to eq("BOOK")
|
258
|
+
expect(subject.citeproc_type).to eq("book")
|
247
259
|
expect(subject.author).to eq([{"type"=>"Person", "name"=>"John Smith", "givenName"=>"John", "familyName"=>"Smith"}, {"name"=>"つまらないものですが"}])
|
248
260
|
expect(subject.title).to eq(["Właściwości rzutowań podprzestrzeniowych", {"title_type"=>"TranslatedTitle", "text"=>"Translation of Polish titles"}])
|
249
261
|
expect(subject.alternate_name).to eq("type"=>"ISBN", "name"=>"937-0-4523-12357-6")
|
@@ -370,6 +382,8 @@ describe Bolognese::Metadata, vcr: true do
|
|
370
382
|
expect(subject.identifier).to eq("https://handle.test.datacite.org/10.21956/gatesopenres.530.r190")
|
371
383
|
expect(subject.type).to eq("ScholarlyArticle")
|
372
384
|
expect(subject.resource_type_general).to eq("Text")
|
385
|
+
expect(subject.ris_type).to eq("RPRT")
|
386
|
+
expect(subject.citeproc_type).to eq("article-journal")
|
373
387
|
expect(subject.author.length).to eq(5)
|
374
388
|
expect(subject.author.first).to eq("type"=>"Person", "name"=>"Lina Patel", "givenName"=>"Lina", "familyName"=>"Patel")
|
375
389
|
expect(subject.title).to eq("Referee report. For: Gates - add article keywords to the metatags [version 2; referees: 1 approved]")
|