briard 2.4.2 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/codeql-analysis.yml +72 -0
- data/.github/workflows/rubocop.yml +50 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +144 -620
- data/.rubocop_todo.yml +76 -0
- data/CHANGELOG.md +18 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +43 -9
- data/Rakefile +1 -1
- data/{bolognese.gemspec → briard.gemspec} +46 -39
- data/lib/briard/array.rb +2 -2
- data/lib/briard/author_utils.rb +79 -71
- data/lib/briard/cli.rb +12 -13
- data/lib/briard/crossref_utils.rb +73 -61
- data/lib/briard/datacite_utils.rb +132 -106
- data/lib/briard/doi_utils.rb +10 -10
- data/lib/briard/metadata.rb +96 -106
- data/lib/briard/metadata_utils.rb +87 -78
- data/lib/briard/readers/bibtex_reader.rb +65 -65
- data/lib/briard/readers/cff_reader.rb +88 -70
- data/lib/briard/readers/citeproc_reader.rb +90 -84
- data/lib/briard/readers/codemeta_reader.rb +68 -50
- data/lib/briard/readers/crosscite_reader.rb +2 -2
- data/lib/briard/readers/crossref_reader.rb +249 -210
- data/lib/briard/readers/datacite_json_reader.rb +3 -3
- data/lib/briard/readers/datacite_reader.rb +225 -189
- data/lib/briard/readers/npm_reader.rb +49 -42
- data/lib/briard/readers/ris_reader.rb +82 -80
- data/lib/briard/readers/schema_org_reader.rb +182 -159
- data/lib/briard/string.rb +1 -1
- data/lib/briard/utils.rb +4 -4
- data/lib/briard/version.rb +3 -1
- data/lib/briard/whitelist_scrubber.rb +11 -4
- data/lib/briard/writers/bibtex_writer.rb +14 -8
- data/lib/briard/writers/cff_writer.rb +33 -26
- data/lib/briard/writers/codemeta_writer.rb +19 -15
- data/lib/briard/writers/csv_writer.rb +6 -4
- data/lib/briard/writers/datacite_json_writer.rb +8 -2
- data/lib/briard/writers/jats_writer.rb +33 -28
- data/lib/briard/writers/rdf_xml_writer.rb +1 -1
- data/lib/briard/writers/ris_writer.rb +30 -18
- data/lib/briard/writers/turtle_writer.rb +1 -1
- data/lib/briard.rb +6 -6
- data/rubocop.sarif +0 -0
- data/spec/array_spec.rb +5 -5
- data/spec/author_utils_spec.rb +151 -132
- data/spec/datacite_utils_spec.rb +135 -83
- data/spec/doi_utils_spec.rb +168 -164
- data/spec/find_from_format_spec.rb +69 -69
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/sanitize/onlies_keep_specific_tags.yml +65 -0
- data/spec/fixtures/vcr_cassettes/Briard_Metadata/sanitize/removes_a_tags.yml +65 -0
- data/spec/metadata_spec.rb +91 -90
- data/spec/readers/bibtex_reader_spec.rb +43 -38
- data/spec/readers/cff_reader_spec.rb +165 -153
- data/spec/readers/citeproc_reader_spec.rb +45 -40
- data/spec/readers/codemeta_reader_spec.rb +128 -115
- data/spec/readers/crosscite_reader_spec.rb +34 -24
- data/spec/readers/crossref_reader_spec.rb +1098 -939
- data/spec/readers/datacite_json_reader_spec.rb +53 -40
- data/spec/readers/datacite_reader_spec.rb +1541 -1337
- data/spec/readers/npm_reader_spec.rb +48 -43
- data/spec/readers/ris_reader_spec.rb +53 -47
- data/spec/readers/schema_org_reader_spec.rb +329 -267
- data/spec/spec_helper.rb +6 -5
- data/spec/utils_spec.rb +371 -347
- data/spec/writers/bibtex_writer_spec.rb +143 -143
- data/spec/writers/cff_writer_spec.rb +96 -90
- data/spec/writers/citation_writer_spec.rb +34 -33
- data/spec/writers/citeproc_writer_spec.rb +226 -224
- data/spec/writers/codemeta_writer_spec.rb +18 -16
- data/spec/writers/crosscite_writer_spec.rb +91 -73
- data/spec/writers/crossref_writer_spec.rb +99 -91
- data/spec/writers/csv_writer_spec.rb +70 -70
- data/spec/writers/datacite_json_writer_spec.rb +78 -68
- data/spec/writers/datacite_writer_spec.rb +417 -322
- data/spec/writers/jats_writer_spec.rb +177 -161
- data/spec/writers/rdf_xml_writer_spec.rb +68 -63
- data/spec/writers/ris_writer_spec.rb +162 -162
- data/spec/writers/schema_org_writer_spec.rb +329 -294
- data/spec/writers/turtle_writer_spec.rb +47 -47
- metadata +242 -166
- data/.github/workflows/release.yml +0 -47
@@ -3,193 +3,193 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Briard::Metadata, vcr: true do
|
6
|
-
context
|
7
|
-
it
|
8
|
-
input =
|
9
|
-
subject =
|
6
|
+
context 'write metadata as bibtex' do
|
7
|
+
it 'with data citation' do
|
8
|
+
input = '10.7554/eLife.01567'
|
9
|
+
subject = described_class.new(input: input, from: 'crossref')
|
10
10
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
11
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
12
|
-
expect(bibtex[:bibtex_key]).to eq(
|
13
|
-
expect(bibtex[:doi]).to eq(
|
14
|
-
expect(bibtex[:url]).to eq(
|
15
|
-
expect(bibtex[:title]).to eq(
|
16
|
-
expect(bibtex[:author]).to eq(
|
17
|
-
expect(bibtex[:journal]).to eq(
|
18
|
-
expect(bibtex[:year]).to eq(
|
19
|
-
expect(bibtex[:copyright]).to eq(
|
11
|
+
expect(bibtex[:bibtex_type].to_s).to eq('article')
|
12
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.7554/elife.01567')
|
13
|
+
expect(bibtex[:doi]).to eq('10.7554/elife.01567')
|
14
|
+
expect(bibtex[:url]).to eq('https://elifesciences.org/articles/01567')
|
15
|
+
expect(bibtex[:title]).to eq('Automated quantitative histology reveals vascular morphodynamics during Arabidopsis hypocotyl secondary growth')
|
16
|
+
expect(bibtex[:author]).to eq('Sankar, Martial and Nieminen, Kaisa and Ragni, Laura and Xenarios, Ioannis and Hardtke, Christian S')
|
17
|
+
expect(bibtex[:journal]).to eq('eLife')
|
18
|
+
expect(bibtex[:year]).to eq('2014')
|
19
|
+
expect(bibtex[:copyright]).to eq('Creative Commons Attribution 3.0 Unported')
|
20
20
|
end
|
21
21
|
|
22
|
-
it
|
22
|
+
it 'with schema_3' do
|
23
23
|
# input = fixture_path + "datacite_kernel_3.json"
|
24
|
-
input = fixture_path
|
25
|
-
json =
|
26
|
-
subject =
|
24
|
+
input = "#{fixture_path}datacite_schema_3.xml"
|
25
|
+
json = described_class.new(input: input, from: 'datacite')
|
26
|
+
subject = described_class.new(input: json.meta.to_json, from: 'datacite_json')
|
27
27
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
28
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
29
|
-
expect(bibtex[:bibtex_key]).to eq(
|
30
|
-
expect(bibtex[:doi]).to eq(
|
31
|
-
expect(bibtex[:year]).to eq(
|
28
|
+
expect(bibtex[:bibtex_type].to_s).to eq('misc')
|
29
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.5061/dryad.8515')
|
30
|
+
expect(bibtex[:doi]).to eq('10.5061/dryad.8515')
|
31
|
+
expect(bibtex[:year]).to eq('2011')
|
32
32
|
end
|
33
33
|
|
34
|
-
it
|
35
|
-
input =
|
36
|
-
subject =
|
34
|
+
it 'with pages' do
|
35
|
+
input = 'https://doi.org/10.1155/2012/291294'
|
36
|
+
subject = described_class.new(input: input, from: 'crossref')
|
37
37
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
38
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
39
|
-
expect(bibtex[:bibtex_key]).to eq(
|
40
|
-
expect(bibtex[:doi]).to eq(
|
41
|
-
expect(bibtex[:url]).to eq(
|
42
|
-
expect(bibtex[:title]).to eq(
|
43
|
-
expect(bibtex[:author]).to eq(
|
44
|
-
expect(bibtex[:journal]).to eq(
|
45
|
-
expect(bibtex[:pages]).to eq(
|
46
|
-
expect(bibtex[:year]).to eq(
|
47
|
-
expect(bibtex[:copyright]).to eq(
|
38
|
+
expect(bibtex[:bibtex_type].to_s).to eq('article')
|
39
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.1155/2012/291294')
|
40
|
+
expect(bibtex[:doi]).to eq('10.1155/2012/291294')
|
41
|
+
expect(bibtex[:url]).to eq('http://www.hindawi.com/journals/pm/2012/291294/')
|
42
|
+
expect(bibtex[:title]).to eq('Delineating a Retesting Zone Using Receiver Operating Characteristic Analysis on Serial QuantiFERON Tuberculosis Test Results in US Healthcare Workers')
|
43
|
+
expect(bibtex[:author]).to eq('Thanassi, Wendy and Noda, Art and Hernandez, Beatriz and Newell, Jeffery and Terpeluk, Paul and Marder, David and Yesavage, Jerome A.')
|
44
|
+
expect(bibtex[:journal]).to eq('Pulmonary Medicine')
|
45
|
+
expect(bibtex[:pages]).to eq('1-7')
|
46
|
+
expect(bibtex[:year]).to eq('2012')
|
47
|
+
expect(bibtex[:copyright]).to eq('Creative Commons Attribution 3.0 Unported')
|
48
48
|
end
|
49
49
|
|
50
|
-
it
|
51
|
-
input =
|
52
|
-
subject =
|
50
|
+
it 'text' do
|
51
|
+
input = '10.3204/desy-2014-01645'
|
52
|
+
subject = described_class.new(input: input, from: 'datacite')
|
53
53
|
expect(subject.valid?).to be true
|
54
54
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
55
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
56
|
-
expect(bibtex[:bibtex_key]).to eq(
|
57
|
-
expect(bibtex[:doi]).to eq(
|
58
|
-
expect(bibtex[:title]).to eq(
|
59
|
-
expect(bibtex[:pages]).to eq(
|
60
|
-
expect(bibtex[:year]).to eq(
|
55
|
+
expect(bibtex[:bibtex_type].to_s).to eq('phdthesis')
|
56
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.3204/desy-2014-01645')
|
57
|
+
expect(bibtex[:doi]).to eq('10.3204/desy-2014-01645')
|
58
|
+
expect(bibtex[:title]).to eq('Dynamics of colloids in molecular glass forming liquids studied via X-ray photon correlation spectroscopy')
|
59
|
+
expect(bibtex[:pages]).to eq('2014')
|
60
|
+
expect(bibtex[:year]).to eq('2014')
|
61
61
|
end
|
62
62
|
|
63
|
-
it
|
64
|
-
input =
|
65
|
-
subject =
|
63
|
+
it 'climate data' do
|
64
|
+
input = 'https://doi.org/10.5067/altcy-tj122'
|
65
|
+
subject = described_class.new(input: input, from: 'datacite')
|
66
66
|
expect(subject.valid?).to be true
|
67
67
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
68
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
69
|
-
expect(bibtex[:bibtex_key]).to eq(
|
70
|
-
expect(bibtex[:doi]).to eq(
|
71
|
-
expect(bibtex[:title]).to eq(
|
72
|
-
expect(bibtex[:pages]).to
|
68
|
+
expect(bibtex[:bibtex_type].to_s).to eq('misc')
|
69
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.5067/altcy-tj122')
|
70
|
+
expect(bibtex[:doi]).to eq('10.5067/altcy-tj122')
|
71
|
+
expect(bibtex[:title]).to eq('Integrated Multi-Mission Ocean Altimeter Data for Climate Research Version 2')
|
72
|
+
expect(bibtex[:pages].nil?).to be(true)
|
73
73
|
end
|
74
|
-
|
75
|
-
it
|
76
|
-
input =
|
77
|
-
subject =
|
74
|
+
|
75
|
+
it 'maremma' do
|
76
|
+
input = 'https://github.com/datacite/maremma'
|
77
|
+
subject = described_class.new(input: input, from: 'codemeta')
|
78
78
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
79
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
80
|
-
expect(bibtex[:bibtex_key]).to eq(
|
81
|
-
expect(bibtex[:doi]).to eq(
|
82
|
-
expect(bibtex[:url]).to eq(
|
83
|
-
expect(bibtex[:title]).to eq(
|
84
|
-
expect(bibtex[:author]).to eq(
|
85
|
-
expect(bibtex[:publisher]).to eq(
|
86
|
-
expect(bibtex[:keywords]).to eq(
|
87
|
-
expect(bibtex[:year]).to eq(
|
88
|
-
expect(bibtex[:copyright]).to eq(
|
79
|
+
expect(bibtex[:bibtex_type].to_s).to eq('misc')
|
80
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.5438/qeg0-3gm3')
|
81
|
+
expect(bibtex[:doi]).to eq('10.5438/qeg0-3gm3')
|
82
|
+
expect(bibtex[:url]).to eq('https://github.com/datacite/maremma')
|
83
|
+
expect(bibtex[:title]).to eq('Maremma: a Ruby library for simplified network calls')
|
84
|
+
expect(bibtex[:author]).to eq('Fenner, Martin')
|
85
|
+
expect(bibtex[:publisher]).to eq('DataCite')
|
86
|
+
expect(bibtex[:keywords]).to eq('faraday, excon, net/http')
|
87
|
+
expect(bibtex[:year]).to eq('2017')
|
88
|
+
expect(bibtex[:copyright]).to eq('MIT License')
|
89
89
|
end
|
90
90
|
|
91
|
-
it
|
92
|
-
input = fixture_path
|
93
|
-
subject =
|
91
|
+
it 'BlogPosting from string' do
|
92
|
+
input = "#{fixture_path}datacite.json"
|
93
|
+
subject = described_class.new(input: input, from: 'datacite_json')
|
94
94
|
expect(subject.valid?).to be true
|
95
95
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
96
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
97
|
-
expect(bibtex[:bibtex_key]).to eq(
|
98
|
-
expect(bibtex[:doi]).to eq(
|
99
|
-
expect(bibtex[:title]).to eq(
|
100
|
-
expect(bibtex[:author]).to eq(
|
101
|
-
expect(bibtex[:publisher]).to eq(
|
102
|
-
expect(bibtex[:year]).to eq(
|
96
|
+
expect(bibtex[:bibtex_type].to_s).to eq('article')
|
97
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.5438/4k3m-nyvg')
|
98
|
+
expect(bibtex[:doi]).to eq('10.5438/4k3m-nyvg')
|
99
|
+
expect(bibtex[:title]).to eq('Eating your own Dog Food')
|
100
|
+
expect(bibtex[:author]).to eq('Fenner, Martin')
|
101
|
+
expect(bibtex[:publisher]).to eq('DataCite')
|
102
|
+
expect(bibtex[:year]).to eq('2016')
|
103
103
|
end
|
104
104
|
|
105
|
-
it
|
106
|
-
input =
|
107
|
-
subject =
|
105
|
+
it 'BlogPosting' do
|
106
|
+
input = 'https://doi.org/10.5438/4K3M-NYVG'
|
107
|
+
subject = described_class.new(input: input, from: 'datacite')
|
108
108
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
109
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
110
|
-
expect(bibtex[:bibtex_key]).to eq(
|
111
|
-
expect(bibtex[:doi]).to eq(
|
112
|
-
expect(bibtex[:title]).to eq(
|
113
|
-
expect(bibtex[:author]).to eq(
|
114
|
-
expect(bibtex[:publisher]).to eq(
|
115
|
-
expect(bibtex[:year]).to eq(
|
109
|
+
expect(bibtex[:bibtex_type].to_s).to eq('article')
|
110
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.5438/4k3m-nyvg')
|
111
|
+
expect(bibtex[:doi]).to eq('10.5438/4k3m-nyvg')
|
112
|
+
expect(bibtex[:title]).to eq('Eating your own Dog Food')
|
113
|
+
expect(bibtex[:author]).to eq('Fenner, Martin')
|
114
|
+
expect(bibtex[:publisher]).to eq('DataCite')
|
115
|
+
expect(bibtex[:year]).to eq('2016')
|
116
116
|
end
|
117
117
|
|
118
|
-
it
|
119
|
-
input =
|
120
|
-
subject =
|
118
|
+
it 'Dataset' do
|
119
|
+
input = 'https://doi.org/10.5061/dryad.8515'
|
120
|
+
subject = described_class.new(input: input, from: 'datacite')
|
121
121
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
122
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
123
|
-
expect(bibtex[:bibtex_key]).to eq(
|
124
|
-
expect(bibtex[:doi]).to eq(
|
125
|
-
expect(bibtex[:title]).to eq(
|
126
|
-
expect(bibtex[:author]).to eq(
|
127
|
-
expect(bibtex[:publisher]).to eq(
|
128
|
-
expect(bibtex[:year]).to eq(
|
129
|
-
expect(bibtex[:copyright]).to eq(
|
122
|
+
expect(bibtex[:bibtex_type].to_s).to eq('misc')
|
123
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.5061/dryad.8515')
|
124
|
+
expect(bibtex[:doi]).to eq('10.5061/dryad.8515')
|
125
|
+
expect(bibtex[:title]).to eq('Data from: A new malaria agent in African hominids.')
|
126
|
+
expect(bibtex[:author]).to eq('Ollomo, Benjamin and Durand, Patrick and Prugnolle, Franck and Douzery, Emmanuel J. P. and Arnathau, Céline and Nkoghe, Dieudonné and Leroy, Eric and Renaud, François')
|
127
|
+
expect(bibtex[:publisher]).to eq('Dryad')
|
128
|
+
expect(bibtex[:year]).to eq('2011')
|
129
|
+
expect(bibtex[:copyright]).to eq('Creative Commons Zero v1.0 Universal')
|
130
130
|
end
|
131
131
|
|
132
|
-
it
|
133
|
-
input =
|
134
|
-
subject =
|
132
|
+
it 'from schema_org' do
|
133
|
+
input = 'https://blog.front-matter.io/posts/eating-your-own-dog-food/'
|
134
|
+
subject = described_class.new(input: input, from: 'schema_org')
|
135
135
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
136
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
137
|
-
expect(bibtex[:bibtex_key]).to eq(
|
138
|
-
expect(bibtex[:doi]).to eq(
|
139
|
-
expect(bibtex[:title]).to eq(
|
140
|
-
expect(bibtex[:author]).to eq(
|
141
|
-
expect(bibtex[:publisher]).to eq(
|
142
|
-
expect(bibtex[:keywords]).to eq(
|
143
|
-
expect(bibtex[:year]).to eq(
|
136
|
+
expect(bibtex[:bibtex_type].to_s).to eq('article')
|
137
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.53731/r79vxn1-97aq74v-ag58n')
|
138
|
+
expect(bibtex[:doi]).to eq('10.53731/r79vxn1-97aq74v-ag58n')
|
139
|
+
expect(bibtex[:title]).to eq('Eating your own Dog Food')
|
140
|
+
expect(bibtex[:author]).to eq('Fenner, Martin')
|
141
|
+
expect(bibtex[:publisher]).to eq('Front Matter')
|
142
|
+
expect(bibtex[:keywords]).to eq('feature')
|
143
|
+
expect(bibtex[:year]).to eq('2016')
|
144
144
|
end
|
145
145
|
|
146
|
-
it
|
147
|
-
input =
|
148
|
-
subject =
|
146
|
+
it 'authors with affiliations' do
|
147
|
+
input = '10.16910/jemr.9.1.2'
|
148
|
+
subject = described_class.new(input: input, from: 'crossref')
|
149
149
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
150
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
151
|
-
expect(bibtex[:bibtex_key]).to eq(
|
152
|
-
expect(bibtex[:doi]).to eq(
|
153
|
-
expect(bibtex[:title]).to eq(
|
154
|
-
expect(bibtex[:author]).to eq(
|
155
|
-
expect(bibtex[:publisher]).to eq(
|
156
|
-
expect(bibtex[:year]).to eq(
|
150
|
+
expect(bibtex[:bibtex_type].to_s).to eq('article')
|
151
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.16910/jemr.9.1.2')
|
152
|
+
expect(bibtex[:doi]).to eq('10.16910/jemr.9.1.2')
|
153
|
+
expect(bibtex[:title]).to eq('Eye tracking scanpath analysis techniques on web pages: A survey, evaluation and comparison')
|
154
|
+
expect(bibtex[:author]).to eq('Eraslan, Sukru and Yesilada, Yeliz and Harper, Simon')
|
155
|
+
expect(bibtex[:publisher]).to eq('University of Bern')
|
156
|
+
expect(bibtex[:year]).to eq('2015')
|
157
157
|
end
|
158
158
|
|
159
|
-
it
|
160
|
-
input =
|
161
|
-
subject =
|
159
|
+
it 'keywords subject scheme' do
|
160
|
+
input = 'https://doi.org/10.1594/pangaea.721193'
|
161
|
+
subject = described_class.new(input: input, from: 'datacite')
|
162
162
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
163
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
164
|
-
expect(bibtex[:bibtex_key]).to eq(
|
165
|
-
expect(bibtex[:doi]).to eq(
|
166
|
-
expect(bibtex[:keywords]).to start_with(
|
167
|
-
expect(bibtex[:year]).to eq(
|
168
|
-
expect(bibtex[:copyright]).to eq(
|
163
|
+
expect(bibtex[:bibtex_type].to_s).to eq('misc')
|
164
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.1594/pangaea.721193')
|
165
|
+
expect(bibtex[:doi]).to eq('10.1594/pangaea.721193')
|
166
|
+
expect(bibtex[:keywords]).to start_with('animalia, bottles or small containers/aquaria (<20 l), calcification/dissolution')
|
167
|
+
expect(bibtex[:year]).to eq('2007')
|
168
|
+
expect(bibtex[:copyright]).to eq('Creative Commons Attribution 3.0 Unported')
|
169
169
|
end
|
170
170
|
|
171
|
-
it
|
172
|
-
input = fixture_path
|
173
|
-
subject =
|
171
|
+
it 'author is organization' do
|
172
|
+
input = "#{fixture_path}gtex.xml"
|
173
|
+
subject = described_class.new(input: input, from: 'datacite')
|
174
174
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
175
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
176
|
-
expect(bibtex[:bibtex_key]).to eq(
|
177
|
-
expect(bibtex[:author]).to eq(
|
175
|
+
expect(bibtex[:bibtex_type].to_s).to eq('misc')
|
176
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.25491/9hx8-ke93')
|
177
|
+
expect(bibtex[:author]).to eq('{The GTEx Consortium}')
|
178
178
|
end
|
179
179
|
|
180
|
-
it
|
181
|
-
input = fixture_path
|
182
|
-
subject =
|
180
|
+
it 'dataset neurophysiology' do
|
181
|
+
input = "#{fixture_path}datacite-schema-2.2.xml"
|
182
|
+
subject = described_class.new(input: input)
|
183
183
|
expect(subject.valid?).to be true
|
184
184
|
bibtex = BibTeX.parse(subject.bibtex).to_a(quotes: '').first
|
185
|
-
expect(bibtex[:bibtex_type].to_s).to eq(
|
186
|
-
expect(bibtex[:bibtex_key]).to eq(
|
187
|
-
expect(bibtex[:doi]).to eq(
|
188
|
-
expect(bibtex[:title]).to eq(
|
189
|
-
expect(bibtex[:author]).to eq(
|
190
|
-
expect(bibtex[:publisher]).to eq(
|
191
|
-
expect(bibtex[:keywords]).to eq(
|
192
|
-
expect(bibtex[:year]).to eq(
|
185
|
+
expect(bibtex[:bibtex_type].to_s).to eq('misc')
|
186
|
+
expect(bibtex[:bibtex_key]).to eq('https://doi.org/10.6080/k0f769gp')
|
187
|
+
expect(bibtex[:doi]).to eq('10.6080/k0f769gp')
|
188
|
+
expect(bibtex[:title]).to eq('Single-unit recordings from two auditory areas in male zebra finches')
|
189
|
+
expect(bibtex[:author]).to eq('Theunissen, Frederic E. and Hauber, ME and Woolley, Sarah M. N. and Gill, Patrick and Shaevitz, SS and Amin, Noopur and Hsu, A and Singh, NC and Grace, GA and Fremouw, Thane and Zhang, Junli and Cassey, P and Doupe, AJ and David, SV and Vinje, WE')
|
190
|
+
expect(bibtex[:publisher]).to eq('CRCNS.org')
|
191
|
+
expect(bibtex[:keywords]).to eq('neuroscience, electrophysiology, auditory area, avian (zebra finch)')
|
192
|
+
expect(bibtex[:year]).to eq('2009')
|
193
193
|
end
|
194
194
|
end
|
195
195
|
end
|
@@ -3,110 +3,116 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe Briard::Metadata, vcr: true do
|
6
|
-
context
|
7
|
-
it
|
8
|
-
input =
|
9
|
-
subject =
|
6
|
+
context 'write metadata as cff' do
|
7
|
+
it 'SoftwareSourceCode Zenodo' do
|
8
|
+
input = 'https://doi.org/10.5281/zenodo.10164'
|
9
|
+
subject = described_class.new(input: input, from: 'datacite')
|
10
10
|
expect(subject.valid?).to be true
|
11
11
|
json = Psych.safe_load(subject.cff, permitted_classes: [Date])
|
12
|
-
expect(json[
|
13
|
-
expect(json[
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
expect(json[
|
23
|
-
expect(json[
|
24
|
-
expect(json[
|
25
|
-
expect(json[
|
26
|
-
expect(json[
|
27
|
-
|
28
|
-
expect(json[
|
12
|
+
expect(json['doi']).to eq('https://doi.org/10.5281/zenodo.10164')
|
13
|
+
expect(json['authors']).to eq([{ 'affiliation' => 'Juelich Supercomputing Centre, Jülich, Germany',
|
14
|
+
'family-names' => 'Klatt',
|
15
|
+
'given-names' => 'Torbjörn' },
|
16
|
+
{ 'affiliation' => 'Juelich Supercomputing Centre, Jülich, Germany',
|
17
|
+
'family-names' => 'Moser',
|
18
|
+
'given-names' => 'Dieter' },
|
19
|
+
{ 'affiliation' => 'Juelich Supercomputing Centre, Jülich, Germany',
|
20
|
+
'family-names' => 'Speck',
|
21
|
+
'given-names' => 'Robert' }])
|
22
|
+
expect(json['title']).to eq('Pypint -- Python Framework For Parallel-In-Time Methods')
|
23
|
+
expect(json['abstract']).to eq('<em>PyPinT</em> is a framework for Parallel-in-Time integration routines. The main purpose of <em>PyPinT</em> is to provide a framework for educational use and prototyping new parallel-in-time algorithms. As well it will aid in developing a high-performance C++ implementation for massively parallel computers providing the benefits of parallel-in-time routines to a zoo of time integrators in various applications.')
|
24
|
+
expect(json['date-released']).to eq('2014-05-27')
|
25
|
+
expect(json['repository-code']).to eq('https://zenodo.org/record/10164')
|
26
|
+
expect(json['keywords']).to eq(['parallel-in-time integration',
|
27
|
+
'spectral deferred corrections', 'multigrid', 'multi-level spectral deferred corrections', 'python framework'])
|
28
|
+
expect(json['license'].nil?).to be(true)
|
29
|
+
expect(json['references']).to eq('identifiers' => [{ 'type' => 'url',
|
30
|
+
'value' => 'https://github.com/Parallel-in-Time/PyPinT/tree/release-v0.0.4' }])
|
29
31
|
end
|
30
32
|
|
31
|
-
it
|
32
|
-
input =
|
33
|
-
subject =
|
33
|
+
it 'SoftwareSourceCode also Zenodo' do
|
34
|
+
input = 'https://doi.org/10.5281/zenodo.15497'
|
35
|
+
subject = described_class.new(input: input, from: 'datacite')
|
34
36
|
expect(subject.valid?).to be true
|
35
37
|
json = Psych.safe_load(subject.cff, permitted_classes: [Date])
|
36
|
-
expect(json[
|
37
|
-
expect(json[
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
expect(json[
|
50
|
-
expect(json[
|
51
|
-
expect(json[
|
52
|
-
expect(json[
|
53
|
-
expect(json[
|
54
|
-
expect(json[
|
55
|
-
expect(json[
|
38
|
+
expect(json['doi']).to eq('https://doi.org/10.5281/zenodo.15497')
|
39
|
+
expect(json['authors']).to eq([{ 'affiliation' =>
|
40
|
+
'Instituut voor Kern- en Stralingsfysica, KU Leuven, 3001 Leuven, België',
|
41
|
+
'family-names' => 'Gins',
|
42
|
+
'given-names' => 'Wouter' },
|
43
|
+
{ 'affiliation' =>
|
44
|
+
'Instituut voor Kern- en Stralingsfysica, KU Leuven, 3001 Leuven, België',
|
45
|
+
'family-names' => 'de Groote',
|
46
|
+
'given-names' => 'Ruben' },
|
47
|
+
{ 'affiliation' =>
|
48
|
+
'Instituut voor Kern- en Stralingsfysica, KU Leuven, 3001 Leuven, België',
|
49
|
+
'family-names' => 'Heylen',
|
50
|
+
'given-names' => 'Hanne' }])
|
51
|
+
expect(json['title']).to eq('Satlas: Simulation And Analysis Toolbox For Laser Spectroscopy And Nmr Experiments')
|
52
|
+
expect(json['abstract']).to eq('Initial release of the satlas Python package for the analysis and simulation for laser spectroscopy experiments. For the documentation, see http://woutergins.github.io/satlas/')
|
53
|
+
expect(json['date-released']).to eq('2015-02-18')
|
54
|
+
expect(json['repository-code']).to eq('https://zenodo.org/record/15497')
|
55
|
+
expect(json['keywords'].nil?).to be(true)
|
56
|
+
expect(json['license'].nil?).to be(true)
|
57
|
+
expect(json['references']).to eq('identifiers' => [{ 'type' => 'url',
|
58
|
+
'value' => 'https://github.com/woutergins/satlas/tree/v1.0.0' }])
|
56
59
|
end
|
57
60
|
|
58
|
-
it
|
59
|
-
input =
|
60
|
-
subject =
|
61
|
+
it 'ruby-cff' do
|
62
|
+
input = 'https://github.com/citation-file-format/ruby-cff'
|
63
|
+
subject = described_class.new(input: input)
|
61
64
|
expect(subject.valid?).to be true
|
62
65
|
json = Psych.safe_load(subject.cff, permitted_classes: [Date])
|
63
|
-
expect(json[
|
64
|
-
expect(json[
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
expect(json[
|
70
|
-
expect(json[
|
71
|
-
expect(json[
|
72
|
-
expect(json[
|
73
|
-
expect(json[
|
74
|
-
|
75
|
-
expect(json[
|
66
|
+
expect(json['doi']).to eq('https://doi.org/10.5281/zenodo.1184077')
|
67
|
+
expect(json['authors']).to eq([{ 'affiliation' => 'The University of Manchester, UK',
|
68
|
+
'family-names' => 'Haines',
|
69
|
+
'given-names' => 'Robert',
|
70
|
+
'orcid' => 'https://orcid.org/0000-0002-9538-7919' },
|
71
|
+
{ 'name' => 'The Ruby Citation File Format Developers' }])
|
72
|
+
expect(json['title']).to eq('Ruby CFF Library')
|
73
|
+
expect(json['abstract']).to eq('This library provides a Ruby interface to manipulate Citation File Format files')
|
74
|
+
expect(json['date-released']).to eq('2021-08-18')
|
75
|
+
expect(json['repository-code']).to eq('https://github.com/citation-file-format/ruby-cff')
|
76
|
+
expect(json['keywords']).to eq(['ruby', 'credit', 'software citation', 'research software',
|
77
|
+
'software sustainability', 'metadata', 'citation file format', 'cff'])
|
78
|
+
expect(json['license']).to eq('apache-2.0')
|
79
|
+
expect(json['references']).to eq('identifiers' => [{ 'type' => 'doi',
|
80
|
+
'value' => '10.5281/zenodo.1003149' }])
|
76
81
|
end
|
77
82
|
|
78
|
-
it
|
79
|
-
input =
|
80
|
-
subject =
|
83
|
+
it 'Collection of Jupyter notebooks' do
|
84
|
+
input = 'https://doi.org/10.14454/fqq6-w751'
|
85
|
+
subject = described_class.new(input: input, from: 'datacite')
|
81
86
|
expect(subject.valid?).to be true
|
82
87
|
json = Psych.safe_load(subject.cff, permitted_classes: [Date])
|
83
|
-
expect(json[
|
84
|
-
expect(json[
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
expect(json[
|
104
|
-
expect(json[
|
105
|
-
expect(json[
|
106
|
-
expect(json[
|
107
|
-
expect(json[
|
108
|
-
|
109
|
-
expect(json[
|
88
|
+
expect(json['doi']).to eq('https://doi.org/10.14454/fqq6-w751')
|
89
|
+
expect(json['authors']).to eq([{ 'family-names' => 'Petryszak',
|
90
|
+
'given-names' => 'Robert',
|
91
|
+
'orcid' => 'https://orcid.org/0000-0001-6333-2182' },
|
92
|
+
{ 'affiliation' => 'DataCite',
|
93
|
+
'family-names' => 'Fenner',
|
94
|
+
'given-names' => 'Martin',
|
95
|
+
'orcid' => 'https://orcid.org/0000-0003-1419-2405' },
|
96
|
+
{ 'affiliation' => 'Science and Technology Facilities Council',
|
97
|
+
'family-names' => 'Lambert',
|
98
|
+
'given-names' => 'Simon',
|
99
|
+
'orcid' => 'https://orcid.org/0000-0001-9570-8121' },
|
100
|
+
{ 'affiliation' => 'European Bioinformatics Institute',
|
101
|
+
'family-names' => 'Llinares',
|
102
|
+
'given-names' => 'Manuel Bernal',
|
103
|
+
'orcid' => 'https://orcid.org/0000-0002-7368-180X' },
|
104
|
+
{ 'affiliation' => 'British Library',
|
105
|
+
'family-names' => 'Madden',
|
106
|
+
'given-names' => 'Frances',
|
107
|
+
'orcid' => 'https://orcid.org/0000-0002-5432-6116' }])
|
108
|
+
expect(json['title']).to eq('FREYA PID Graph Jupyter Notebooks')
|
109
|
+
expect(json['abstract']).to eq('Jupyter notebooks that use GraphQL to implement EC-funded FREYA Project PID Graph user stories.')
|
110
|
+
expect(json['date-released']).to eq('2020-05-08')
|
111
|
+
expect(json['repository-code']).to eq('https://github.com/datacite/pidgraph-notebooks-python')
|
112
|
+
expect(json['keywords']).to eq(['pid graph', 'pid', 'graphql', 'freya', 'jupyter',
|
113
|
+
'FOS: Computer and information sciences'])
|
114
|
+
expect(json['license'].nil?).to be(true)
|
115
|
+
expect(json['references'].nil?).to be(true)
|
110
116
|
end
|
111
117
|
end
|
112
118
|
end
|