bolognese 1.8.13 → 1.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +37 -0
  3. data/.github/workflows/changelog.yml +36 -0
  4. data/.github/workflows/release.yml +47 -0
  5. data/CHANGELOG.md +1720 -0
  6. data/Gemfile.lock +71 -65
  7. data/README.md +1 -1
  8. data/bolognese.gemspec +2 -2
  9. data/lib/bolognese/author_utils.rb +6 -5
  10. data/lib/bolognese/datacite_utils.rb +76 -9
  11. data/lib/bolognese/metadata.rb +10 -5
  12. data/lib/bolognese/metadata_utils.rb +3 -2
  13. data/lib/bolognese/readers/bibtex_reader.rb +5 -4
  14. data/lib/bolognese/readers/citeproc_reader.rb +1 -1
  15. data/lib/bolognese/readers/crossref_reader.rb +3 -3
  16. data/lib/bolognese/readers/datacite_reader.rb +57 -11
  17. data/lib/bolognese/readers/ris_reader.rb +3 -3
  18. data/lib/bolognese/utils.rb +163 -46
  19. data/lib/bolognese/version.rb +1 -1
  20. data/resources/kernel-4.4/include/datacite-contributorType-v4.xsd +35 -0
  21. data/resources/kernel-4.4/include/datacite-dateType-v4.xsd +25 -0
  22. data/resources/kernel-4.4/include/datacite-descriptionType-v4.xsd +19 -0
  23. data/resources/kernel-4.4/include/datacite-funderIdentifierType-v4.xsd +16 -0
  24. data/resources/kernel-4.4/include/datacite-nameType-v4.xsd +10 -0
  25. data/resources/kernel-4.4/include/datacite-numberType-v4.xsd +12 -0
  26. data/resources/kernel-4.4/include/datacite-relatedIdentifierType-v4.xsd +34 -0
  27. data/resources/kernel-4.4/include/datacite-relationType-v4.xsd +51 -0
  28. data/resources/kernel-4.4/include/datacite-resourceType-v4.xsd +43 -0
  29. data/resources/kernel-4.4/include/datacite-titleType-v4.xsd +14 -0
  30. data/resources/kernel-4.4/include/xml.xsd +286 -0
  31. data/resources/kernel-4.4/metadata.xsd +707 -0
  32. data/resources/kernel-4/include/datacite-contributorType-v4.xsd +21 -21
  33. data/resources/kernel-4/include/datacite-dateType-v4.xsd +11 -11
  34. data/resources/kernel-4/include/datacite-descriptionType-v4.xsd +6 -6
  35. data/resources/kernel-4/include/datacite-funderIdentifierType-v4.xsd +5 -5
  36. data/resources/kernel-4/include/datacite-nameType-v4.xsd +2 -2
  37. data/resources/kernel-4/include/datacite-numberType-v4.xsd +12 -0
  38. data/resources/kernel-4/include/datacite-relatedIdentifierType-v4.xsd +19 -19
  39. data/resources/kernel-4/include/datacite-relationType-v4.xsd +36 -34
  40. data/resources/kernel-4/include/datacite-resourceType-v4.xsd +32 -17
  41. data/resources/kernel-4/include/datacite-titleType-v4.xsd +4 -4
  42. data/resources/kernel-4/metadata.xsd +297 -105
  43. data/spec/fixtures/datacite-example-dissertation-v4.4.xml +56 -0
  44. data/spec/fixtures/datacite-example-full-v4.4.xml +114 -0
  45. data/spec/fixtures/datacite-example-relateditems.xml +61 -0
  46. data/spec/fixtures/datacite-example-xs-string.xml +28 -0
  47. data/spec/fixtures/datacite-geolocationpolygons-multiple.xml +56 -0
  48. data/spec/metadata_spec.rb +1 -1
  49. data/spec/readers/bibtex_reader_spec.rb +2 -2
  50. data/spec/readers/crossref_reader_spec.rb +37 -37
  51. data/spec/readers/datacite_json_reader_spec.rb +1 -1
  52. data/spec/readers/datacite_reader_spec.rb +255 -4
  53. data/spec/readers/ris_reader_spec.rb +3 -3
  54. data/spec/writers/crosscite_writer_spec.rb +3 -3
  55. data/spec/writers/csv_writer_spec.rb +4 -4
  56. data/spec/writers/datacite_json_writer_spec.rb +3 -3
  57. data/spec/writers/datacite_writer_spec.rb +4 -4
  58. data/spec/writers/schema_org_writer_spec.rb +3 -3
  59. metadata +31 -10
  60. data/.travis.yml +0 -35
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (1.8.13)
4
+ bolognese (1.9.3)
5
5
  activesupport (>= 4.2.5)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (>= 5.1.0)
