bolognese 1.9.10 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +4 -18
- data/.github/workflows/ci.yml +22 -0
- data/.github/workflows/pull-request.yml +9 -0
- data/.github/workflows/release.yml +8 -13
- data/.gitignore +1 -0
- data/CHANGELOG.md +87 -0
- data/Gemfile.lock +84 -84
- data/bolognese.gemspec +2 -2
- data/lib/bolognese/author_utils.rb +5 -5
- data/lib/bolognese/datacite_utils.rb +32 -26
- data/lib/bolognese/doi_utils.rb +4 -0
- data/lib/bolognese/readers/datacite_reader.rb +26 -15
- data/lib/bolognese/readers/schema_org_reader.rb +3 -4
- data/lib/bolognese/utils.rb +63 -10
- data/lib/bolognese/version.rb +1 -1
- data/resources/oecd/dfg-mappings.json +1866 -0
- data/spec/author_utils_spec.rb +14 -2
- data/spec/datacite_utils_spec.rb +25 -0
- data/spec/fixtures/datacite-example-ROR-nameIdentifiers.xml +102 -0
- data/spec/fixtures/datacite-example-nameIdentifier-with-schemeURI.xml +94 -0
- data/spec/fixtures/datacite-funderIdentifier.xml +20 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_items/insert.yml +73 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_sandbox.yml +65 -0
- data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_sandbox_https.yml +65 -0
- data/spec/metadata_spec.rb +1 -1
- data/spec/readers/datacite_json_reader_spec.rb +1 -1
- data/spec/readers/datacite_reader_spec.rb +79 -6
- data/spec/utils_spec.rb +65 -4
- metadata +21 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 532586fba70709be6c7581b595a2c0d72ad1000c9c54b951ad5e4758715e81c1
|
|
4
|
+
data.tar.gz: 3029c21ac460e41479459df642e3d501b1195e6cc8a0e26d6a4ba5bba91ce13f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3893a351e49ad8e8acb0ef5265fb3acdc149e67a99174de0d0855d594e7d9c16f09baeda4d9b1aba7235aef661135e7d1bd1ac401df81601c99217e155153395
|
|
7
|
+
data.tar.gz: f6225b13dae84dcc897fa1dda7aadb266e667f8bf6a3a2da2e3f6ad134f314f17c3c6613ef8c2dec54091d9f4b4f055023bdb00ace39baf018b1654820cf7eff
|
data/.github/workflows/build.yml
CHANGED
|
@@ -5,33 +5,19 @@ on:
|
|
|
5
5
|
branches:
|
|
6
6
|
- "master"
|
|
7
7
|
jobs:
|
|
8
|
+
ci:
|
|
9
|
+
uses: ./.github/workflows/ci.yml
|
|
8
10
|
build:
|
|
11
|
+
needs: ci
|
|
9
12
|
runs-on: ubuntu-latest
|
|
10
13
|
env:
|
|
11
14
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
12
15
|
steps:
|
|
13
|
-
- uses: actions/checkout@v2
|
|
14
|
-
- name: Set up Ruby 2.6
|
|
15
|
-
uses: actions/setup-ruby@v1
|
|
16
|
-
with:
|
|
17
|
-
ruby-version: 2.6.x
|
|
18
|
-
|
|
19
|
-
- name: Build and test
|
|
20
|
-
run: |
|
|
21
|
-
gem install bundler
|
|
22
|
-
bundle install
|
|
23
|
-
bundle exec rspec
|
|
24
|
-
|
|
25
|
-
- name: Publish code coverage
|
|
26
|
-
uses: paambaati/codeclimate-action@v2.7.4
|
|
27
|
-
env:
|
|
28
|
-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
29
|
-
|
|
30
16
|
- name: Notify Slack
|
|
31
17
|
uses: adamkdean/simple-slack-notify@1.0.4
|
|
32
18
|
with:
|
|
33
19
|
channel: '#ops'
|
|
34
20
|
username: 'GitHub Actions'
|
|
35
21
|
color: 'good'
|
|
36
|
-
text: 'A new version of the bolognese gem
|
|
22
|
+
text: 'A new version of the bolognese gem is ready for release.'
|
|
37
23
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: Run Tests
|
|
2
|
+
on:
|
|
3
|
+
workflow_call:
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
strategy:
|
|
8
|
+
fail-fast: false
|
|
9
|
+
matrix:
|
|
10
|
+
ruby: ["2.6", "2.7", "3.0", "3.1"]
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v3
|
|
14
|
+
- name: Set up Ruby ${{matrix.ruby}}
|
|
15
|
+
uses: ruby/setup-ruby@v1
|
|
16
|
+
with:
|
|
17
|
+
ruby-version: ${{matrix.ruby}}
|
|
18
|
+
bundler-cache: true
|
|
19
|
+
|
|
20
|
+
- name: Run tests
|
|
21
|
+
run: |
|
|
22
|
+
bundle exec rspec
|
|
@@ -4,28 +4,23 @@ on:
|
|
|
4
4
|
release:
|
|
5
5
|
types: [published]
|
|
6
6
|
jobs:
|
|
7
|
+
ci:
|
|
8
|
+
uses: ./.github/workflows/ci.yml
|
|
7
9
|
build:
|
|
10
|
+
needs: ci
|
|
8
11
|
runs-on: ubuntu-latest
|
|
9
12
|
env:
|
|
10
13
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
11
14
|
steps:
|
|
12
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v3
|
|
13
16
|
- name: Set up Ruby 2.6
|
|
14
|
-
uses:
|
|
17
|
+
uses: ruby/setup-ruby@v1
|
|
15
18
|
with:
|
|
16
|
-
ruby-version: 2.6
|
|
19
|
+
ruby-version: "2.6"
|
|
17
20
|
|
|
18
|
-
- name: Build
|
|
21
|
+
- name: Build
|
|
19
22
|
run: |
|
|
20
|
-
gem install bundler
|
|
21
23
|
bundle install
|
|
22
|
-
bundle exec rspec spec
|
|
23
|
-
|
|
24
|
-
- name: Code Climate Test Reporter
|
|
25
|
-
uses: aktions/codeclimate-test-reporter@v1
|
|
26
|
-
with:
|
|
27
|
-
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
28
|
-
command: after-build
|
|
29
24
|
|
|
30
25
|
- name: Publish to RubyGems
|
|
31
26
|
run: |
|
|
@@ -44,4 +39,4 @@ jobs:
|
|
|
44
39
|
channel: '#ops'
|
|
45
40
|
username: 'GitHub Actions'
|
|
46
41
|
color: 'good'
|
|
47
|
-
text: 'A new version of the bolognese gem has been released.'
|
|
42
|
+
text: 'A new version of the bolognese gem has been released.'
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,91 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.10.0](https://github.com/datacite/bolognese/tree/1.10.0) (2022-10-14)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.18...1.10.0)
|
|
6
|
+
|
|
7
|
+
**Merged pull requests:**
|
|
8
|
+
|
|
9
|
+
- Add DFG-to-FOS mappings utility function [\#147](https://github.com/datacite/bolognese/pull/147) ([jrhoads](https://github.com/jrhoads))
|
|
10
|
+
|
|
11
|
+
## [1.9.18](https://github.com/datacite/bolognese/tree/1.9.18) (2022-10-11)
|
|
12
|
+
|
|
13
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.17...1.9.18)
|
|
14
|
+
|
|
15
|
+
**Fixed bugs:**
|
|
16
|
+
|
|
17
|
+
- Fix related items handling to not include elements when they are blank [\#140](https://github.com/datacite/bolognese/issues/140)
|
|
18
|
+
- Related Items error out if RelatedItemIdentifier is nil [\#139](https://github.com/datacite/bolognese/issues/139)
|
|
19
|
+
|
|
20
|
+
**Merged pull requests:**
|
|
21
|
+
|
|
22
|
+
- bump version number [\#145](https://github.com/datacite/bolognese/pull/145) ([digitaldogsbody](https://github.com/digitaldogsbody))
|
|
23
|
+
- Fix relatedItems handling [\#144](https://github.com/datacite/bolognese/pull/144) ([digitaldogsbody](https://github.com/digitaldogsbody))
|
|
24
|
+
- Fixes normalization behavior that omitted non-URL funding identifiers when reading from DataCite XML. Adds normalization for Crossref Funder ID and ROR funderIdentifierTypes. [\#143](https://github.com/datacite/bolognese/pull/143) ([codycooperross](https://github.com/codycooperross))
|
|
25
|
+
- Including a schemeURI with a nameIdentifier that is a URL will concat… [\#137](https://github.com/datacite/bolognese/pull/137) ([codycooperross](https://github.com/codycooperross))
|
|
26
|
+
|
|
27
|
+
## [1.9.17](https://github.com/datacite/bolognese/tree/1.9.17) (2022-07-04)
|
|
28
|
+
|
|
29
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.16...1.9.17)
|
|
30
|
+
|
|
31
|
+
## [1.9.16](https://github.com/datacite/bolognese/tree/1.9.16) (2022-07-04)
|
|
32
|
+
|
|
33
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.15...1.9.16)
|
|
34
|
+
|
|
35
|
+
## [1.9.15](https://github.com/datacite/bolognese/tree/1.9.15) (2022-07-04)
|
|
36
|
+
|
|
37
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.14...1.9.15)
|
|
38
|
+
|
|
39
|
+
**Merged pull requests:**
|
|
40
|
+
|
|
41
|
+
- Fix issue Bracco 521 [\#138](https://github.com/datacite/bolognese/pull/138) ([richardhallett](https://github.com/richardhallett))
|
|
42
|
+
|
|
43
|
+
## [1.9.14](https://github.com/datacite/bolognese/tree/1.9.14) (2022-05-25)
|
|
44
|
+
|
|
45
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.13...1.9.14)
|
|
46
|
+
|
|
47
|
+
**Merged pull requests:**
|
|
48
|
+
|
|
49
|
+
- Update critical dependencies [\#134](https://github.com/datacite/bolognese/pull/134) ([jrhoads](https://github.com/jrhoads))
|
|
50
|
+
|
|
51
|
+
## [1.9.13](https://github.com/datacite/bolognese/tree/1.9.13) (2022-01-06)
|
|
52
|
+
|
|
53
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.12...1.9.13)
|
|
54
|
+
|
|
55
|
+
**Fixed bugs:**
|
|
56
|
+
|
|
57
|
+
- Schema 4 RelatedItems does not allow relatedItem without relatedItemIdentifier [\#118](https://github.com/datacite/bolognese/issues/118)
|
|
58
|
+
|
|
59
|
+
**Closed issues:**
|
|
60
|
+
|
|
61
|
+
- How to use "bolognese help \[COMMAND\]"? [\#129](https://github.com/datacite/bolognese/issues/129)
|
|
62
|
+
- Move nokogiri dependency up to dependency \>= 1.12.5 [\#127](https://github.com/datacite/bolognese/issues/127)
|
|
63
|
+
|
|
64
|
+
**Merged pull requests:**
|
|
65
|
+
|
|
66
|
+
- update nokogiri to latest, including updating maremma [\#130](https://github.com/datacite/bolognese/pull/130) ([orangewolf](https://github.com/orangewolf))
|
|
67
|
+
|
|
68
|
+
## [1.9.12](https://github.com/datacite/bolognese/tree/1.9.12) (2021-08-19)
|
|
69
|
+
|
|
70
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.11...1.9.12)
|
|
71
|
+
|
|
72
|
+
## [1.9.11](https://github.com/datacite/bolognese/tree/1.9.11) (2021-08-17)
|
|
73
|
+
|
|
74
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.10...1.9.11)
|
|
75
|
+
|
|
76
|
+
**Closed issues:**
|
|
77
|
+
|
|
78
|
+
- Sandbox Orcid URLs are not allowed. [\#120](https://github.com/datacite/bolognese/issues/120)
|
|
79
|
+
|
|
80
|
+
**Merged pull requests:**
|
|
81
|
+
|
|
82
|
+
- Test against multiple versions of ruby \(2.6, 2.7, 3.0, and 3.1\) [\#141](https://github.com/datacite/bolognese/pull/141) ([jrhoads](https://github.com/jrhoads))
|
|
83
|
+
- Allow Orcid URLs to have been issued from the sandbox [\#121](https://github.com/datacite/bolognese/pull/121) ([prdanelli](https://github.com/prdanelli))
|
|
84
|
+
|
|
85
|
+
## [1.9.10](https://github.com/datacite/bolognese/tree/1.9.10) (2021-07-20)
|
|
86
|
+
|
|
87
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.9...1.9.10)
|
|
88
|
+
|
|
3
89
|
## [1.9.9](https://github.com/datacite/bolognese/tree/1.9.9) (2021-06-09)
|
|
4
90
|
|
|
5
91
|
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.8...1.9.9)
|
|
@@ -29,6 +115,7 @@
|
|
|
29
115
|
|
|
30
116
|
**Merged pull requests:**
|
|
31
117
|
|
|
118
|
+
- mapping for DFG-to-OECD [\#125](https://github.com/datacite/bolognese/pull/125) ([kjgarza](https://github.com/kjgarza))
|
|
32
119
|
- Fix missing affiliation identifier [\#117](https://github.com/datacite/bolognese/pull/117) ([richardhallett](https://github.com/richardhallett))
|
|
33
120
|
- Add support for book title and additional metadata when reading Crossref Book Chapter DOI [\#115](https://github.com/datacite/bolognese/pull/115) ([prdanelli](https://github.com/prdanelli))
|
|
34
121
|
- Valid Funder DOIs are being rejected for not starting with a 5 [\#114](https://github.com/datacite/bolognese/pull/114) ([prdanelli](https://github.com/prdanelli))
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
bolognese (1.
|
|
4
|
+
bolognese (1.10.0)
|
|
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.9.4, < 5)
|
|
21
21
|
namae (~> 1.0)
|
|
22
|
-
nokogiri (
|
|
22
|
+
nokogiri (>= 1.13.2, < 1.14)
|
|
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,7 +30,7 @@ PATH
|
|
|
30
30
|
GEM
|
|
31
31
|
remote: https://rubygems.org/
|
|
32
32
|
specs:
|
|
33
|
-
activesupport (6.1.
|
|
33
|
+
activesupport (6.1.7)
|
|
34
34
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
35
35
|
i18n (>= 1.6, < 2)
|
|
36
36
|
minitest (>= 5.1)
|
|
@@ -38,38 +38,39 @@ GEM
|
|
|
38
38
|
zeitwerk (~> 2.3)
|
|
39
39
|
addressable (2.8.0)
|
|
40
40
|
public_suffix (>= 2.0.2, < 5.0)
|
|
41
|
-
amazing_print (1.
|
|
41
|
+
amazing_print (1.4.0)
|
|
42
42
|
benchmark_methods (0.7)
|
|
43
43
|
bibtex-ruby (6.0.0)
|
|
44
44
|
latex-decode (~> 0.0)
|
|
45
45
|
builder (3.2.4)
|
|
46
46
|
citeproc (1.0.10)
|
|
47
47
|
namae (~> 1.0)
|
|
48
|
-
citeproc-ruby (1.1.
|
|
48
|
+
citeproc-ruby (1.1.14)
|
|
49
49
|
citeproc (~> 1.0, >= 1.0.9)
|
|
50
|
-
csl (~> 1.
|
|
50
|
+
csl (~> 1.6)
|
|
51
51
|
colorize (0.8.1)
|
|
52
|
-
concurrent-ruby (1.1.
|
|
52
|
+
concurrent-ruby (1.1.10)
|
|
53
53
|
crack (0.4.5)
|
|
54
54
|
rexml
|
|
55
55
|
crass (1.0.6)
|
|
56
|
-
csl (1.
|
|
56
|
+
csl (1.6.0)
|
|
57
57
|
namae (~> 1.0)
|
|
58
|
+
rexml
|
|
58
59
|
csl-styles (1.0.1.11)
|
|
59
60
|
csl (~> 1.0)
|
|
60
|
-
diff-lcs (1.
|
|
61
|
+
diff-lcs (1.5.0)
|
|
61
62
|
docile (1.4.0)
|
|
62
|
-
ebnf (2.1
|
|
63
|
-
amazing_print (~> 1.
|
|
63
|
+
ebnf (2.3.1)
|
|
64
|
+
amazing_print (~> 1.4)
|
|
64
65
|
htmlentities (~> 4.3)
|
|
65
|
-
rdf (~> 3.
|
|
66
|
+
rdf (~> 3.2)
|
|
66
67
|
scanf (~> 1.0)
|
|
67
|
-
sxp (~> 1.
|
|
68
|
-
unicode-types (~> 1.
|
|
69
|
-
edtf (3.0
|
|
70
|
-
activesupport (>= 3.0, <
|
|
68
|
+
sxp (~> 1.2)
|
|
69
|
+
unicode-types (~> 1.7)
|
|
70
|
+
edtf (3.1.0)
|
|
71
|
+
activesupport (>= 3.0, < 8.0)
|
|
71
72
|
excon (0.71.1)
|
|
72
|
-
faraday (0.17.
|
|
73
|
+
faraday (0.17.5)
|
|
73
74
|
multipart-post (>= 1.2, < 3)
|
|
74
75
|
faraday-encoding (0.0.5)
|
|
75
76
|
faraday
|
|
@@ -77,37 +78,35 @@ GEM
|
|
|
77
78
|
faraday (>= 0.7.4, < 1.0)
|
|
78
79
|
gender_detector (0.1.2)
|
|
79
80
|
unicode_utils (>= 1.3.0)
|
|
80
|
-
haml (5.2.
|
|
81
|
+
haml (5.2.2)
|
|
81
82
|
temple (>= 0.8.0)
|
|
82
83
|
tilt
|
|
83
|
-
hamster (3.0.0)
|
|
84
|
-
concurrent-ruby (~> 1.0)
|
|
85
84
|
hashdiff (1.0.1)
|
|
86
85
|
htmlentities (4.3.4)
|
|
87
|
-
i18n (1.
|
|
86
|
+
i18n (1.12.0)
|
|
88
87
|
concurrent-ruby (~> 1.0)
|
|
89
88
|
iso8601 (0.9.1)
|
|
90
|
-
json (2.
|
|
91
|
-
json-canonicalization (0.
|
|
92
|
-
json-ld (3.
|
|
89
|
+
json (2.6.2)
|
|
90
|
+
json-canonicalization (0.3.0)
|
|
91
|
+
json-ld (3.2.3)
|
|
93
92
|
htmlentities (~> 4.3)
|
|
94
|
-
json-canonicalization (~> 0.
|
|
93
|
+
json-canonicalization (~> 0.3)
|
|
95
94
|
link_header (~> 0.0, >= 0.0.8)
|
|
96
|
-
multi_json (~> 1.
|
|
97
|
-
rack (~> 2.
|
|
98
|
-
rdf (~> 3.
|
|
99
|
-
json-ld-preloaded (3.1
|
|
100
|
-
json-ld (~> 3.
|
|
101
|
-
rdf (~> 3.
|
|
95
|
+
multi_json (~> 1.15)
|
|
96
|
+
rack (~> 2.2)
|
|
97
|
+
rdf (~> 3.2, >= 3.2.9)
|
|
98
|
+
json-ld-preloaded (3.2.1)
|
|
99
|
+
json-ld (~> 3.2)
|
|
100
|
+
rdf (~> 3.2)
|
|
102
101
|
jsonlint (0.3.0)
|
|
103
102
|
oj (~> 3)
|
|
104
103
|
optimist (~> 3)
|
|
105
|
-
latex-decode (0.
|
|
104
|
+
latex-decode (0.4.0)
|
|
106
105
|
link_header (0.0.8)
|
|
107
|
-
loofah (2.
|
|
106
|
+
loofah (2.19.0)
|
|
108
107
|
crass (~> 1.0.2)
|
|
109
108
|
nokogiri (>= 1.5.9)
|
|
110
|
-
maremma (4.9.
|
|
109
|
+
maremma (4.9.8)
|
|
111
110
|
activesupport (>= 4.2.5)
|
|
112
111
|
addressable (>= 2.3.6)
|
|
113
112
|
builder (~> 3.2, >= 3.2.2)
|
|
@@ -115,18 +114,19 @@ GEM
|
|
|
115
114
|
faraday (~> 0.17.3)
|
|
116
115
|
faraday-encoding (~> 0.0.4)
|
|
117
116
|
faraday_middleware (~> 0.14.0)
|
|
118
|
-
nokogiri (
|
|
117
|
+
nokogiri (>= 1.11.2, < 1.14.0)
|
|
119
118
|
oj (>= 2.8.3)
|
|
120
119
|
oj_mimic_json (~> 1.0, >= 1.0.1)
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
matrix (0.4.2)
|
|
121
|
+
mini_portile2 (2.8.0)
|
|
122
|
+
minitest (5.16.3)
|
|
123
123
|
multi_json (1.15.0)
|
|
124
|
-
multipart-post (2.
|
|
124
|
+
multipart-post (2.2.3)
|
|
125
125
|
namae (1.1.1)
|
|
126
|
-
nokogiri (1.
|
|
127
|
-
mini_portile2 (~> 2.
|
|
126
|
+
nokogiri (1.13.6)
|
|
127
|
+
mini_portile2 (~> 2.8.0)
|
|
128
128
|
racc (~> 1.4)
|
|
129
|
-
oj (3.
|
|
129
|
+
oj (3.13.21)
|
|
130
130
|
oj_mimic_json (1.0.1)
|
|
131
131
|
optimist (3.0.1)
|
|
132
132
|
postrank-uri (1.0.24)
|
|
@@ -134,50 +134,49 @@ GEM
|
|
|
134
134
|
nokogiri (>= 1.8.0)
|
|
135
135
|
public_suffix (>= 2.0.0, < 2.1)
|
|
136
136
|
public_suffix (2.0.5)
|
|
137
|
-
racc (1.
|
|
138
|
-
rack (2.2.3)
|
|
137
|
+
racc (1.6.0)
|
|
138
|
+
rack (2.2.3.1)
|
|
139
139
|
rack-test (0.8.3)
|
|
140
140
|
rack (>= 1.0, < 3)
|
|
141
141
|
rake (12.3.3)
|
|
142
|
-
rdf (3.
|
|
143
|
-
hamster (~> 3.0)
|
|
142
|
+
rdf (3.2.9)
|
|
144
143
|
link_header (~> 0.0, >= 0.0.8)
|
|
145
|
-
rdf-aggregate-repo (3.1
|
|
146
|
-
rdf (~> 3.
|
|
147
|
-
rdf-rdfa (3.
|
|
144
|
+
rdf-aggregate-repo (3.2.1)
|
|
145
|
+
rdf (~> 3.2)
|
|
146
|
+
rdf-rdfa (3.2.0)
|
|
148
147
|
haml (~> 5.2)
|
|
149
148
|
htmlentities (~> 4.3)
|
|
150
|
-
rdf (~> 3.
|
|
151
|
-
rdf-aggregate-repo (~> 3.
|
|
152
|
-
rdf-vocab (~> 3.
|
|
153
|
-
rdf-xsd (~> 3.
|
|
154
|
-
rdf-rdfxml (3.
|
|
149
|
+
rdf (~> 3.2)
|
|
150
|
+
rdf-aggregate-repo (~> 3.2)
|
|
151
|
+
rdf-vocab (~> 3.2)
|
|
152
|
+
rdf-xsd (~> 3.2)
|
|
153
|
+
rdf-rdfxml (3.2.0)
|
|
155
154
|
htmlentities (~> 4.3)
|
|
156
|
-
rdf (~> 3.
|
|
157
|
-
rdf-rdfa (~> 3.
|
|
158
|
-
rdf-xsd (~> 3.
|
|
159
|
-
rdf-turtle (3.1
|
|
160
|
-
ebnf (~> 2.
|
|
161
|
-
rdf (~> 3.
|
|
162
|
-
rdf-vocab (3.
|
|
163
|
-
rdf (~> 3.
|
|
164
|
-
rdf-xsd (3.
|
|
165
|
-
rdf (~> 3.
|
|
155
|
+
rdf (~> 3.2)
|
|
156
|
+
rdf-rdfa (~> 3.2)
|
|
157
|
+
rdf-xsd (~> 3.2)
|
|
158
|
+
rdf-turtle (3.2.1)
|
|
159
|
+
ebnf (~> 2.3)
|
|
160
|
+
rdf (~> 3.2)
|
|
161
|
+
rdf-vocab (3.2.2)
|
|
162
|
+
rdf (~> 3.2, >= 3.2.4)
|
|
163
|
+
rdf-xsd (3.2.1)
|
|
164
|
+
rdf (~> 3.2)
|
|
166
165
|
rexml (~> 3.2)
|
|
167
166
|
rexml (3.2.5)
|
|
168
|
-
rspec (3.
|
|
169
|
-
rspec-core (~> 3.
|
|
170
|
-
rspec-expectations (~> 3.
|
|
171
|
-
rspec-mocks (~> 3.
|
|
172
|
-
rspec-core (3.
|
|
173
|
-
rspec-support (~> 3.
|
|
174
|
-
rspec-expectations (3.
|
|
167
|
+
rspec (3.11.0)
|
|
168
|
+
rspec-core (~> 3.11.0)
|
|
169
|
+
rspec-expectations (~> 3.11.0)
|
|
170
|
+
rspec-mocks (~> 3.11.0)
|
|
171
|
+
rspec-core (3.11.0)
|
|
172
|
+
rspec-support (~> 3.11.0)
|
|
173
|
+
rspec-expectations (3.11.0)
|
|
175
174
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
176
|
-
rspec-support (~> 3.
|
|
177
|
-
rspec-mocks (3.
|
|
175
|
+
rspec-support (~> 3.11.0)
|
|
176
|
+
rspec-mocks (3.11.1)
|
|
178
177
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
179
|
-
rspec-support (~> 3.
|
|
180
|
-
rspec-support (3.
|
|
178
|
+
rspec-support (~> 3.11.0)
|
|
179
|
+
rspec-support (3.11.0)
|
|
181
180
|
rspec-xsd (0.1.0)
|
|
182
181
|
nokogiri (~> 1.6)
|
|
183
182
|
rspec (~> 3)
|
|
@@ -187,21 +186,22 @@ GEM
|
|
|
187
186
|
json (>= 1.8, < 3)
|
|
188
187
|
simplecov-html (~> 0.10.0)
|
|
189
188
|
simplecov-html (0.10.2)
|
|
190
|
-
sxp (1.
|
|
191
|
-
|
|
189
|
+
sxp (1.2.2)
|
|
190
|
+
matrix
|
|
191
|
+
rdf (~> 3.2)
|
|
192
192
|
temple (0.8.2)
|
|
193
|
-
thor (1.1
|
|
194
|
-
tilt (2.0.
|
|
195
|
-
tzinfo (2.0.
|
|
193
|
+
thor (1.2.1)
|
|
194
|
+
tilt (2.0.11)
|
|
195
|
+
tzinfo (2.0.5)
|
|
196
196
|
concurrent-ruby (~> 1.0)
|
|
197
|
-
unicode-types (1.
|
|
197
|
+
unicode-types (1.8.0)
|
|
198
198
|
unicode_utils (1.4.0)
|
|
199
199
|
vcr (3.0.3)
|
|
200
|
-
webmock (3.
|
|
201
|
-
addressable (>= 2.
|
|
200
|
+
webmock (3.14.0)
|
|
201
|
+
addressable (>= 2.8.0)
|
|
202
202
|
crack (>= 0.3.2)
|
|
203
203
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
204
|
-
zeitwerk (2.
|
|
204
|
+
zeitwerk (2.6.1)
|
|
205
205
|
|
|
206
206
|
PLATFORMS
|
|
207
207
|
ruby
|
|
@@ -219,4 +219,4 @@ DEPENDENCIES
|
|
|
219
219
|
webmock (~> 3.0, >= 3.0.1)
|
|
220
220
|
|
|
221
221
|
BUNDLED WITH
|
|
222
|
-
2.
|
|
222
|
+
2.3.12
|
data/bolognese.gemspec
CHANGED
|
@@ -13,12 +13,12 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
s.version = Bolognese::VERSION
|
|
14
14
|
s.extra_rdoc_files = ["README.md"]
|
|
15
15
|
s.license = 'MIT'
|
|
16
|
-
s.required_ruby_version = '
|
|
16
|
+
s.required_ruby_version = ['>=2.3']
|
|
17
17
|
|
|
18
18
|
# Declare dependencies here, rather than in the Gemfile
|
|
19
19
|
s.add_dependency 'maremma', '>= 4.9.4', '< 5'
|
|
20
20
|
s.add_dependency 'faraday', '~> 0.17.3'
|
|
21
|
-
s.add_dependency 'nokogiri', '
|
|
21
|
+
s.add_dependency 'nokogiri', '>= 1.13.2', '< 1.14'
|
|
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'
|
|
@@ -35,15 +35,15 @@ module Bolognese
|
|
|
35
35
|
"nameIdentifier" => normalize_orcid(ni["__content__"]),
|
|
36
36
|
"schemeUri" => "https://orcid.org",
|
|
37
37
|
"nameIdentifierScheme" => "ORCID" }.compact
|
|
38
|
-
elsif ni["
|
|
38
|
+
elsif ni["nameIdentifierScheme"] == "ROR"
|
|
39
39
|
{
|
|
40
|
-
"nameIdentifier" => ni["
|
|
41
|
-
"schemeUri" =>
|
|
42
|
-
"nameIdentifierScheme" =>
|
|
40
|
+
"nameIdentifier" => normalize_ror(ni["__content__"]),
|
|
41
|
+
"schemeUri" => "https://ror.org",
|
|
42
|
+
"nameIdentifierScheme" => "ROR" }.compact
|
|
43
43
|
else
|
|
44
44
|
{
|
|
45
45
|
"nameIdentifier" => ni["__content__"],
|
|
46
|
-
"schemeUri" => nil,
|
|
46
|
+
"schemeUri" => ni.fetch("schemeURI", nil),
|
|
47
47
|
"nameIdentifierScheme" => ni["nameIdentifierScheme"] }.compact
|
|
48
48
|
end
|
|
49
49
|
end.presence
|
|
@@ -222,19 +222,23 @@ module Bolognese
|
|
|
222
222
|
|
|
223
223
|
xml.relatedItem(related_item["relatedItem"], attributes) do
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
225
|
+
if related_item["relatedItemIdentifier"].present?
|
|
226
|
+
xml.relatedItemIdentifier(related_item["relatedItemIdentifier"]['relatedItemIdentifier'],
|
|
227
|
+
{
|
|
228
|
+
'relatedItemIdentifierType' => related_item["relatedItemIdentifier"]["relatedItemIdentifierType"],
|
|
229
|
+
'relatedMetadataScheme' => related_item["relatedItemIdentifier"]["relatedMetadataScheme"],
|
|
230
|
+
'schemeURI' => related_item["relatedItemIdentifier"]["schemeURI"],
|
|
231
|
+
'schemeType' => related_item["relatedItemIdentifier"]["schemeType"],
|
|
232
|
+
}.compact
|
|
233
|
+
)
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
if related_item["creators"].present?
|
|
237
|
+
xml.creators do
|
|
238
|
+
Array.wrap(related_item['creators']).each do |au|
|
|
239
|
+
xml.creator do
|
|
240
|
+
insert_person(xml, au, "creator")
|
|
241
|
+
end
|
|
238
242
|
end
|
|
239
243
|
end
|
|
240
244
|
end
|
|
@@ -253,19 +257,21 @@ module Bolognese
|
|
|
253
257
|
end
|
|
254
258
|
end
|
|
255
259
|
|
|
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
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
260
|
+
xml.publicationYear(related_item['publicationYear']) if related_item["publicationYear"].present?
|
|
261
|
+
xml.volume(related_item['volume']) if related_item["volume"].present?
|
|
262
|
+
xml.issue(related_item['issue']) if related_item["issue"].present?
|
|
263
|
+
xml.number(related_item['number'], {'numberType' => related_item['numberType']}.compact) if related_item["number"].present?
|
|
264
|
+
xml.firstPage(related_item['firstPage']) if related_item["firstPage"].present?
|
|
265
|
+
xml.lastPage(related_item['lastPage']) if related_item["lastPage"].present?
|
|
266
|
+
xml.publisher(related_item['publisher']) if related_item["publisher"].present?
|
|
267
|
+
xml.edition(related_item['edition']) if related_item["edition"].present?
|
|
268
|
+
|
|
269
|
+
if related_item["contributors"].present?
|
|
270
|
+
xml.contributors do
|
|
271
|
+
Array.wrap(related_item["contributors"]).each do |con|
|
|
272
|
+
xml.contributor("contributorType" => con["contributorType"] || "Other") do
|
|
273
|
+
insert_person(xml, con, "contributor")
|
|
274
|
+
end
|
|
269
275
|
end
|
|
270
276
|
end
|
|
271
277
|
end
|
data/lib/bolognese/doi_utils.rb
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Bolognese
|
|
4
4
|
module DoiUtils
|
|
5
|
+
class << self
|
|
6
|
+
include DoiUtils
|
|
7
|
+
end
|
|
8
|
+
|
|
5
9
|
def validate_doi(doi)
|
|
6
10
|
doi = Array(/\A(?:(http|https):\/(\/)?(dx\.)?(doi.org|handle.stage.datacite.org|handle.test.datacite.org)\/)?(doi:)?(10\.\d{4,5}\/.+)\z/.match(doi)).last
|
|
7
11
|
# remove non-printing whitespace and downcase
|