bolognese 0.10.9 → 0.10.10
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 +1 -1
- data/lib/bolognese/readers/bibtex_reader.rb +5 -4
- data/lib/bolognese/utils.rb +9 -0
- data/lib/bolognese/version.rb +1 -1
- data/spec/readers/bibtex_reader_spec.rb +3 -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: 31795668efc6bad81388f9f79652de6cb361fc6290f0d60774a030354700a4af
|
|
4
|
+
data.tar.gz: 9d5915a5d65c5bb5d1e3eeb5c1591f781cdfee0c85c2f6d23350d09558b17eb6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d561eae35321a45ec22d678d911777c7102883bafa6b9b4c94306bd5291c73fac0cd98e53b59e5f8dce15a36456b554b8ef9a08cd757856b3df2a79b22a2bf9
|
|
7
|
+
data.tar.gz: 771b6bb4d55d9447163f42e97ed944ab000b227b60d9ccde99c3fd8776d9afbe8cf73165fac0b3fa7296f6ba525aab94fc9ecd94fab6bdd6ff7f71caeb62a964
|
data/Gemfile.lock
CHANGED
|
@@ -27,8 +27,8 @@ module Bolognese
|
|
|
27
27
|
def read_bibtex(string: nil, **options)
|
|
28
28
|
meta = string.present? ? BibTeX.parse(string).first : OpenStruct.new
|
|
29
29
|
|
|
30
|
-
type = BIB_TO_SO_TRANSLATIONS[meta.type.to_s] || "ScholarlyArticle"
|
|
31
|
-
doi = meta.try(:doi)
|
|
30
|
+
type = BIB_TO_SO_TRANSLATIONS[meta.try(:type).to_s] || "ScholarlyArticle"
|
|
31
|
+
doi = meta.try(:doi).to_s.presence
|
|
32
32
|
|
|
33
33
|
author = Array(meta.try(:author)).map do |a|
|
|
34
34
|
{ "type" => "Person",
|
|
@@ -51,9 +51,10 @@ module Bolognese
|
|
|
51
51
|
{ "id" => normalize_doi(doi),
|
|
52
52
|
"type" => type,
|
|
53
53
|
"bibtex_type" => meta.type.to_s,
|
|
54
|
-
"citeproc_type" => BIB_TO_CP_TRANSLATIONS[meta.type.to_s] || "misc",
|
|
55
|
-
"ris_type" => BIB_TO_RIS_TRANSLATIONS[meta.type.to_s] || "GEN",
|
|
54
|
+
"citeproc_type" => BIB_TO_CP_TRANSLATIONS[meta.try(:type).to_s] || "misc",
|
|
55
|
+
"ris_type" => BIB_TO_RIS_TRANSLATIONS[meta.try(:type).to_s] || "GEN",
|
|
56
56
|
"resource_type_general" => Metadata::SO_TO_DC_TRANSLATIONS[type],
|
|
57
|
+
"additional_type" => Bolognese::Utils::BIB_TO_CR_TRANSLATIONS[meta.try(:type).to_s] || meta.try(:type).to_s,
|
|
57
58
|
"doi" => doi,
|
|
58
59
|
"b_url" => meta.try(:url).to_s,
|
|
59
60
|
"title" => meta.try(:title).to_s,
|
data/lib/bolognese/utils.rb
CHANGED
|
@@ -128,6 +128,15 @@ module Bolognese
|
|
|
128
128
|
"PostedContent" => "article"
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
+
BIB_TO_CR_TRANSLATIONS = {
|
|
132
|
+
"proceedings" => "Proceedings",
|
|
133
|
+
"phdthesis" => "Dissertation",
|
|
134
|
+
"article" => "JournalArticle",
|
|
135
|
+
"book" => "Book",
|
|
136
|
+
"inbook" => "BookChapter",
|
|
137
|
+
"book" => "Monograph"
|
|
138
|
+
}
|
|
139
|
+
|
|
131
140
|
CR_TO_JATS_TRANSLATIONS = {
|
|
132
141
|
"Proceedings" => "working-paper",
|
|
133
142
|
"ReferenceBook" => "book",
|
data/lib/bolognese/version.rb
CHANGED
|
@@ -47,8 +47,11 @@ describe Bolognese::Metadata, vcr: true do
|
|
|
47
47
|
expect(subject.state).to eq("not_found")
|
|
48
48
|
expect(subject.identifier).to eq("https://doi.org/10.7554/elife.01567")
|
|
49
49
|
expect(subject.bibtex_type).to eq("phdthesis")
|
|
50
|
+
expect(subject.ris_type).to eq("THES")
|
|
51
|
+
expect(subject.citeproc_type).to eq("thesis")
|
|
50
52
|
expect(subject.type).to eq("Thesis")
|
|
51
53
|
expect(subject.resource_type_general).to eq("Text")
|
|
54
|
+
expect(subject.additional_type).to eq("Dissertation")
|
|
52
55
|
expect(subject.author).to eq([{"type"=>"Person", "name"=>"Y. Toparlar", "givenName"=>"Y.", "familyName"=>"Toparlar"}])
|
|
53
56
|
expect(subject.title).to eq("A multiscale analysis of the urban heat island effect: from city averaged temperatures to the energy demand of individual buildings")
|
|
54
57
|
expect(subject.description["text"]).to start_with("Designing the climates of cities")
|