@@ -19,7 +19,7 @@ PATH
19
19
  loofah (~> 2.0, >= 2.0.3)
20
20
  maremma (>= 4.7, < 5)
21
21
  namae (~> 1.0)
22
- nokogiri (~> 1.10.4)
22
+ nokogiri (~> 1.11.2)
23
23
  oj (~> 3.10)
24
24
  oj_mimic_json (~> 1.0, >= 1.0.1)
25
25
  postrank-uri (~> 1.0, >= 1.0.18)
@@ -30,42 +30,43 @@ PATH
30
30
  GEM
31
31
  remote: https://rubygems.org/
32
32
  specs:
33
- activesupport (6.0.3.4)
33
+ activesupport (6.1.3)
34
34
  concurrent-ruby (~> 1.0, >= 1.0.2)
35
- i18n (>= 0.7, < 2)
36
- minitest (~> 5.1)
37
- tzinfo (~> 1.1)
38
- zeitwerk (~> 2.2, >= 2.2.2)
35
+ i18n (>= 1.6, < 2)
36
+ minitest (>= 5.1)
37
+ tzinfo (~> 2.0)
38
+ zeitwerk (~> 2.3)
39
39
  addressable (2.7.0)
40
40
  public_suffix (>= 2.0.2, < 5.0)
41
41
  benchmark_methods (0.7)
42
- bibtex-ruby (5.1.4)
42
+ bibtex-ruby (6.0.0)
43
43
  latex-decode (~> 0.0)
44
44
  builder (3.2.4)
45
45
  citeproc (1.0.10)
46
46
  namae (~> 1.0)
47
- citeproc-ruby (1.1.12)
47
+ citeproc-ruby (1.1.13)
48
48
  citeproc (~> 1.0, >= 1.0.9)
49
49
  csl (~> 1.5)
50
50
  colorize (0.8.1)
51
- concurrent-ruby (1.1.7)
52
- crack (0.4.4)
51
+ concurrent-ruby (1.1.8)
52
+ crack (0.4.5)
53
+ rexml
53
54
  crass (1.0.6)
54
- csl (1.5.1)
55
+ csl (1.5.2)
55
56
  namae (~> 1.0)
56
57
  csl-styles (1.0.1.10)
57
58
  csl (~> 1.0)
58
59
  diff-lcs (1.4.4)
59
- docile (1.3.2)
60
- ebnf (2.1.1)
60
+ docile (1.3.5)
61
+ ebnf (2.1.2)
61
62
  htmlentities (~> 4.3)
62
63
  rdf (~> 3.1)
63
64
  scanf (~> 1.0)
64
65
  sxp (~> 1.1)
65
- edtf (3.0.5)
66
+ edtf (3.0.6)
66
67
  activesupport (>= 3.0, < 7.0)
67
68
  excon (0.71.1)
68
- faraday (0.17.3)
69
+ faraday (0.17.4)
69
70
  multipart-post (>= 1.2, < 3)
70
71
  faraday-encoding (0.0.5)
71
72
  faraday
@@ -73,36 +74,37 @@ GEM
73
74
  faraday (>= 0.7.4, < 1.0)
74
75
  gender_detector (0.1.2)
75
76
  unicode_utils (>= 1.3.0)
76
- haml (5.2.0)
77
+ haml (5.2.1)
77
78
  temple (>= 0.8.0)
78
79
  tilt
79
80
  hamster (3.0.0)
80
81
  concurrent-ruby (~> 1.0)
81
82
  hashdiff (1.0.1)
82
83
  htmlentities (4.3.4)
83
- i18n (1.8.5)
84
+ i18n (1.8.9)
84
85
  concurrent-ruby (~> 1.0)
85
86
  iso8601 (0.9.1)
86
- json-canonicalization (0.2.0)
87
- json-ld (3.1.4)
87
+ json (2.5.1)
88
+ json-canonicalization (0.2.1)
89
+ json-ld (3.1.9)
88
90
  htmlentities (~> 4.3)
89
91
  json-canonicalization (~> 0.2)
