bolognese 1.9.11 → 1.9.12

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: 849fb87ec530a7e1ec773da483f9c1c02e77f121452631484df813c29c3e15c1
4
- data.tar.gz: 4bae2258180b888f2c730222b997b66ad9824019bddaddd99dbee4980539eb1c
3
+ metadata.gz: 809d529a1ec99aa9653b7532586134862f896e46338e33fd97ea54da86dd0ed1
4
+ data.tar.gz: 85532735a718977631655c991d2c545a9974e091e5d656ab389b953b6d608165
5
5
  SHA512:
6
- metadata.gz: '00679fba333bc077b0c4f9562b017eccdd07e365f340d4f1c90da0e34049ad89a87d299fa0193a224282cdb594aa5113ab13e0f54aa794f195f33352487811e5'
7
- data.tar.gz: f088ff9511beff4b6eb4f654923af62d4b3b47be8253314a05218b5e5453798b266035927d7350049deb5d5c85673fc79886c9faeb6dd9a540697711adc14b18
6
+ metadata.gz: 013f57c1d908072881e9736c29e2e623cc0b311789450a20abeb0930f2dd754a9c09cf5b69cca8647b5561ace43dec33ffe6623424f5c1e79eb5f59defc74edc
7
+ data.tar.gz: 22e534387e3a579ded5f1d4da6fa46193e44169c5df2c6eb2a8a7f7fd3ba1218ecd59f74e540be67125a1dc6ab49cbf817dbaca430d26c3d3c06e2507fe127e1
data/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## [1.9.11](https://github.com/datacite/bolognese/tree/1.9.11) (2021-08-04)
3
+ ## [1.9.11](https://github.com/datacite/bolognese/tree/1.9.11) (2021-08-17)
4
4
 
5
5
  [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.10...1.9.11)
6
6
 
@@ -291,7 +291,6 @@
291
291
 
