bolognese 0.10.11 → 0.10.13
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/utils.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/jats_writer.rb +4 -4
- data/lib/bolognese/writers/ris_writer.rb +1 -1
- data/spec/find_from_format_spec.rb +41 -0
- data/spec/fixtures/crossref.ris +14 -14
- data/spec/writers/ris_writer_spec.rb +119 -119
- 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: 79fc464475180572a3df9c0709a83f71319fb374212ec3851c040950c854cd90
|
4
|
+
data.tar.gz: 7d6bfbfa0d71f56fd4d1a0bed880085fb8e66b311411aace5cc0c4bb6f3aec1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8866c31db8232b9fadd4255f48332ccc04db1cd865770cdc122c210e030be70188df90cceb9371908c519649a457e3902fca77d8287ecdda5f7bcc257bb7612
|
7
|
+
data.tar.gz: d4328db6ffbf8094d7676c283c819c335959c487884abf01af8afbbdfa7e7c7b6c182dd75f56623483220116b1e08e6a753fb786a2e46c38744b933822c83a25
|
data/Gemfile.lock
CHANGED
data/lib/bolognese/utils.rb
CHANGED
@@ -382,7 +382,7 @@ module Bolognese
|
|
382
382
|
"schema_org"
|
383
383
|
elsif Maremma.from_json(string).to_h.dig("@context") == ("https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld")
|
384
384
|
"codemeta"
|
385
|
-
elsif string.start_with?("TY
|
385
|
+
elsif string.start_with?("TY - ")
|
386
386
|
"ris"
|
387
387
|
elsif BibTeX.parse(string).first
|
388
388
|
"bibtex"
|
data/lib/bolognese/version.rb
CHANGED
@@ -67,9 +67,9 @@ module Bolognese
|
|
67
67
|
|
68
68
|
def insert_citation_title(xml)
|
69
69
|
case publication_type.fetch('publication-type', nil)
|
70
|
-
when "data" then xml.send("data-title", title)
|
71
|
-
when "journal" then xml.send("article-title", title)
|
72
|
-
when "chapter" then xml.send("chapter-title", title)
|
70
|
+
when "data" then xml.send("data-title", parse_attributes(title, content: "text", first: true))
|
71
|
+
when "journal" then xml.send("article-title", parse_attributes(title, content: "text", first: true))
|
72
|
+
when "chapter" then xml.send("chapter-title", parse_attributes(title, content: "text", first: true))
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
@@ -77,7 +77,7 @@ module Bolognese
|
|
77
77
|
if is_article? || is_data? || is_chapter?
|
78
78
|
xml.source(container_title || publisher)
|
79
79
|
else
|
80
|
-
xml.source(title)
|
80
|
+
xml.source(parse_attributes(title, content: "text", first: true))
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
@@ -20,7 +20,7 @@ module Bolognese
|
|
20
20
|
"SP" => first_page,
|
21
21
|
"EP" => last_page,
|
22
22
|
"ER" => ""
|
23
|
-
}.compact.map { |k, v| v.is_a?(Array) ? v.map { |vi| "#{k}
|
23
|
+
}.compact.map { |k, v| v.is_a?(Array) ? v.map { |vi| "#{k} - #{vi}" }.join("\r\n") : "#{k} - #{v}" }.join("\r\n")
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -27,4 +27,45 @@ describe Bolognese::CLI do
|
|
27
27
|
expect(subject.find_from_format_by_id(id)).to eq("schema_org")
|
28
28
|
end
|
29
29
|
end
|
30
|
+
|
31
|
+
context "find_from_format_by_string" do
|
32
|
+
let(:subject) do
|
33
|
+
described_class.new
|
34
|
+
end
|
35
|
+
|
36
|
+
it "crossref" do
|
37
|
+
string = IO.read(fixture_path + 'crossref.xml').strip
|
38
|
+
expect(subject.find_from_format_by_string(string)).to eq("crossref")
|
39
|
+
end
|
40
|
+
|
41
|
+
it "datacite" do
|
42
|
+
string = IO.read(fixture_path + 'datacite.xml').strip
|
43
|
+
expect(subject.find_from_format_by_string(string)).to eq("datacite")
|
44
|
+
end
|
45
|
+
|
46
|
+
it "codemeta" do
|
47
|
+
string = IO.read(fixture_path + 'codemeta.json').strip
|
48
|
+
expect(subject.find_from_format_by_string(string)).to eq("codemeta")
|
49
|
+
end
|
50
|
+
|
51
|
+
it "schema_org" do
|
52
|
+
string = IO.read(fixture_path + 'schema_org.json').strip
|
53
|
+
expect(subject.find_from_format_by_string(string)).to eq("schema_org")
|
54
|
+
end
|
55
|
+
|
56
|
+
it "ris" do
|
57
|
+
string = IO.read(fixture_path + 'crossref.ris').strip
|
58
|
+
expect(subject.find_from_format_by_string(string)).to eq("ris")
|
59
|
+
end
|
60
|
+
|
61
|
+
it "ris from pure" do
|
62
|
+
string = IO.read(fixture_path + 'pure.ris').strip
|
63
|
+
expect(subject.find_from_format_by_string(string)).to eq("ris")
|
64
|
+
end
|
65
|
+
|
66
|
+
it "bibtex" do
|
67
|
+
string = IO.read(fixture_path + 'crossref.bib').strip
|
68
|
+
expect(subject.find_from_format_by_string(string)).to eq("bibtex")
|
69
|
+
end
|
70
|
+
end
|
30
71
|
end
|
data/spec/fixtures/crossref.ris
CHANGED
@@ -1,14 +1,14 @@
|
|
1
|
-
TY
|
2
|
-
T1
|
3
|
-
T2
|
4
|
-
AU
|
5
|
-
AU
|
6
|
-
AU
|
7
|
-
AU
|
8
|
-
AU
|
9
|
-
DO
|
10
|
-
UR
|
11
|
-
AB
|
12
|
-
PY
|
13
|
-
VL
|
14
|
-
ER
|
1
|
+
TY - JOUR
|
2
|
+
T1 - Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth
|
3
|
+
T2 - eLife
|
4
|
+
AU - Sankar, Martial
|
5
|
+
AU - Nieminen, Kaisa
|
6
|
+
AU - Ragni, Laura
|
7
|
+
AU - Xenarios, Ioannis
|
8
|
+
AU - Hardtke, Christian S
|
9
|
+
DO - 10.7554/eLife.01567
|
10
|
+
UR - http://elifesciences.org/lookup/doi/10.7554/eLife.01567
|
11
|
+
AB - Among various advantages, their small size makes model organisms preferred subjects of investigation. Yet, even in model systems detailed analysis of numerous developmental processes at cellular level is severely hampered by their scale.
|
12
|
+
PY - 2014
|
13
|
+
VL - 3
|
14
|
+
ER -
|
@@ -7,16 +7,16 @@ describe Bolognese::Metadata, vcr: true do
|
|
7
7
|
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
8
8
|
expect(subject.valid?).to be true
|
9
9
|
ris = subject.ris.split("\r\n")
|
10
|
-
expect(ris[0]).to eq("TY
|
11
|
-
expect(ris[1]).to eq("T1
|
12
|
-
expect(ris[2]).to eq("T2
|
13
|
-
expect(ris[3]).to eq("AU
|
14
|
-
expect(ris[8]).to eq("DO
|
15
|
-
expect(ris[9]).to eq("UR
|
16
|
-
expect(ris[10]).to start_with("AB
|
17
|
-
expect(ris[11]).to eq("PY
|
18
|
-
expect(ris[12]).to eq("VL
|
19
|
-
expect(ris[13]).to eq("ER
|
10
|
+
expect(ris[0]).to eq("TY - JOUR")
|
11
|
+
expect(ris[1]).to eq("T1 - Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
12
|
+
expect(ris[2]).to eq("T2 - eLife")
|
13
|
+
expect(ris[3]).to eq("AU - Sankar, Martial")
|
14
|
+
expect(ris[8]).to eq("DO - 10.7554/elife.01567")
|
15
|
+
expect(ris[9]).to eq("UR - https://elifesciences.org/articles/01567")
|
16
|
+
expect(ris[10]).to start_with("AB - Among various advantages")
|
17
|
+
expect(ris[11]).to eq("PY - 2014")
|
18
|
+
expect(ris[12]).to eq("VL - 3")
|
19
|
+
expect(ris[13]).to eq("ER - ")
|
20
20
|
end
|
21
21
|
|
22
22
|
it "with pages" do
|
@@ -24,18 +24,18 @@ describe Bolognese::Metadata, vcr: true do
|
|
24
24
|
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
25
25
|
expect(subject.valid?).to be true
|
26
26
|
ris = subject.ris.split("\r\n")
|
27
|
-
expect(ris[0]).to eq("TY
|
28
|
-
expect(ris[1]).to eq("T1
|
29
|
-
expect(ris[2]).to eq("T2
|
30
|
-
expect(ris[3]).to eq("AU
|
31
|
-
expect(ris[10]).to eq("DO
|
32
|
-
expect(ris[11]).to eq("UR
|
33
|
-
expect(ris[12]).to start_with("AB
|
34
|
-
expect(ris[13]).to eq("PY
|
35
|
-
expect(ris[14]).to eq("VL
|
36
|
-
expect(ris[15]).to eq("SP
|
37
|
-
expect(ris[16]).to eq("EP
|
38
|
-
expect(ris[17]).to eq("ER
|
27
|
+
expect(ris[0]).to eq("TY - JOUR")
|
28
|
+
expect(ris[1]).to eq("T1 - Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers")
|
29
|
+
expect(ris[2]).to eq("T2 - Pulmonary Medicine")
|
30
|
+
expect(ris[3]).to eq("AU - Thanassi, Wendy")
|
31
|
+
expect(ris[10]).to eq("DO - 10.1155/2012/291294")
|
32
|
+
expect(ris[11]).to eq("UR - http://www.hindawi.com/journals/pm/2012/291294/")
|
33
|
+
expect(ris[12]).to start_with("AB - . To find a statistically significant separation point for the QuantiFERON")
|
34
|
+
expect(ris[13]).to eq("PY - 2012")
|
35
|
+
expect(ris[14]).to eq("VL - 2012")
|
36
|
+
expect(ris[15]).to eq("SP - 1")
|
37
|
+
expect(ris[16]).to eq("EP - 7")
|
38
|
+
expect(ris[17]).to eq("ER - ")
|
39
39
|
end
|
40
40
|
|
41
41
|
it "alternate name" do
|
@@ -43,34 +43,34 @@ describe Bolognese::Metadata, vcr: true do
|
|
43
43
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
44
44
|
expect(subject.valid?).to be true
|
45
45
|
ris = subject.ris.split("\r\n")
|
46
|
-
expect(ris[0]).to eq("TY
|
47
|
-
expect(ris[1]).to eq("T1
|
48
|
-
expect(ris[2]).to eq("AU
|
49
|
-
expect(ris[8]).to eq("DO
|
50
|
-
expect(ris[9]).to start_with("AB
|
51
|
-
expect(ris[10]).to eq("KW
|
52
|
-
expect(ris[20]).to eq("PY
|
53
|
-
expect(ris[21]).to eq("PB
|
54
|
-
expect(ris[22]).to eq("AN
|
55
|
-
expect(ris[24]).to eq("LA
|
56
|
-
expect(ris[25]).to eq("ER
|
46
|
+
expect(ris[0]).to eq("TY - RPRT")
|
47
|
+
expect(ris[1]).to eq("T1 - Visions and reality: the idea of competence-oriented assessment for German medical students is not yet realised in licensing examinations")
|
48
|
+
expect(ris[2]).to eq("AU - Huber-Lang, Markus")
|
49
|
+
expect(ris[8]).to eq("DO - 10.3205/zma001102")
|
50
|
+
expect(ris[9]).to start_with("AB - Objective: Competence orientation")
|
51
|
+
expect(ris[10]).to eq("KW - medical competence")
|
52
|
+
expect(ris[20]).to eq("PY - 2017")
|
53
|
+
expect(ris[21]).to eq("PB - German Medical Science GMS Publishing House")
|
54
|
+
expect(ris[22]).to eq("AN - urn:nbn:de:0183-zma0011024")
|
55
|
+
expect(ris[24]).to eq("LA - en")
|
56
|
+
expect(ris[25]).to eq("ER - ")
|
57
57
|
end
|
58
58
|
|
59
59
|
it "Crossref DOI" do
|
60
60
|
input = fixture_path + "crossref.bib"
|
61
61
|
subject = Bolognese::Metadata.new(input: input, from: "bibtex")
|
62
62
|
ris = subject.ris.split("\r\n")
|
63
|
-
expect(ris[0]).to eq("TY
|
64
|
-
expect(ris[1]).to eq("T1
|
65
|
-
expect(ris[2]).to eq("T2
|
66
|
-
expect(ris[3]).to eq("AU
|
67
|
-
expect(ris[8]).to eq("DO
|
68
|
-
expect(ris[9]).to eq("UR
|
69
|
-
expect(ris[10]).to eq("AB
|
70
|
-
expect(ris[11]).to eq("PY
|
71
|
-
expect(ris[12]).to eq("PB
|
72
|
-
expect(ris[13]).to eq("VL
|
73
|
-
expect(ris[14]).to eq("ER
|
63
|
+
expect(ris[0]).to eq("TY - JOUR")
|
64
|
+
expect(ris[1]).to eq("T1 - Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth")
|
65
|
+
expect(ris[2]).to eq("T2 - eLife")
|
66
|
+
expect(ris[3]).to eq("AU - Sankar, Martial")
|
67
|
+
expect(ris[8]).to eq("DO - 10.7554/elife.01567")
|
68
|
+
expect(ris[9]).to eq("UR - http://elifesciences.org/lookup/doi/10.7554/eLife.01567")
|
69
|
+
expect(ris[10]).to eq("AB - Among various advantages, their small size makes model organisms preferred subjects of investigation. Yet, even in model systems detailed analysis of numerous developmental processes at cellular level is severely hampered by their scale.")
|
70
|
+
expect(ris[11]).to eq("PY - 2014")
|
71
|
+
expect(ris[12]).to eq("PB - {eLife} Sciences Organisation, Ltd.")
|
72
|
+
expect(ris[13]).to eq("VL - 3")
|
73
|
+
expect(ris[14]).to eq("ER - ")
|
74
74
|
end
|
75
75
|
|
76
76
|
it "BlogPosting" do
|
@@ -78,67 +78,67 @@ describe Bolognese::Metadata, vcr: true do
|
|
78
78
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
79
79
|
expect(subject.valid?).to be true
|
80
80
|
ris = subject.ris.split("\r\n")
|
81
|
-
expect(ris[0]).to eq("TY
|
82
|
-
expect(ris[1]).to eq("T1
|
83
|
-
expect(ris[2]).to eq("AU
|
84
|
-
expect(ris[3]).to eq("DO
|
85
|
-
expect(ris[4]).to eq("AB
|
86
|
-
expect(ris[5]).to eq("KW
|
87
|
-
expect(ris[8]).to eq("PY
|
88
|
-
expect(ris[9]).to eq("PB
|
89
|
-
expect(ris[10]).to eq("AN
|
90
|
-
expect(ris[11]).to eq("ER
|
81
|
+
expect(ris[0]).to eq("TY - RPRT")
|
82
|
+
expect(ris[1]).to eq("T1 - Eating your own Dog Food")
|
83
|
+
expect(ris[2]).to eq("AU - Fenner, Martin")
|
84
|
+
expect(ris[3]).to eq("DO - 10.5438/4k3m-nyvg")
|
85
|
+
expect(ris[4]).to eq("AB - Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...")
|
86
|
+
expect(ris[5]).to eq("KW - datacite")
|
87
|
+
expect(ris[8]).to eq("PY - 2016")
|
88
|
+
expect(ris[9]).to eq("PB - DataCite")
|
89
|
+
expect(ris[10]).to eq("AN - MS-49-3632-5083")
|
90
|
+
expect(ris[11]).to eq("ER - ")
|
91
91
|
end
|
92
92
|
|
93
93
|
it "BlogPosting Citeproc JSON" do
|
94
94
|
input = fixture_path + "citeproc.json"
|
95
95
|
subject = Bolognese::Metadata.new(input: input, from: "citeproc")
|
96
96
|
ris = subject.ris.split("\r\n")
|
97
|
-
expect(ris[0]).to eq("TY
|
98
|
-
expect(ris[1]).to eq("T1
|
99
|
-
expect(ris[2]).to eq("T2
|
100
|
-
expect(ris[3]).to eq("AU
|
101
|
-
expect(ris[4]).to eq("DO
|
102
|
-
expect(ris[5]).to eq("UR
|
103
|
-
expect(ris[6]).to eq("AB
|
104
|
-
expect(ris[7]).to eq("KW
|
105
|
-
expect(ris[14]).to eq("PY
|
106
|
-
expect(ris[15]).to eq("PB
|
107
|
-
expect(ris[16]).to eq("ER
|
97
|
+
expect(ris[0]).to eq("TY - GEN")
|
98
|
+
expect(ris[1]).to eq("T1 - Eating your own Dog Food")
|
99
|
+
expect(ris[2]).to eq("T2 - DataCite Blog")
|
100
|
+
expect(ris[3]).to eq("AU - Fenner, Martin")
|
101
|
+
expect(ris[4]).to eq("DO - 10.5438/4k3m-nyvg")
|
102
|
+
expect(ris[5]).to eq("UR - https://blog.datacite.org/eating-your-own-dog-food")
|
103
|
+
expect(ris[6]).to eq("AB - Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...")
|
104
|
+
expect(ris[7]).to eq("KW - Phylogeny")
|
105
|
+
expect(ris[14]).to eq("PY - 2016")
|
106
|
+
expect(ris[15]).to eq("PB - DataCite")
|
107
|
+
expect(ris[16]).to eq("ER - ")
|
108
108
|
end
|
109
109
|
|
110
110
|
it "BlogPosting DataCite JSON" do
|
111
111
|
input = fixture_path + "datacite.json"
|
112
112
|
subject = Bolognese::Metadata.new(input: input, from: "datacite_json")
|
113
113
|
ris = subject.ris.split("\r\n")
|
114
|
-
expect(ris[0]).to eq("TY
|
115
|
-
expect(ris[1]).to eq("T1
|
116
|
-
expect(ris[2]).to eq("AU
|
117
|
-
expect(ris[3]).to eq("DO
|
118
|
-
expect(ris[4]).to eq("AB
|
119
|
-
expect(ris[5]).to eq("KW
|
120
|
-
expect(ris[8]).to eq("PY
|
121
|
-
expect(ris[9]).to eq("PB
|
122
|
-
expect(ris[10]).to eq("AN
|
123
|
-
expect(ris[11]).to eq("ER
|
114
|
+
expect(ris[0]).to eq("TY - GEN")
|
115
|
+
expect(ris[1]).to eq("T1 - Eating your own Dog Food")
|
116
|
+
expect(ris[2]).to eq("AU - Fenner, Martin")
|
117
|
+
expect(ris[3]).to eq("DO - 10.5438/4k3m-nyvg")
|
118
|
+
expect(ris[4]).to eq("AB - Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...")
|
119
|
+
expect(ris[5]).to eq("KW - datacite")
|
120
|
+
expect(ris[8]).to eq("PY - 2016")
|
121
|
+
expect(ris[9]).to eq("PB - DataCite")
|
122
|
+
expect(ris[10]).to eq("AN - MS-49-3632-5083")
|
123
|
+
expect(ris[11]).to eq("ER - ")
|
124
124
|
end
|
125
125
|
|
126
126
|
it "BlogPosting schema.org" do
|
127
127
|
input = "https://blog.datacite.org/eating-your-own-dog-food/"
|
128
128
|
subject = Bolognese::Metadata.new(input: input, from: "schema_org")
|
129
129
|
ris = subject.ris.split("\r\n")
|
130
|
-
expect(ris[0]).to eq("TY
|
131
|
-
expect(ris[1]).to eq("T1
|
132
|
-
expect(ris[2]).to eq("T2
|
133
|
-
expect(ris[3]).to eq("AU
|
134
|
-
expect(ris[4]).to eq("DO
|
135
|
-
expect(ris[5]).to eq("UR
|
136
|
-
expect(ris[6]).to eq("AB
|
137
|
-
expect(ris[7]).to eq("KW
|
138
|
-
expect(ris[11]).to eq("PY
|
139
|
-
expect(ris[12]).to eq("PB
|
140
|
-
expect(ris[13]).to eq("AN
|
141
|
-
expect(ris[14]).to eq("ER
|
130
|
+
expect(ris[0]).to eq("TY - GEN")
|
131
|
+
expect(ris[1]).to eq("T1 - Eating your own Dog Food")
|
132
|
+
expect(ris[2]).to eq("T2 - DataCite Blog")
|
133
|
+
expect(ris[3]).to eq("AU - Fenner, Martin")
|
134
|
+
expect(ris[4]).to eq("DO - 10.5438/4k3m-nyvg")
|
135
|
+
expect(ris[5]).to eq("UR - https://blog.datacite.org/eating-your-own-dog-food")
|
136
|
+
expect(ris[6]).to eq("AB - Eating your own dog food is a slang term to describe that an organization should itself use the products and services it provides. For DataCite this means that we should use DOIs with appropriate metadata and strategies for long-term preservation for...")
|
137
|
+
expect(ris[7]).to eq("KW - datacite")
|
138
|
+
expect(ris[11]).to eq("PY - 2016")
|
139
|
+
expect(ris[12]).to eq("PB - DataCite")
|
140
|
+
expect(ris[13]).to eq("AN - MS-49-3632-5083")
|
141
|
+
expect(ris[14]).to eq("ER - ")
|
142
142
|
end
|
143
143
|
|
144
144
|
it "Dataset" do
|
@@ -146,50 +146,50 @@ describe Bolognese::Metadata, vcr: true do
|
|
146
146
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
147
147
|
expect(subject.valid?).to be true
|
148
148
|
ris = subject.ris.split("\r\n")
|
149
|
-
expect(ris[0]).to eq("TY
|
150
|
-
expect(ris[1]).to eq("T1
|
151
|
-
expect(ris[2]).to eq("AU
|
152
|
-
expect(ris[10]).to eq("DO
|
153
|
-
expect(ris[11]).to eq("UR
|
154
|
-
expect(ris[13]).to eq("KW
|
155
|
-
expect(ris[19]).to eq("PY
|
156
|
-
expect(ris[20]).to eq("PB
|
157
|
-
expect(ris[21]).to eq("AN
|
158
|
-
expect(ris[22]).to eq("ER
|
149
|
+
expect(ris[0]).to eq("TY - DATA")
|
150
|
+
expect(ris[1]).to eq("T1 - Data from: A new malaria agent in African hominids.")
|
151
|
+
expect(ris[2]).to eq("AU - Ollomo, Benjamin")
|
152
|
+
expect(ris[10]).to eq("DO - 10.5061/dryad.8515")
|
153
|
+
expect(ris[11]).to eq("UR - http://datadryad.org/resource/doi:10.5061/dryad.8515")
|
154
|
+
expect(ris[13]).to eq("KW - Malaria")
|
155
|
+
expect(ris[19]).to eq("PY - 2011")
|
156
|
+
expect(ris[20]).to eq("PB - Dryad Digital Repository")
|
157
|
+
expect(ris[21]).to eq("AN - Ollomo B, Durand P, Prugnolle F, Douzery EJP, Arnathau C, Nkoghe D, Leroy E, Renaud F (2009) A new malaria agent in African hominids. PLoS Pathogens 5(5): e1000446.")
|
158
|
+
expect(ris[22]).to eq("ER - ")
|
159
159
|
end
|
160
160
|
|
161
161
|
it "maremma" do
|
162
162
|
input = "https://github.com/datacite/maremma"
|
163
163
|
subject = Bolognese::Metadata.new(input: input, from: "codemeta")
|
164
164
|
ris = subject.ris.split("\r\n")
|
165
|
-
expect(ris[0]).to eq("TY
|
166
|
-
expect(ris[1]).to eq("T1
|
167
|
-
expect(ris[2]).to eq("AU
|
168
|
-
expect(ris[3]).to eq("DO
|
169
|
-
expect(ris[4]).to eq("UR
|
170
|
-
expect(ris[5]).to eq("AB
|
171
|
-
expect(ris[6]).to eq("KW
|
172
|
-
expect(ris[9]).to eq("PY
|
173
|
-
expect(ris[10]).to eq("PB
|
174
|
-
expect(ris[11]).to eq("ER
|
165
|
+
expect(ris[0]).to eq("TY - COMP")
|
166
|
+
expect(ris[1]).to eq("T1 - Maremma: a Ruby library for simplified network calls")
|
167
|
+
expect(ris[2]).to eq("AU - Fenner, Martin")
|
168
|
+
expect(ris[3]).to eq("DO - 10.5438/qeg0-3gm3")
|
169
|
+
expect(ris[4]).to eq("UR - https://github.com/datacite/maremma")
|
170
|
+
expect(ris[5]).to eq("AB - Ruby utility library for network requests. Based on Faraday and Excon, provides a wrapper for XML/JSON parsing and error handling. All successful responses are returned as hash with key data, all errors in a JSONAPI-friendly hash with key errors.")
|
171
|
+
expect(ris[6]).to eq("KW - faraday")
|
172
|
+
expect(ris[9]).to eq("PY - 2017")
|
173
|
+
expect(ris[10]).to eq("PB - DataCite")
|
174
|
+
expect(ris[11]).to eq("ER - ")
|
175
175
|
end
|
176
176
|
|
177
177
|
it "keywords with subject scheme" do
|
178
178
|
input = "https://doi.org/10.1594/pangaea.721193"
|
179
179
|
subject = Bolognese::Metadata.new(input: input, from: "datacite")
|
180
180
|
ris = subject.ris.split("\r\n")
|
181
|
-
expect(ris[0]).to eq("TY
|
182
|
-
expect(ris[1]).to eq("T1
|
183
|
-
expect(ris[2]).to eq("AU
|
184
|
-
expect(ris[5]).to eq("DO
|
185
|
-
expect(ris[6]).to eq("UR
|
186
|
-
expect(ris[8]).to eq("KW
|
187
|
-
expect(ris[9]).to eq("KW
|
188
|
-
expect(ris[10]).to eq("KW
|
189
|
-
expect(ris[49]).to eq("PY
|
190
|
-
expect(ris[50]).to eq("PB
|
191
|
-
expect(ris[51]).to eq("LA
|
192
|
-
expect(ris[52]).to eq("ER
|
181
|
+
expect(ris[0]).to eq("TY - DATA")
|
182
|
+
expect(ris[1]).to eq("T1 - Seawater carbonate chemistry and processes during experiments with Crassostrea gigas, 2007, supplement to: Kurihara, Haruko; Kato, Shoji; Ishimatsu, Atsushi (2007): Effects of increased seawater pCO2 on early development of the oyster Crassostrea gigas. Aquatic Biology, 1(1), 91-98")
|
183
|
+
expect(ris[2]).to eq("AU - Kurihara, Haruko")
|
184
|
+
expect(ris[5]).to eq("DO - 10.1594/pangaea.721193")
|
185
|
+
expect(ris[6]).to eq("UR - https://doi.pangaea.de/10.1594/PANGAEA.721193")
|
186
|
+
expect(ris[8]).to eq("KW - GetInfo")
|
187
|
+
expect(ris[9]).to eq("KW - Animalia")
|
188
|
+
expect(ris[10]).to eq("KW - Bottles or small containers/Aquaria ( 20 L)")
|
189
|
+
expect(ris[49]).to eq("PY - 2007")
|
190
|
+
expect(ris[50]).to eq("PB - PANGAEA - Data Publisher for Earth & Environmental Science")
|
191
|
+
expect(ris[51]).to eq("LA - eng")
|
192
|
+
expect(ris[52]).to eq("ER - ")
|
193
193
|
end
|
194
194
|
end
|
195
195
|
end
|