bolognese 1.10.0 → 1.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -2
- data/Gemfile.lock +62 -49
- data/bolognese.gemspec +1 -1
- data/lib/bolognese/metadata.rb +5 -0
- data/lib/bolognese/readers/datacite_reader.rb +6 -6
- data/lib/bolognese/utils.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/lib/bolognese/writers/ris_writer.rb +1 -1
- data/lib/bolognese/writers/schema_org_writer.rb +1 -1
- data/spec/fixtures/citeproc.json +4 -2
- data/spec/fixtures/datacite-example-relateditems-with-attributes.xml +61 -0
- data/spec/fixtures/datacite.json +9 -3
- data/spec/readers/datacite_reader_spec.rb +43 -0
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55d900e332741ad66b6b4bc1d0abd62fc7f2f8fff4e3800fa80c9745d5366cce
|
4
|
+
data.tar.gz: 8d646dcaa3e7224387b49bb76102d979e2e8cd89f07e390a4b5ab296b5cbe907
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b9b9e267bab3ffcbdd4b866867ca98e395b9222ce5bd396ac559a8133736562a31b382d2ddce0d75255ba6099ebcdd203f440a2c83ff20b86fd4072f0eda44e
|
7
|
+
data.tar.gz: 913398d14852b68b6e4c82cb373f288a8746bb39b80586cba43960657ab63dd367efeedb8bb8e507fa68ecd2bdbd4d0a54945e3765a1115bea7e1ea5fe63ee4c
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
**Merged pull requests:**
|
8
8
|
|
9
9
|
- Add DFG-to-FOS mappings utility function [\#147](https://github.com/datacite/bolognese/pull/147) ([jrhoads](https://github.com/jrhoads))
|
10
|
+
- Test against multiple versions of ruby \(2.6, 2.7, 3.0, and 3.1\) [\#141](https://github.com/datacite/bolognese/pull/141) ([jrhoads](https://github.com/jrhoads))
|
10
11
|
|
11
12
|
## [1.9.18](https://github.com/datacite/bolognese/tree/1.9.18) (2022-10-11)
|
12
13
|
|
@@ -64,6 +65,7 @@
|
|
64
65
|
**Merged pull requests:**
|
65
66
|
|
66
67
|
- update nokogiri to latest, including updating maremma [\#130](https://github.com/datacite/bolognese/pull/130) ([orangewolf](https://github.com/orangewolf))
|
68
|
+
- mapping for DFG-to-OECD [\#125](https://github.com/datacite/bolognese/pull/125) ([kjgarza](https://github.com/kjgarza))
|
67
69
|
|
68
70
|
## [1.9.12](https://github.com/datacite/bolognese/tree/1.9.12) (2021-08-19)
|
69
71
|
|
@@ -79,7 +81,6 @@
|
|
79
81
|
|
80
82
|
**Merged pull requests:**
|
81
83
|
|
82
|
-
- Test against multiple versions of ruby \(2.6, 2.7, 3.0, and 3.1\) [\#141](https://github.com/datacite/bolognese/pull/141) ([jrhoads](https://github.com/jrhoads))
|
83
84
|
- Allow Orcid URLs to have been issued from the sandbox [\#121](https://github.com/datacite/bolognese/pull/121) ([prdanelli](https://github.com/prdanelli))
|
84
85
|
|
85
86
|
## [1.9.10](https://github.com/datacite/bolognese/tree/1.9.10) (2021-07-20)
|
@@ -115,7 +116,6 @@
|
|
115
116
|
|
116
117
|
**Merged pull requests:**
|
117
118
|
|
118
|
-
- mapping for DFG-to-OECD [\#125](https://github.com/datacite/bolognese/pull/125) ([kjgarza](https://github.com/kjgarza))
|
119
119
|
- Fix missing affiliation identifier [\#117](https://github.com/datacite/bolognese/pull/117) ([richardhallett](https://github.com/richardhallett))
|
120
120
|
- Add support for book title and additional metadata when reading Crossref Book Chapter DOI [\#115](https://github.com/datacite/bolognese/pull/115) ([prdanelli](https://github.com/prdanelli))
|
121
121
|
- Valid Funder DOIs are being rejected for not starting with a 5 [\#114](https://github.com/datacite/bolognese/pull/114) ([prdanelli](https://github.com/prdanelli))
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bolognese (1.
|
4
|
+
bolognese (1.11.2)
|
5
5
|
activesupport (>= 4.2.5)
|
6
6
|
benchmark_methods (~> 0.7)
|
7
7
|
bibtex-ruby (>= 5.1.0)
|
@@ -11,7 +11,6 @@ PATH
|
|
11
11
|
concurrent-ruby (~> 1.1, >= 1.1.5)
|
12
12
|
csl-styles (~> 1.0, >= 1.0.1.10)
|
13
13
|
edtf (~> 3.0, >= 3.0.4)
|
14
|
-
faraday (~> 0.17.3)
|
15
14
|
gender_detector (~> 0.1.2)
|
16
15
|
iso8601 (~> 0.9.1)
|
17
16
|
json-ld-preloaded (~> 3.1, >= 3.1.3)
|
@@ -30,15 +29,14 @@ PATH
|
|
30
29
|
GEM
|
31
30
|
remote: https://rubygems.org/
|
32
31
|
specs:
|
33
|
-
activesupport (6.1.7)
|
32
|
+
activesupport (6.1.7.3)
|
34
33
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
35
34
|
i18n (>= 1.6, < 2)
|
36
35
|
minitest (>= 5.1)
|
37
36
|
tzinfo (~> 2.0)
|
38
37
|
zeitwerk (~> 2.3)
|
39
|
-
addressable (2.8.
|
40
|
-
public_suffix (>= 2.0.2, <
|
41
|
-
amazing_print (1.4.0)
|
38
|
+
addressable (2.8.1)
|
39
|
+
public_suffix (>= 2.0.2, < 6.0)
|
42
40
|
benchmark_methods (0.7)
|
43
41
|
bibtex-ruby (6.0.0)
|
44
42
|
latex-decode (~> 0.0)
|
@@ -49,7 +47,7 @@ GEM
|
|
49
47
|
citeproc (~> 1.0, >= 1.0.9)
|
50
48
|
csl (~> 1.6)
|
51
49
|
colorize (0.8.1)
|
52
|
-
concurrent-ruby (1.
|
50
|
+
concurrent-ruby (1.2.2)
|
53
51
|
crack (0.4.5)
|
54
52
|
rexml
|
55
53
|
crass (1.0.6)
|
@@ -60,22 +58,31 @@ GEM
|
|
60
58
|
csl (~> 1.0)
|
61
59
|
diff-lcs (1.5.0)
|
62
60
|
docile (1.4.0)
|
63
|
-
ebnf (2.3.
|
64
|
-
amazing_print (~> 1.4)
|
61
|
+
ebnf (2.3.3)
|
65
62
|
htmlentities (~> 4.3)
|
66
63
|
rdf (~> 3.2)
|
67
64
|
scanf (~> 1.0)
|
68
65
|
sxp (~> 1.2)
|
69
|
-
unicode-types (~> 1.
|
70
|
-
edtf (3.1.
|
66
|
+
unicode-types (~> 1.8)
|
67
|
+
edtf (3.1.1)
|
71
68
|
activesupport (>= 3.0, < 8.0)
|
72
69
|
excon (0.71.1)
|
73
|
-
faraday (
|
74
|
-
|
70
|
+
faraday (2.7.6)
|
71
|
+
faraday-net_http (>= 2.0, < 3.1)
|
72
|
+
ruby2_keywords (>= 0.0.4)
|
75
73
|
faraday-encoding (0.0.5)
|
76
74
|
faraday
|
77
|
-
|
78
|
-
|
75
|
+
faraday-excon (2.1.0)
|
76
|
+
excon (>= 0.27.4)
|
77
|
+
faraday (~> 2.0)
|
78
|
+
faraday-follow_redirects (0.3.0)
|
79
|
+
faraday (>= 1, < 3)
|
80
|
+
faraday-gzip (0.1.0)
|
81
|
+
faraday (>= 1.0)
|
82
|
+
zlib (~> 2.1)
|
83
|
+
faraday-multipart (1.0.4)
|
84
|
+
multipart-post (~> 2)
|
85
|
+
faraday-net_http (3.0.2)
|
79
86
|
gender_detector (0.1.2)
|
80
87
|
unicode_utils (>= 1.3.0)
|
81
88
|
haml (5.2.2)
|
@@ -83,19 +90,19 @@ GEM
|
|
83
90
|
tilt
|
84
91
|
hashdiff (1.0.1)
|
85
92
|
htmlentities (4.3.4)
|
86
|
-
i18n (1.
|
93
|
+
i18n (1.14.1)
|
87
94
|
concurrent-ruby (~> 1.0)
|
88
95
|
iso8601 (0.9.1)
|
89
96
|
json (2.6.2)
|
90
|
-
json-canonicalization (0.3.
|
91
|
-
json-ld (3.2.
|
97
|
+
json-canonicalization (0.3.2)
|
98
|
+
json-ld (3.2.5)
|
92
99
|
htmlentities (~> 4.3)
|
93
|
-
json-canonicalization (~> 0.3)
|
100
|
+
json-canonicalization (~> 0.3, >= 0.3.2)
|
94
101
|
link_header (~> 0.0, >= 0.0.8)
|
95
102
|
multi_json (~> 1.15)
|
96
|
-
rack (
|
97
|
-
rdf (~> 3.2, >= 3.2.
|
98
|
-
json-ld-preloaded (3.2.
|
103
|
+
rack (>= 2.2, < 4)
|
104
|
+
rdf (~> 3.2, >= 3.2.10)
|
105
|
+
json-ld-preloaded (3.2.2)
|
99
106
|
json-ld (~> 3.2)
|
100
107
|
rdf (~> 3.2)
|
101
108
|
jsonlint (0.3.0)
|
@@ -103,30 +110,33 @@ GEM
|
|
103
110
|
optimist (~> 3)
|
104
111
|
latex-decode (0.4.0)
|
105
112
|
link_header (0.0.8)
|
106
|
-
loofah (2.
|
113
|
+
loofah (2.21.3)
|
107
114
|
crass (~> 1.0.2)
|
108
|
-
nokogiri (>= 1.
|
109
|
-
maremma (4.9.
|
115
|
+
nokogiri (>= 1.12.0)
|
116
|
+
maremma (4.9.9)
|
110
117
|
activesupport (>= 4.2.5)
|
111
118
|
addressable (>= 2.3.6)
|
112
119
|
builder (~> 3.2, >= 3.2.2)
|
113
120
|
excon (~> 0.71.0)
|
114
|
-
faraday (
|
115
|
-
faraday-encoding (~> 0.0.
|
116
|
-
|
117
|
-
|
121
|
+
faraday (>= 2.0)
|
122
|
+
faraday-encoding (~> 0.0.5)
|
123
|
+
faraday-excon (~> 2.1.0)
|
124
|
+
faraday-follow_redirects (~> 0.3.0)
|
125
|
+
faraday-gzip (~> 0.1.0)
|
126
|
+
faraday-multipart (~> 1.0.4)
|
127
|
+
nokogiri (>= 1.13.1, < 1.14.0)
|
118
128
|
oj (>= 2.8.3)
|
119
129
|
oj_mimic_json (~> 1.0, >= 1.0.1)
|
120
130
|
matrix (0.4.2)
|
121
131
|
mini_portile2 (2.8.0)
|
122
|
-
minitest (5.
|
132
|
+
minitest (5.18.0)
|
123
133
|
multi_json (1.15.0)
|
124
|
-
multipart-post (2.
|
134
|
+
multipart-post (2.3.0)
|
125
135
|
namae (1.1.1)
|
126
|
-
nokogiri (1.13.
|
136
|
+
nokogiri (1.13.9)
|
127
137
|
mini_portile2 (~> 2.8.0)
|
128
138
|
racc (~> 1.4)
|
129
|
-
oj (3.
|
139
|
+
oj (3.14.2)
|
130
140
|
oj_mimic_json (1.0.1)
|
131
141
|
optimist (3.0.1)
|
132
142
|
postrank-uri (1.0.24)
|
@@ -135,22 +145,23 @@ GEM
|
|
135
145
|
public_suffix (>= 2.0.0, < 2.1)
|
136
146
|
public_suffix (2.0.5)
|
137
147
|
racc (1.6.0)
|
138
|
-
rack (2.2.
|
148
|
+
rack (2.2.4)
|
139
149
|
rack-test (0.8.3)
|
140
150
|
rack (>= 1.0, < 3)
|
141
151
|
rake (12.3.3)
|
142
|
-
rdf (3.2.
|
152
|
+
rdf (3.2.11)
|
143
153
|
link_header (~> 0.0, >= 0.0.8)
|
144
154
|
rdf-aggregate-repo (3.2.1)
|
145
155
|
rdf (~> 3.2)
|
146
|
-
rdf-rdfa (3.2.
|
147
|
-
haml (
|
156
|
+
rdf-rdfa (3.2.2)
|
157
|
+
haml (>= 5.2, < 7)
|
148
158
|
htmlentities (~> 4.3)
|
149
159
|
rdf (~> 3.2)
|
150
160
|
rdf-aggregate-repo (~> 3.2)
|
151
161
|
rdf-vocab (~> 3.2)
|
152
162
|
rdf-xsd (~> 3.2)
|
153
|
-
rdf-rdfxml (3.2.
|
163
|
+
rdf-rdfxml (3.2.1)
|
164
|
+
haml (~> 5.2)
|
154
165
|
htmlentities (~> 4.3)
|
155
166
|
rdf (~> 3.2)
|
156
167
|
rdf-rdfa (~> 3.2)
|
@@ -158,7 +169,7 @@ GEM
|
|
158
169
|
rdf-turtle (3.2.1)
|
159
170
|
ebnf (~> 2.3)
|
160
171
|
rdf (~> 3.2)
|
161
|
-
rdf-vocab (3.2.
|
172
|
+
rdf-vocab (3.2.6)
|
162
173
|
rdf (~> 3.2, >= 3.2.4)
|
163
174
|
rdf-xsd (3.2.1)
|
164
175
|
rdf (~> 3.2)
|
@@ -170,38 +181,40 @@ GEM
|
|
170
181
|
rspec-mocks (~> 3.11.0)
|
171
182
|
rspec-core (3.11.0)
|
172
183
|
rspec-support (~> 3.11.0)
|
173
|
-
rspec-expectations (3.11.
|
184
|
+
rspec-expectations (3.11.1)
|
174
185
|
diff-lcs (>= 1.2.0, < 2.0)
|
175
186
|
rspec-support (~> 3.11.0)
|
176
187
|
rspec-mocks (3.11.1)
|
177
188
|
diff-lcs (>= 1.2.0, < 2.0)
|
178
189
|
rspec-support (~> 3.11.0)
|
179
|
-
rspec-support (3.11.
|
190
|
+
rspec-support (3.11.1)
|
180
191
|
rspec-xsd (0.1.0)
|
181
192
|
nokogiri (~> 1.6)
|
182
193
|
rspec (~> 3)
|
194
|
+
ruby2_keywords (0.0.5)
|
183
195
|
scanf (1.0.0)
|
184
196
|
simplecov (0.17.1)
|
185
197
|
docile (~> 1.1)
|
186
198
|
json (>= 1.8, < 3)
|
187
199
|
simplecov-html (~> 0.10.0)
|
188
200
|
simplecov-html (0.10.2)
|
189
|
-
sxp (1.2.
|
190
|
-
matrix
|
201
|
+
sxp (1.2.4)
|
202
|
+
matrix (~> 0.4)
|
191
203
|
rdf (~> 3.2)
|
192
|
-
temple (0.
|
193
|
-
thor (1.2.
|
194
|
-
tilt (2.0
|
195
|
-
tzinfo (2.0.
|
204
|
+
temple (0.10.2)
|
205
|
+
thor (1.2.2)
|
206
|
+
tilt (2.2.0)
|
207
|
+
tzinfo (2.0.6)
|
196
208
|
concurrent-ruby (~> 1.0)
|
197
209
|
unicode-types (1.8.0)
|
198
210
|
unicode_utils (1.4.0)
|
199
211
|
vcr (3.0.3)
|
200
|
-
webmock (3.
|
212
|
+
webmock (3.18.1)
|
201
213
|
addressable (>= 2.8.0)
|
202
214
|
crack (>= 0.3.2)
|
203
215
|
hashdiff (>= 0.4.0, < 2.0.0)
|
204
|
-
zeitwerk (2.6.
|
216
|
+
zeitwerk (2.6.8)
|
217
|
+
zlib (2.1.1)
|
205
218
|
|
206
219
|
PLATFORMS
|
207
220
|
ruby
|
data/bolognese.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
|
18
18
|
# Declare dependencies here, rather than in the Gemfile
|
19
19
|
s.add_dependency 'maremma', '>= 4.9.4', '< 5'
|
20
|
-
s.add_dependency 'faraday', '~> 0.17.3'
|
20
|
+
#s.add_dependency 'faraday', '~> 0.17.3'
|
21
21
|
s.add_dependency 'nokogiri', '>= 1.13.2', '< 1.14'
|
22
22
|
s.add_dependency 'loofah', '~> 2.0', '>= 2.0.3'
|
23
23
|
s.add_dependency 'builder', '~> 3.2', '>= 3.2.2'
|
data/lib/bolognese/metadata.rb
CHANGED
@@ -156,6 +156,11 @@ module Bolognese
|
|
156
156
|
@descriptions ||= meta.fetch("descriptions", nil)
|
157
157
|
end
|
158
158
|
|
159
|
+
def abstract_description
|
160
|
+
# Fetch the first description with descriptionType "Abstract"
|
161
|
+
@abstract_description ||= descriptions&.find { |d| d["descriptionType"] == "Abstract" }
|
162
|
+
end
|
163
|
+
|
159
164
|
def rights_list
|
160
165
|
@rights_list ||= meta.fetch("rights_list", nil)
|
161
166
|
end
|
@@ -230,14 +230,14 @@ module Bolognese
|
|
230
230
|
"creators" => get_authors(Array.wrap(ri.dig("creators", "creator"))),
|
231
231
|
"titles" => get_titles(ri),
|
232
232
|
"publicationYear" => ri["publicationYear"],
|
233
|
-
"volume" => ri["volume"],
|
234
|
-
"issue" => ri["issue"],
|
233
|
+
"volume" => parse_attributes(ri["volume"]),
|
234
|
+
"issue" => parse_attributes(ri["issue"]),
|
235
235
|
"number" => number,
|
236
236
|
"numberType" => numberType,
|
237
|
-
"firstPage" => ri["firstPage"],
|
238
|
-
"lastPage" => ri["lastPage"],
|
239
|
-
"publisher" => ri["publisher"],
|
240
|
-
"edition" => ri["edition"],
|
237
|
+
"firstPage" => parse_attributes(ri["firstPage"]),
|
238
|
+
"lastPage" => parse_attributes(ri["lastPage"]),
|
239
|
+
"publisher" => parse_attributes(ri["publisher"]),
|
240
|
+
"edition" => parse_attributes(ri["edition"]),
|
241
241
|
"contributors" => get_authors(Array.wrap(ri.dig("contributors", "contributor"))),
|
242
242
|
}.compact
|
243
243
|
end
|
data/lib/bolognese/utils.rb
CHANGED
@@ -1021,7 +1021,7 @@ module Bolognese
|
|
1021
1021
|
Array.wrap(element).map do |a|
|
1022
1022
|
if a["literal"].present?
|
1023
1023
|
a["@type"] = "Organization"
|
1024
|
-
a["
|
1024
|
+
a["creatorName"] = a["literal"]
|
1025
1025
|
else
|
1026
1026
|
a["@type"] = "Person"
|
1027
1027
|
a["name"] = [a["given"], a["family"]].compact.join(" ")
|
data/lib/bolognese/version.rb
CHANGED
@@ -11,7 +11,7 @@ module Bolognese
|
|
11
11
|
"AU" => to_ris(creators),
|
12
12
|
"DO" => doi,
|
13
13
|
"UR" => url,
|
14
|
-
"AB" => parse_attributes(
|
14
|
+
"AB" => parse_attributes(abstract_description, content: "description", first: true),
|
15
15
|
"KW" => Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) }.presence,
|
16
16
|
"PY" => publication_year,
|
17
17
|
"PB" => publisher,
|
@@ -13,7 +13,7 @@ module Bolognese
|
|
13
13
|
"name" => parse_attributes(titles, content: "title", first: true),
|
14
14
|
"author" => to_schema_org_creators(creators),
|
15
15
|
"editor" => to_schema_org_contributors(contributors),
|
16
|
-
"description" => parse_attributes(
|
16
|
+
"description" => parse_attributes(abstract_description, content: "description", first: true),
|
17
17
|
"license" => Array.wrap(rights_list).map { |l| l["rightsUri"] }.compact.unwrap,
|
18
18
|
"version" => version_info,
|
19
19
|
"keywords" => subjects.present? ? Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) }.join(", ") : nil,
|
data/spec/fixtures/citeproc.json
CHANGED
@@ -0,0 +1,61 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
3
|
+
xmlns="http://datacite.org/schema/kernel-4" xsi:schemaLocation="http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4.4/metadata.xsd">
|
4
|
+
<identifier identifierType="DOI">10.5072/example-full</identifier>
|
5
|
+
<creators>
|
6
|
+
<creator>
|
7
|
+
<creatorName nameType="Personal">Hallett, Richard</creatorName>
|
8
|
+
<givenName>Richard</givenName>
|
9
|
+
<familyName>Hallett</familyName>
|
10
|
+
</creator>
|
11
|
+
</creators>
|
12
|
+
<titles>
|
13
|
+
<title xml:lang="en-US">Example for related items</title>
|
14
|
+
</titles>
|
15
|
+
<publisher xml:lang="en">DataCite</publisher>
|
16
|
+
<publicationYear>2021</publicationYear>
|
17
|
+
<dates>
|
18
|
+
<date dateType="Updated" dateInformation="Updated with 4.4 properties">2021-01-26</date>
|
19
|
+
</dates>
|
20
|
+
<language>en-US</language>
|
21
|
+
<resourceType resourceTypeGeneral="Software">XML</resourceType>
|
22
|
+
<version>1</version>
|
23
|
+
<descriptions>
|
24
|
+
<description xml:lang="en-US" descriptionType="Abstract">A test example for related items</description>
|
25
|
+
</descriptions>
|
26
|
+
<relatedItems>
|
27
|
+
<relatedItem relationType="IsPublishedIn" relatedItemType="Journal">
|
28
|
+
<relatedItemIdentifier
|
29
|
+
relatedItemIdentifierType="DOI"
|
30
|
+
relatedMetadataScheme="citeproc+json"
|
31
|
+
schemeURI="https://github.com/citation-style-language/schema/raw/master/csl-data.json"
|
32
|
+
schemeType="URL">10.5072/john-smiths-1234</relatedItemIdentifier>
|
33
|
+
<creators>
|
34
|
+
<creator>
|
35
|
+
<creatorName nameType="Personal">Smith, John</creatorName>
|
36
|
+
<givenName>John</givenName>
|
37
|
+
<familyName>Smith</familyName>
|
38
|
+
</creator>
|
39
|
+
</creators>
|
40
|
+
<titles>
|
41
|
+
<title>Understanding the fictional John Smith</title>
|
42
|
+
<title titleType="Subtitle">A detailed look</title>
|
43
|
+
</titles>
|
44
|
+
<publicationYear>1776</publicationYear>
|
45
|
+
<volume xml:lang="en">776</volume>
|
46
|
+
<issue xml:lang="en">1</issue>
|
47
|
+
<number numberType="Chapter">1</number>
|
48
|
+
<firstPage xml:lang="en">50</firstPage>
|
49
|
+
<lastPage xml:lang="en">60</lastPage>
|
50
|
+
<publisher xml:lang="en">Example Inc</publisher>
|
51
|
+
<edition xml:lang="en">1</edition>
|
52
|
+
<contributors>
|
53
|
+
<contributor contributorType="ProjectLeader">
|
54
|
+
<contributorName>Richard, Hallett</contributorName>
|
55
|
+
<givenName>Richard</givenName>
|
56
|
+
<familyName>Hallett</familyName>
|
57
|
+
</contributor>
|
58
|
+
</contributors>
|
59
|
+
</relatedItem>
|
60
|
+
</relatedItems>
|
61
|
+
</resource>
|
data/spec/fixtures/datacite.json
CHANGED
@@ -43,7 +43,7 @@
|
|
43
43
|
}
|
44
44
|
],
|
45
45
|
"dates": [
|
46
|
-
{
|
46
|
+
{
|
47
47
|
"dateType": "Created",
|
48
48
|
"date": "2016-12-20"
|
49
49
|
},
|
@@ -74,10 +74,16 @@
|
|
74
74
|
}
|
75
75
|
],
|
76
76
|
"version": "1.0",
|
77
|
-
"descriptions": [
|
77
|
+
"descriptions": [
|
78
|
+
{
|
79
|
+
"descriptionType": "SeriesInformation",
|
80
|
+
"description": "Volume(1) Series(3)"
|
81
|
+
},
|
82
|
+
{
|
78
83
|
"descriptionType": "Abstract",
|
79
84
|
"description": "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..."
|
80
|
-
|
85
|
+
}
|
86
|
+
],
|
81
87
|
"schemaVersion": "http://datacite.org/schema/kernel-4",
|
82
88
|
"agency": "datacite"
|
83
89
|
}
|
@@ -1555,6 +1555,49 @@ describe Bolognese::Metadata, vcr: true do
|
|
1555
1555
|
)
|
1556
1556
|
end
|
1557
1557
|
|
1558
|
+
it "Schema 4.4 related items from string with attributes" do
|
1559
|
+
input = fixture_path + "datacite-example-relateditems-with-attributes.xml"
|
1560
|
+
subject = Bolognese::Metadata.new(input: input)
|
1561
|
+
expect(subject.valid?).to be true
|
1562
|
+
|
1563
|
+
expect(subject.related_items.last).to eq(
|
1564
|
+
{
|
1565
|
+
"relatedItemType"=>"Journal",
|
1566
|
+
"relationType"=>"IsPublishedIn",
|
1567
|
+
"relatedItemIdentifier"=>
|
1568
|
+
{
|
1569
|
+
"relatedItemIdentifier"=>"10.5072/john-smiths-1234",
|
1570
|
+
"relatedItemIdentifierType"=>"DOI",
|
1571
|
+
"relatedMetadataScheme"=>"citeproc+json",
|
1572
|
+
"schemeURI"=>"https://github.com/citation-style-language/schema/raw/master/csl-data.json",
|
1573
|
+
"schemeType"=>"URL"
|
1574
|
+
},
|
1575
|
+
"creators" =>
|
1576
|
+
[
|
1577
|
+
{"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}
|
1578
|
+
],
|
1579
|
+
"titles"=>
|
1580
|
+
[
|
1581
|
+
{"title"=>"Understanding the fictional John Smith"},
|
1582
|
+
{"title"=>"A detailed look", "titleType"=>"Subtitle"}
|
1583
|
+
],
|
1584
|
+
"volume"=>"776",
|
1585
|
+
"issue"=>"1",
|
1586
|
+
"number"=>"1",
|
1587
|
+
"numberType"=>"Chapter",
|
1588
|
+
"firstPage"=>"50",
|
1589
|
+
"lastPage"=>"60",
|
1590
|
+
"publisher"=>"Example Inc",
|
1591
|
+
"publicationYear"=>"1776",
|
1592
|
+
"edition"=>"1",
|
1593
|
+
"contributors"=>
|
1594
|
+
[
|
1595
|
+
{"name"=>"Hallett, Richard", "givenName"=>"Richard", "familyName"=>"Hallett", "contributorType"=>"ProjectLeader"}
|
1596
|
+
]
|
1597
|
+
}
|
1598
|
+
)
|
1599
|
+
end
|
1600
|
+
|
1558
1601
|
it "Schema 4.4 dissertation from string" do
|
1559
1602
|
input = fixture_path + "datacite-example-dissertation-v4.4.xml"
|
1560
1603
|
subject = Bolognese::Metadata.new(input: input)
|
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.
|
4
|
+
version: 1.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|
@@ -30,20 +30,6 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '5'
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: faraday
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: 0.17.3
|
40
|
-
type: :runtime
|
41
|
-
prerelease: false
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - "~>"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 0.17.3
|
47
33
|
- !ruby/object:Gem::Dependency
|
48
34
|
name: nokogiri
|
49
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -785,6 +771,7 @@ files:
|
|
785
771
|
- spec/fixtures/datacite-example-geolocation.xml
|
786
772
|
- spec/fixtures/datacite-example-nameIdentifier-with-schemeURI.xml
|
787
773
|
- spec/fixtures/datacite-example-polygon-v4.1.xml
|
774
|
+
- spec/fixtures/datacite-example-relateditems-with-attributes.xml
|
788
775
|
- spec/fixtures/datacite-example-relateditems.xml
|
789
776
|
- spec/fixtures/datacite-example-xs-string.xml
|
790
777
|
- spec/fixtures/datacite-formats-with-xs.xml
|