292
292
  - Map Fields of Research classification to OECD Fields of Science [\#93](https://github.com/datacite/bolognese/pull/93) ([mfenner](https://github.com/mfenner))
293
293
  - Don't try and normalise "Other" funder types. [\#91](https://github.com/datacite/bolognese/pull/91) ([richardhallett](https://github.com/richardhallett))
294
- - fixes missing version attribute when data comes from datacite\_json [\#85](https://github.com/datacite/bolognese/pull/85) ([kjgarza](https://github.com/kjgarza))
295
294
 
296
295
  ## [1.6](https://github.com/datacite/bolognese/tree/1.6) (2020-05-16)
297
296
 
@@ -321,6 +320,10 @@
321
320
 
322
321
  [Full Changelog](https://github.com/datacite/bolognese/compare/1.5.17...1.5.18)
323
322
 
323
+ **Merged pull requests:**
324
+
325
+ - fixes missing version attribute when data comes from datacite\_json [\#85](https://github.com/datacite/bolognese/pull/85) ([kjgarza](https://github.com/kjgarza))
326
+
324
327
  ## [1.5.17](https://github.com/datacite/bolognese/tree/1.5.17) (2020-04-18)
325
328
 
326
329
  [Full Changelog](https://github.com/datacite/bolognese/compare/1.5.16...1.5.17)
@@ -1353,6 +1356,10 @@
1353
1356
 
1354
1357
  [Full Changelog](https://github.com/datacite/bolognese/compare/v.0.9.64...v.0.9.65)
1355
1358
 
1359
+ **Closed issues:**
1360
+
1361
+ - inconsistent name parsing in JSON-LD conversion [\#16](https://github.com/datacite/bolognese/issues/16)
1362
+
1356
1363
  **Merged pull requests:**
1357
1364
 
1358
1365
  - \[\#28\] Removing multi author support from parsing single author fields. [\#19](https://github.com/datacite/bolognese/pull/19) ([richardhallett](https://github.com/richardhallett))
@@ -1531,7 +1538,6 @@
1531
1538
 
1532
1539
  **Closed issues:**
1533
1540
 
1534
- - inconsistent name parsing in JSON-LD conversion [\#16](https://github.com/datacite/bolognese/issues/16)
1535
1541
  - Fix error handling alternate names in ris writer [\#14](https://github.com/datacite/bolognese/issues/14)
1536
1542
  - Error displaying container-title [\#13](https://github.com/datacite/bolognese/issues/13)
1537
1543
  - Error parsing funding information [\#12](https://github.com/datacite/bolognese/issues/12)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (1.9.11)
4
+ bolognese (1.9.12)
5
5
  activesupport (>= 4.2.5)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (>= 5.1.0)
@@ -220,4 +220,4 @@ DEPENDENCIES
220
220
  webmock (~> 3.0, >= 3.0.1)
221
221
 
222
222
  BUNDLED WITH
223
- 2.2.25
223
+ 2.2.26
@@ -188,20 +188,24 @@ module Bolognese
188
188
  end
189
189
 
190
190
  related_items = Array.wrap(meta.dig("relatedItems", "relatedItem")).map do |ri|
191
+
191
192
  rii = ri["relatedItemIdentifier"]
192
- if rii["relatedItemIdentifierType"] == "DOI"
193
- rid = validate_doi(rii["__content__"].to_s.downcase)
194
- else
195
- rid = rii["__content__"]
196
- end
193
+ relatedItemIdentifier = nil
194
+ if rii
195
+ if rii["relatedItemIdentifierType"] == "DOI"
196
+ rid = validate_doi(rii["__content__"].to_s.downcase)
197
+ else
198
+ rid = rii["__content__"]
199
+ end
197
200
 
198
- relatedItemIdentifier = {
199
- "relatedItemIdentifier" => rid,
200
- "relatedItemIdentifierType" => rii["relatedItemIdentifierType"],
201
- "relatedMetadataScheme" => rii["relatedMetadataScheme"],
202
- "schemeURI" => rii["schemeURI"],
203
- "schemeType" => rii["schemeType"]
204
- }.compact
201
+ relatedItemIdentifier = {
202
+ "relatedItemIdentifier" => rid,
203
+ "relatedItemIdentifierType" => rii["relatedItemIdentifierType"],
204
+ "relatedMetadataScheme" => rii["relatedMetadataScheme"],
205
+ "schemeURI" => rii["schemeURI"],
206
+ "schemeType" => rii["schemeType"]
207
+ }.compact
208
+ end
205
209
 
206
210
  number = ri["number"]
207
211
  if number.is_a?(String)
@@ -212,7 +216,7 @@ module Bolognese
212
216
  numberType = ri.dig("number", "numberType")
213
217
  end
214
218
 
215
- {
219
+ a = {
216
220
  "relationType" => ri["relationType"],
217
221
  "relatedItemType" => ri["relatedItemType"],
218
222
  "relatedItemIdentifier" => relatedItemIdentifier,
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "1.9.11"
2
+ VERSION = "1.9.12"
3
3
  end
@@ -1482,6 +1482,47 @@ describe Bolognese::Metadata, vcr: true do
1482
1482
  )
1483
1483
  end
1484
1484
 
1485
+
1486
+ it "Schema 4.4 related items from string minus relatedIdentifier" do
1487
+ input = fixture_path + "datacite-example-relateditems.xml"
1488
+
1489
+ # Remove relatedItemIdentifier from raw input
1490
+ @doc = File.open(input) { |f| Nokogiri::XML(f) }
1491
+ @doc.xpath("//xmlns:relatedItemIdentifier").each {|x| x.remove}
1492
+
1493
+ subject = Bolognese::Metadata.new(input: @doc.to_s)
1494
+ expect(subject.valid?).to be true
1495
+
1496
+ expect(subject.related_items.last).to eq(
1497
+ {
1498
+ "relatedItemType"=>"Journal",
1499
+ "relationType"=>"IsPublishedIn",
1500
+ "creators" =>
1501
+ [
1502
+ {"nameType"=>"Personal", "name"=>"Smith, John", "givenName"=>"John", "familyName"=>"Smith"}
1503
+ ],
1504
+ "titles"=>
1505
+ [
1506
+ {"title"=>"Understanding the fictional John Smith"},
1507
+ {"title"=>"A detailed look", "titleType"=>"Subtitle"}
1508
+ ],
1509
+ "volume"=>"776",
1510
+ "issue"=>"1",
1511
+ "number"=>"1",
1512
+ "numberType"=>"Chapter",
1513
+ "firstPage"=>"50",
1514
+ "lastPage"=>"60",
1515
+ "publisher"=>"Example Inc",
1516
+ "publicationYear"=>"1776",
1517
+ "edition"=>"1",
1518
+ "contributors"=>
1519
+ [
1520
+ {"name"=>"Hallett, Richard", "givenName"=>"Richard", "familyName"=>"Hallett", "contributorType"=>"ProjectLeader"}
1521
+ ]
1522
+ }
1523
+ )
1524
+ end
1525
+
1485
1526
  it "Schema 4.4 dissertation from string" do
1486
1527
  input = fixture_path + "datacite-example-dissertation-v4.4.xml"
1487
1528
  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.9.11
4
+ version: 1.9.12
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-08-17 00:00:00.000000000 Z
11
+ date: 2021-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma