bolognese 1.9.3 → 1.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32f019db25256fb71b8a6d0b2b45abcc97e0ca6266d2e4d03519a9ac07cafe9c
4
- data.tar.gz: 65ba122b12a9bfb50aac24d499d966f9d88007cf0cf84f2f7b81f24ebf5bf08b
3
+ metadata.gz: f8f8cb84bf74f8a75d2469aa5a3e49dd4ba0adbd9b465d60e11bdbbd8252c267
4
+ data.tar.gz: 3fc9719de82891ce908fd4af271f05fc1f024442d0a1e6bc88b65db438118ab3
5
5
  SHA512:
6
- metadata.gz: 15804e0a56cae442744b5ade6478b085a66c7cd375c88a86d0166d7e0d86845fbc5e293f85854d424140550e49672136a9d6f5a156e8e68d47a0f13b166db756
7
- data.tar.gz: 32e48adcca39c6de5100777e468fe850324c0a736ab75d2ca758091bb692fa98c9c47047c32f5d36aa192b0d464983fadcfe246a2dfea7cc5f7fd57b3128360a
6
+ metadata.gz: 797b852b3dafd982249bb57a91dff364bd2dcc6d2b52cb50494dcc6a5cfec7a2fc714a27eed6cd46dde158c495ca93154a858ca0f1800a3990b3f6708878fcec
7
+ data.tar.gz: c19d5e7833401549a98b71a13e9063b52bbdfaaa70ff2165272aff311b2d3df6ae765ae79a4ad62ae45fb259520a3e3b39ada0dbef838cc602972ecdad50305b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased](https://github.com/datacite/bolognese/tree/HEAD)
4
+
5
+ [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.3...HEAD)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Should we resolve the Namespace URL for schema [\#62](https://github.com/datacite/bolognese/issues/62)
10
+
11
+ **Fixed bugs:**
12
+
13
+ - Singular geoLocationPolygons are wrapped in additional array [\#110](https://github.com/datacite/bolognese/issues/110)
14
+
15
+ **Merged pull requests:**
16
+
17
+ - Support returning single geoLocationPolygon [\#111](https://github.com/datacite/bolognese/pull/111) ([richardhallett](https://github.com/richardhallett))
18
+
19
+ ## [1.9.3](https://github.com/datacite/bolognese/tree/1.9.3) (2021-03-26)
20
+
21
+ [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.2...1.9.3)
22
+
3
23
  ## [1.9.2](https://github.com/datacite/bolognese/tree/1.9.2) (2021-03-25)
4
24
 
5
25
  [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.1...1.9.2)
@@ -515,10 +535,6 @@
515
535
 
516
536
  - Error when schema.org in put has array value for @type [\#66](https://github.com/datacite/bolognese/issues/66)
517
537
 
518
- **Merged pull requests:**
519
-
520
- - Default to `ScholarlyArticle` type for `citation` and `isBasedOn` relationships with datasets [\#64](https://github.com/datacite/bolognese/pull/64) ([chrisgorgo](https://github.com/chrisgorgo))
521
-
522
538
  ## [v.1.2.16](https://github.com/datacite/bolognese/tree/v.1.2.16) (2019-07-07)
523
539
 
524
540
  [Full Changelog](https://github.com/datacite/bolognese/compare/v.1.2.15...v.1.2.16)
@@ -617,6 +633,7 @@
617
633
 
618
634
  **Merged pull requests:**
619
635
 
636
+ - Default to `ScholarlyArticle` type for `citation` and `isBasedOn` relationships with datasets [\#64](https://github.com/datacite/bolognese/pull/64) ([chrisgorgo](https://github.com/chrisgorgo))
620
637
  - When authors is a plain string, don't try to parse [\#60](https://github.com/datacite/bolognese/pull/60) ([richardhallett](https://github.com/richardhallett))
621
638
 
622
639
  ## [v.1.1.12](https://github.com/datacite/bolognese/tree/v.1.1.12) (2019-04-15)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (1.9.3)
4
+ bolognese (1.9.4)
5
5
  activesupport (>= 4.2.5)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (>= 5.1.0)
@@ -30,7 +30,7 @@ PATH
30
30
  GEM
31
31
  remote: https://rubygems.org/
32
32
  specs:
33
- activesupport (6.1.3)
33
+ activesupport (6.1.3.1)
34
34
  concurrent-ruby (~> 1.0, >= 1.0.2)
35
35
  i18n (>= 1.6, < 2)
36
36
  minitest (>= 5.1)
@@ -81,7 +81,7 @@ GEM
81
81
  concurrent-ruby (~> 1.0)
82
82
  hashdiff (1.0.1)
83
83
  htmlentities (4.3.4)
84
- i18n (1.8.9)
84
+ i18n (1.8.10)
85
85
  concurrent-ruby (~> 1.0)
86
86
  iso8601 (0.9.1)
87
87
  json (2.5.1)
@@ -101,7 +101,7 @@ GEM
101
101
  optimist (~> 3)
102
102
  latex-decode (0.3.2)
103
103
  link_header (0.0.8)
104
- loofah (2.9.0)
104
+ loofah (2.9.1)
105
105
  crass (~> 1.0.2)
106
106
  nokogiri (>= 1.5.9)
107
107
  maremma (4.7.4)
@@ -215,4 +215,4 @@ DEPENDENCIES
215
215
  webmock (~> 3.0, >= 3.0.1)
216
216
 
217
217
  BUNDLED WITH
218
- 2.2.14
218
+ 2.2.16
@@ -226,6 +226,19 @@ module Bolognese
226
226
  if !gl.is_a?(Hash) || gl["geoLocationPoint"].is_a?(String) || gl["geoLocationBox"].is_a?(String) || gl["geoLocationPolygon"].is_a?(String)
227
227
  nil
228
228
  else
229
+
230
+ # Handle scenario where multiple geoLocationPolygons are allowed within a single geoLocation
231
+ # we want to return an array if it's already an array (i.e. multiple geoLocationPolygons)
232
+ # vs if it's singular just return the object
233
+ # This is for backwards compatability to allow both scenarios.
234
+ if gl.dig("geoLocationPolygon").kind_of?(Array)
235
+ geoLocationPolygon = gl.dig("geoLocationPolygon").map do |glp|
236
+ Array.wrap(glp.dig("polygonPoint")).map { |glpp| { "polygonPoint" => glpp } }.compact.presence
237
+ end.compact.presence
238
+ else
239
+ geoLocationPolygon = Array.wrap(gl.dig("geoLocationPolygon", "polygonPoint")).map { |glp| { "polygonPoint" => glp } }.compact.presence
240
+ end
241
+
229
242
  {
230
243
  "geoLocationPoint" => {
231
244
  "pointLatitude" => gl.dig("geoLocationPoint", "pointLatitude"),
@@ -237,9 +250,7 @@ module Bolognese
237
250
  "southBoundLatitude" => gl.dig("geoLocationBox", "southBoundLatitude"),
238
251
  "northBoundLatitude" => gl.dig("geoLocationBox", "northBoundLatitude")
239
252
  }.compact.presence,
240
- "geoLocationPolygon" => Array.wrap(gl.dig("geoLocationPolygon")).map do |glp|
241
- Array.wrap(glp.dig("polygonPoint")).map { |glpp| { "polygonPoint" => glpp } }.compact.presence
242
- end.compact.presence,
253
+ "geoLocationPolygon" => geoLocationPolygon,
243
254
  "geoLocationPlace" => parse_attributes(gl["geoLocationPlace"], first: true).to_s.strip.presence
244
255
  }.compact
245
256
  end
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "1.9.3"
2
+ VERSION = "1.9.4"
3
3
  end
@@ -52,5 +52,25 @@
52
52
  </polygonPoint>
53
53
  </geoLocationPolygon>
54
54
  </geoLocation>
55
+ <geoLocation>
56
+ <geoLocationPolygon>
57
+ <polygonPoint>
58
+ <pointLongitude>65</pointLongitude>
59
+ <pointLatitude>80</pointLatitude>
60
+ </polygonPoint>
61
+ <polygonPoint>
62
+ <pointLongitude>55</pointLongitude>
63
+ <pointLatitude>75</pointLatitude>
64
+ </polygonPoint>
65
+ <polygonPoint>
66
+ <pointLongitude>45</pointLongitude>
67
+ <pointLatitude>73</pointLatitude>
68
+ </polygonPoint>
69
+ <polygonPoint>
70
+ <pointLongitude>65</pointLongitude>
71
+ <pointLatitude>80</pointLatitude>
72
+ </polygonPoint>
73
+ </geoLocationPolygon>
74
+ </geoLocation>
55
75
  </geoLocations>
56
76
  </resource>
@@ -1314,7 +1314,7 @@ describe Bolognese::Metadata, vcr: true do
1314
1314
  expect(subject.agency).to eq("datacite")
1315
1315
  expect(subject.schema_version).to eq("http://datacite.org/schema/kernel-4")
1316
1316
  expect(subject.geo_locations.first["geoLocationPlace"]).to eq("Zandmotor, sand suppletion area on the Dutch coast.")
1317
- expect(subject.geo_locations.first["geoLocationPolygon"][0].first).to eq("polygonPoint"=>{"pointLatitude"=>"52.03913926329928", "pointLongitude"=>"4.1738852605822"})
1317
+ expect(subject.geo_locations.first["geoLocationPolygon"].first).to eq("polygonPoint"=>{"pointLatitude"=>"52.03913926329928", "pointLongitude"=>"4.1738852605822"})
1318
1318
  end
1319
1319
 
1320
1320
  it "Schema 4.4 from string" do
@@ -1562,7 +1562,15 @@ describe Bolognese::Metadata, vcr: true do
1562
1562
  {"polygonPoint"=>{"pointLatitude"=>"73", "pointLongitude"=>"45"}},
1563
1563
  {"polygonPoint"=>{"pointLatitude"=>"80", "pointLongitude"=>"65"}}
1564
1564
  ]
1565
- ] }
1565
+ ] },
1566
+ { "geoLocationPolygon"=>
1567
+ [
1568
+ {"polygonPoint"=>{"pointLatitude"=>"80", "pointLongitude"=>"65"}},
1569
+ {"polygonPoint"=>{"pointLatitude"=>"75", "pointLongitude"=>"55"}},
1570
+ {"polygonPoint"=>{"pointLatitude"=>"73", "pointLongitude"=>"45"}},
1571
+ {"polygonPoint"=>{"pointLatitude"=>"80", "pointLongitude"=>"65"}}
1572
+ ]
1573
+ }
1566
1574
  ]
1567
1575
  )
1568
1576
  end
@@ -281,7 +281,7 @@ describe Bolognese::Metadata, vcr: true do
281
281
  expect(json["name"]).to eq("Meteo measurements at the Sand Motor")
282
282
  expect(json["author"]).to eq("@type"=>"Person", "familyName"=>"Den Heijer", "givenName"=>"C", "name"=>"C Den Heijer")
283
283
  expect(json["includedInDataCatalog"]).to be_nil
284
- expect(json["spatialCoverage"].dig("geo", "polygon")[0].length).to eq(34)
284
+ expect(json["spatialCoverage"].dig("geo", "polygon").length).to eq(34)
285
285
  expect(json["spatialCoverage"].dig("geo", "polygon")[0].first).to eq(["4.1738852605822", "52.03913926329928"])
286
286
  end
287
287
 
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.9.3
4
+ version: 1.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-26 00:00:00.000000000 Z
11
+ date: 2021-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma