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 +4 -4
- data/CHANGELOG.md +9 -3
- data/Gemfile.lock +2 -2
- data/lib/bolognese/readers/datacite_reader.rb +17 -13
- data/lib/bolognese/version.rb +1 -1
- data/spec/readers/datacite_reader_spec.rb +41 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 809d529a1ec99aa9653b7532586134862f896e46338e33fd97ea54da86dd0ed1
|
4
|
+
data.tar.gz: 85532735a718977631655c991d2c545a9974e091e5d656ab389b953b6d608165
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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.
|
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.
|
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
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
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
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
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,
|
data/lib/bolognese/version.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2021-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|