bolognese 1.9.11 → 1.9.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/pull-request.yml +21 -0
- data/CHANGELOG.md +29 -7
- data/Gemfile.lock +74 -75
- data/bolognese.gemspec +1 -1
- data/lib/bolognese/readers/datacite_reader.rb +17 -13
- data/lib/bolognese/version.rb +1 -1
- data/resources/oecd/dfg-mappings.json +1866 -0
- data/spec/readers/datacite_reader_spec.rb +41 -0
- metadata +14 -6
@@ -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.14
|
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: 2022-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|
@@ -48,16 +48,22 @@ dependencies:
|
|
48
48
|
name: nokogiri
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.13.2
|
54
|
+
- - "<"
|
52
55
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
56
|
+
version: '1.14'
|
54
57
|
type: :runtime
|
55
58
|
prerelease: false
|
56
59
|
version_requirements: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
|
-
- - "
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 1.13.2
|
64
|
+
- - "<"
|
59
65
|
- !ruby/object:Gem::Version
|
60
|
-
version: 1.
|
66
|
+
version: '1.14'
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: loofah
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -561,6 +567,7 @@ extra_rdoc_files:
|
|
561
567
|
files:
|
562
568
|
- ".github/workflows/build.yml"
|
563
569
|
- ".github/workflows/changelog.yml"
|
570
|
+
- ".github/workflows/pull-request.yml"
|
564
571
|
- ".github/workflows/release.yml"
|
565
572
|
- ".gitignore"
|
566
573
|
- ".rubocop.yml"
|
@@ -738,6 +745,7 @@ files:
|
|
738
745
|
- resources/kernel-4/include/datacite-titleType-v4.xsd
|
739
746
|
- resources/kernel-4/include/xml.xsd
|
740
747
|
- resources/kernel-4/metadata.xsd
|
748
|
+
- resources/oecd/dfg-mappings.json
|
741
749
|
- resources/oecd/for-mappings.json
|
742
750
|
- resources/oecd/fos-mappings.json
|
743
751
|
- resources/schema_org/jsonldcontext.json
|