90
92
  link_header (~> 0.0, >= 0.0.8)
91
93
  multi_json (~> 1.14)
92
94
  rack (~> 2.0)
93
95
  rdf (~> 3.1)
94
- json-ld-preloaded (3.1.3)
96
+ json-ld-preloaded (3.1.5)
95
97
  json-ld (~> 3.1)
96
98
  rdf (~> 3.1)
97
99
  jsonlint (0.3.0)
98
100
  oj (~> 3)
99
101
  optimist (~> 3)
100
- latex-decode (0.3.1)
102
+ latex-decode (0.3.2)
101
103
  link_header (0.0.8)
102
- loofah (2.7.0)
104
+ loofah (2.9.0)
103
105
  crass (~> 1.0.2)
104
106
  nokogiri (>= 1.5.9)
105
- maremma (4.7.2)
107
+ maremma (4.7.4)
106
108
  activesupport (>= 4.2.5)
107
109
  addressable (>= 2.3.6)
108
110
  builder (~> 3.2, >= 3.2.2)
@@ -110,17 +112,18 @@ GEM
110
112
  faraday (~> 0.17.3)
111
113
  faraday-encoding (~> 0.0.4)
112
114
  faraday_middleware (~> 0.14.0)
113
- nokogiri (~> 1.10.4)
115
+ nokogiri (~> 1.11.2)
114
116
  oj (>= 2.8.3)
115
117
  oj_mimic_json (~> 1.0, >= 1.0.1)
116
- mini_portile2 (2.4.0)
117
- minitest (5.14.2)
118
+ mini_portile2 (2.5.0)
119
+ minitest (5.14.4)
118
120
  multi_json (1.15.0)
119
121
  multipart-post (2.1.1)
120
- namae (1.0.1)
121
- nokogiri (1.10.10)
122
- mini_portile2 (~> 2.4.0)
123
- oj (3.10.14)
122
+ namae (1.1.1)
123
+ nokogiri (1.11.2)
124
+ mini_portile2 (~> 2.5.0)
125
+ racc (~> 1.4)
126
+ oj (3.11.3)
124
127
  oj_mimic_json (1.0.1)
125
128
  optimist (3.0.1)
126
129
  postrank-uri (1.0.24)
@@ -128,70 +131,73 @@ GEM
128
131
  nokogiri (>= 1.8.0)
129
132
  public_suffix (>= 2.0.0, < 2.1)
130
133
  public_suffix (2.0.5)
134
+ racc (1.5.2)
131
135
  rack (2.2.3)
132
136
  rack-test (0.8.3)
133
137
  rack (>= 1.0, < 3)
134
138
  rake (12.3.3)
135
- rdf (3.1.6)
139
+ rdf (3.1.13)
136
140
  hamster (~> 3.0)
137
141
  link_header (~> 0.0, >= 0.0.8)
138
142
  rdf-aggregate-repo (3.1.0)
139
143
  rdf (~> 3.1)
140
- rdf-rdfa (3.1.2)
141
- haml (~> 5.1)
144
+ rdf-rdfa (3.1.3)
145
+ haml (~> 5.2)
142
146
  htmlentities (~> 4.3)
143
- rdf (~> 3.1, >= 3.1.2)
147
+ rdf (~> 3.1, >= 3.1.13)
144
148
  rdf-aggregate-repo (~> 3.1)
145
- rdf-vocab (~> 3.1, >= 3.1.5)
149
+ rdf-vocab (~> 3.1, >= 3.1.11)
146
150
  rdf-xsd (~> 3.1)
147
- rdf-rdfxml (3.1.0)
151
+ rdf-rdfxml (3.1.1)
148
152
  htmlentities (~> 4.3)
149
153
  rdf (~> 3.1)
150
154
  rdf-rdfa (~> 3.1)
151
155
  rdf-xsd (~> 3.1)
152
- rdf-turtle (3.1.2)
153
- ebnf (~> 2.0)
154
- rdf (~> 3.1, >= 3.1.2)
155
- rdf-vocab (3.1.8)
156
- rdf (~> 3.1, >= 3.1.2)
157
- rdf-xsd (3.1.0)
156
+ rdf-turtle (3.1.3)
157
+ ebnf (~> 2.1)
158
+ rdf (~> 3.1, >= 3.1.8)
159
+ rdf-vocab (3.1.13)
160
+ rdf (~> 3.1, >= 3.1.12)
161
+ rdf-xsd (3.1.1)
158
162
  rdf (~> 3.1)
159
- rspec (3.9.0)
160
- rspec-core (~> 3.9.0)
161
- rspec-expectations (~> 3.9.0)
162
- rspec-mocks (~> 3.9.0)
163
- rspec-core (3.9.3)
164
- rspec-support (~> 3.9.3)
165
- rspec-expectations (3.9.2)
163
+ rexml (~> 3.2)
164
+ rexml (3.2.4)
165
+ rspec (3.10.0)
166
+ rspec-core (~> 3.10.0)
167
+ rspec-expectations (~> 3.10.0)
168
+ rspec-mocks (~> 3.10.0)
169
+ rspec-core (3.10.1)
170
+ rspec-support (~> 3.10.0)
171
+ rspec-expectations (3.10.1)
166
172
  diff-lcs (>= 1.2.0, < 2.0)
167
- rspec-support (~> 3.9.0)
168
- rspec-mocks (3.9.1)
173
+ rspec-support (~> 3.10.0)
174
+ rspec-mocks (3.10.2)
169
175
  diff-lcs (>= 1.2.0, < 2.0)
170
- rspec-support (~> 3.9.0)
171
- rspec-support (3.9.3)
176
+ rspec-support (~> 3.10.0)
177
+ rspec-support (3.10.2)
172
178
  rspec-xsd (0.1.0)
173
179
  nokogiri (~> 1.6)
174
180
  rspec (~> 3)
175
181
  scanf (1.0.0)
176
- simplecov (0.19.0)
182
+ simplecov (0.17.1)
177
183
  docile (~> 1.1)
178
- simplecov-html (~> 0.11)
179
- simplecov-html (0.12.3)
184
+ json (>= 1.8, < 3)
185
+ simplecov-html (~> 0.10.0)
186
+ simplecov-html (0.10.2)
180
187
  sxp (1.1.0)
181
188
  rdf (~> 3.1)
182
189
  temple (0.8.2)
183
- thor (1.0.1)
184
- thread_safe (0.3.6)
190
+ thor (1.1.0)
185
191
  tilt (2.0.10)
186
- tzinfo (1.2.7)
187
- thread_safe (~> 0.1)
192
+ tzinfo (2.0.4)
193
+ concurrent-ruby (~> 1.0)
188
194
  unicode_utils (1.4.0)
189
195
  vcr (3.0.3)
190
- webmock (3.9.2)
196
+ webmock (3.12.1)
191
197
  addressable (>= 2.3.6)
192
198
  crack (>= 0.3.2)
193
199
  hashdiff (>= 0.4.0, < 2.0.0)
194
- zeitwerk (2.4.0)
200
+ zeitwerk (2.4.2)
195
201
 
196
202
  PLATFORMS
197
203
  ruby
@@ -204,9 +210,9 @@ DEPENDENCIES
204
210
  rake (~> 12.0)
205
211
  rspec (~> 3.4)
206
212
  rspec-xsd (~> 0.1.0)
207
- simplecov (~> 0.1)
213
+ simplecov (= 0.17.1)
208
214
  vcr (~> 3.0, >= 3.0.3)
209
215
  webmock (~> 3.0, >= 3.0.1)
210
216
 
211
217
  BUNDLED WITH
212
- 2.1.4
218
+ 2.2.14
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![Identifier](https://img.shields.io/badge/doi-10.5438%2Fn138--z3mk-fca709.svg)](https://doi.org/10.5438/n138-z3mk)
2
2
  [![Gem Version](https://badge.fury.io/rb/bolognese.svg)](https://badge.fury.io/rb/bolognese)
3
- [![Build Status](https://travis-ci.org/datacite/bolognese.svg?branch=master)](https://travis-ci.org/datacite/bolognese)
3
+ ![Build Ruby Gem](https://github.com/datacite/bolognese/workflows/Build%20Ruby%20Gem/badge.svg)
4
4
  [![Code Climate](https://codeclimate.com/github/datacite/bolognese/badges/gpa.svg)](https://codeclimate.com/github/datacite/bolognese)
5
5
  [![Test Coverage](https://codeclimate.com/github/datacite/bolognese/badges/coverage.svg)](https://codeclimate.com/github/datacite/bolognese/coverage)
6
6
 
data/bolognese.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  # Declare dependencies here, rather than in the Gemfile
19
19
  s.add_dependency 'maremma', '>= 4.7', '< 5'
20
20
  s.add_dependency 'faraday', '~> 0.17.3'
21
- s.add_dependency 'nokogiri', '~> 1.10.4'
21
+ s.add_dependency 'nokogiri', '~> 1.11.2'
22
22
  s.add_dependency 'loofah', '~> 2.0', '>= 2.0.3'
23
23
  s.add_dependency 'builder', '~> 3.2', '>= 3.2.2'
24
24
  s.add_dependency 'activesupport', '>= 4.2.5'
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
47
47
  s.add_development_dependency 'rack-test', '~> 0'
48
48
  s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.3'
49
49
  s.add_development_dependency 'webmock', '~> 3.0', '>= 3.0.1'
50
- s.add_development_dependency 'simplecov', '~> 0.1'
50
+ s.add_development_dependency 'simplecov', '0.17.1'
51
51
  s.add_development_dependency 'hashdiff', ['>= 1.0.0.beta1', '< 2.0.0']
52
52
 
53
53
  s.require_paths = ["lib"]
@@ -15,7 +15,7 @@ module Bolognese
15
15
  def get_one_author(author)
16
16
  # author is a string
17
17
  author = { "creatorName" => author } if author.is_a?(String)
18
-
18
+
19
19
  # malformed XML
20
20
  return nil if author.fetch("creatorName", nil).is_a?(Array)
21
21
 
@@ -31,17 +31,17 @@ module Bolognese
31
31
 
32
32
  name_identifiers = Array.wrap(author.fetch("nameIdentifier", nil)).map do |ni|
33
33
  if ni["nameIdentifierScheme"] == "ORCID"
34
- {
34
+ {
35
35
  "nameIdentifier" => normalize_orcid(ni["__content__"]),
36
36
  "schemeUri" => "https://orcid.org",
37
37
  "nameIdentifierScheme" => "ORCID" }.compact
38
38
  elsif ni["schemeURI"].present?
39
- {
39
+ {
40
40
  "nameIdentifier" => ni["schemeURI"].to_s + ni["__content__"].to_s,
41
41
  "schemeUri" => ni["schemeURI"].to_s,
42
42
  "nameIdentifierScheme" => ni["nameIdentifierScheme"] }.compact
43
43
  else
44
- {
44
+ {
45
45
  "nameIdentifier" => ni["__content__"],
46
46
  "schemeUri" => nil,
47
47
  "nameIdentifierScheme" => ni["nameIdentifierScheme"] }.compact
@@ -59,6 +59,7 @@ module Bolognese
59
59
  return author if family_name.present?
60
60
 
61
61
  if is_personal_name?(author)
62
+ Namae.options[:include_particle_in_family] = true
62
63
  names = Namae.parse(name)
63
64
  parsed_name = names.first
64
65
 
@@ -79,7 +80,7 @@ module Bolognese
79
80
  "affiliation" => Array.wrap(author.fetch("affiliation", nil)),
80
81
  "contributorType" => contributor_type }.compact
81
82
  else
82
- { "nameType" => name_type,
83
+ { "nameType" => name_type,
83
84
  "name" => name,
84
85
  "nameIdentifiers" => Array.wrap(name_identifiers),
85
86
  "affiliation" => Array.wrap(author.fetch("affiliation", nil)),
@@ -40,6 +40,7 @@ module Bolognese
40
40
  insert_language(xml)
41
41
  insert_alternate_identifiers(xml)
42
42
  insert_related_identifiers(xml)
43
+ insert_related_items(xml)
43
44
  insert_sizes(xml)
44
45
  insert_formats(xml)
45
46
  insert_version(xml)
@@ -86,7 +87,7 @@ module Bolognese
86
87
  end
87
88
  Array.wrap(person["affiliation"]).each do |affiliation|
88
89
  attributes = { "affiliationIdentifier" => affiliation["affiliationIdentifier"], "affiliationIdentifierScheme" => affiliation["affiliationIdentifierScheme"], "schemeURI" => affiliation["schemeUri"] }.compact
89
- xml.affiliation(affiliation["name"], attributes)
90
+ xml.affiliation(affiliation["name"], attributes)
90
91
  end
91
92
  end
92
93
 
@@ -209,6 +210,71 @@ module Bolognese
209
210
  end
210
211
  end
211
212
 
213
+ def insert_related_items(xml)
214
+ return xml unless related_items.present?
215
+
216
+ xml.relatedItems do
217
+ related_items.each do |related_item|
218
+ attributes = {
219
+ 'relatedItemType' => related_item["relatedItemType"],
220
+ 'relationType' => related_item["relationType"],
221
+ }.compact
222
+
223
+ xml.relatedItem(related_item["relatedItem"], attributes) do
224
+
225
+ xml.relatedItemIdentifier(related_item["relatedItemIdentifier"]['relatedItemIdentifier'],
226
+ {
227
+ 'relatedItemIdentifierType' => related_item["relatedItemIdentifier"]["relatedItemIdentifierType"],
228
+ 'relatedMetadataScheme' => related_item["relatedItemIdentifier"]["relatedMetadataScheme"],
229
+ 'schemeURI' => related_item["relatedItemIdentifier"]["schemeURI"],
230
+ 'schemeType' => related_item["relatedItemIdentifier"]["schemeType"],
231
+ }.compact
232
+ )
233
+
234
+ xml.creators do
235
+ Array.wrap(related_item['creators']).each do |au|
236
+ xml.creator do
237
+ insert_person(xml, au, "creator")
238
+ end
239
+ end
240
+ end
241
+
242
+ xml.titles do
243
+ Array.wrap(related_item['titles']).each do |title|
244
+ if title.is_a?(Hash)
245
+ t = title
246
+ else
247
+ t = {}
248
+ t["title"] = title
249
+ end
250
+
251
+ attributes = { 'titleType' => t["titleType"], 'xml:lang' => t["lang"] }.compact
252
+ xml.title(t["title"], attributes)
253
+ end
254
+ end
255
+
256
+ xml.publicationYear(related_item['publicationYear'])
257
+ xml.volume(related_item['volume'])
258
+ xml.issue(related_item['issue'])
259
+ xml.number(related_item['number'], {'numberType' => related_item['numberType']}.compact)
260
+ xml.firstPage(related_item['firstPage'])
261
+ xml.lastPage(related_item['lastPage'])
262
+ xml.publisher(related_item['publisher'])
263
+ xml.edition(related_item['edition'])
264
+
265
+ xml.contributors do
266
+ Array.wrap(related_item["contributors"]).each do |con|
267
+ xml.contributor("contributorType" => con["contributorType"] || "Other") do
268
+ insert_person(xml, con, "contributor")
269
+ end
270
+ end
271
+ end
272
+
273
+ end
274
+ end
275
+ end
276
+ end
277
+
212
278
  def insert_sizes(xml)
213
279
  xml.sizes do
214
280
  Array.wrap(sizes).each do |s|
@@ -238,12 +304,12 @@ module Bolognese
238
304
  r["rightsUri"] = normalize_id(rights)
239
305
  end
240
306
 
241
- attributes = {
307
+ attributes = {
242
308
  "rightsURI" => r["rightsUri"],
243
309
  "rightsIdentifier" => r["rightsIdentifier"],
244
310
  "rightsIdentifierScheme" => r["rightsIdentifierScheme"],
245
311
  "schemeURI" => r["schemeUri"],
246
- "xml:lang" => r["lang"]
312
+ "xml:lang" => r["lang"]
247
313
  }.compact
248
314
 
249
315
  xml.rights(r["rights"], attributes)
@@ -302,13 +368,14 @@ module Bolognese
302
368
  xml.northBoundLatitude(geo_location.dig("geoLocationBox", "northBoundLatitude"))
303
369
  end
304
370
  end
305
-
306
371
  if geo_location["geoLocationPolygon"]
307
- xml.geoLocationPolygon do
308
- geo_location["geoLocationPolygon"].each do |polygon_point|
309
- xml.polygonPoint do
310
- xml.pointLatitude(polygon_point["pointLatitude"])
311
- xml.pointLongitude(polygon_point["pointLongitude"])
372
+ geo_location["geoLocationPolygon"].each do |geo_location_polygon|
373
+ xml.geoLocationPolygon do
374
+ geo_location_polygon.each do |polygon_point|
375
+ xml.polygonPoint do
376
+ xml.pointLatitude(polygon_point.dig("polygonPoint", "pointLatitude"))
377
+ xml.pointLongitude(polygon_point.dig("polygonPoint", "pointLongitude"))
378
+ end
312
379
  end
313
380
  end
314
381
  end