bolognese 1.9.12 → 2.0.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.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +2 -30
  3. data/.github/workflows/ci.yml +22 -0
  4. data/.github/workflows/pull-request.yml +9 -0
  5. data/.github/workflows/release.yml +7 -22
  6. data/.gitignore +1 -0
  7. data/CHANGELOG.md +71 -0
  8. data/Gemfile.lock +106 -92
  9. data/bolognese.gemspec +4 -3
  10. data/lib/bolognese/author_utils.rb +19 -6
  11. data/lib/bolognese/datacite_utils.rb +50 -36
  12. data/lib/bolognese/doi_utils.rb +4 -0
  13. data/lib/bolognese/metadata.rb +1 -1
  14. data/lib/bolognese/metadata_utils.rb +1 -1
  15. data/lib/bolognese/readers/bibtex_reader.rb +2 -2
  16. data/lib/bolognese/readers/citeproc_reader.rb +1 -1
  17. data/lib/bolognese/readers/codemeta_reader.rb +2 -2
  18. data/lib/bolognese/readers/crosscite_reader.rb +4 -1
  19. data/lib/bolognese/readers/crossref_reader.rb +3 -4
  20. data/lib/bolognese/readers/datacite_json_reader.rb +4 -1
  21. data/lib/bolognese/readers/datacite_reader.rb +34 -11
  22. data/lib/bolognese/readers/npm_reader.rb +1 -1
  23. data/lib/bolognese/readers/ris_reader.rb +2 -2
  24. data/lib/bolognese/readers/schema_org_reader.rb +6 -6
  25. data/lib/bolognese/utils.rb +84 -14
  26. data/lib/bolognese/version.rb +1 -1
  27. data/lib/bolognese/writers/bibtex_writer.rb +1 -1
  28. data/lib/bolognese/writers/codemeta_writer.rb +1 -1
  29. data/lib/bolognese/writers/csv_writer.rb +1 -1
  30. data/lib/bolognese/writers/datacite_json_writer.rb +6 -1
  31. data/lib/bolognese/writers/jats_writer.rb +3 -3
  32. data/lib/bolognese/writers/ris_writer.rb +2 -2
  33. data/lib/bolognese/writers/schema_org_writer.rb +2 -2
  34. data/resources/kernel-4/include/datacite-relationType-v4.xsd +2 -0
  35. data/resources/kernel-4/include/datacite-resourceType-v4.xsd +2 -0
  36. data/resources/kernel-4/metadata.xsd +11 -7
  37. data/resources/kernel-4.5/include/datacite-contributorType-v4.xsd +35 -0
  38. data/resources/kernel-4.5/include/datacite-dateType-v4.xsd +25 -0
  39. data/resources/kernel-4.5/include/datacite-descriptionType-v4.xsd +19 -0
  40. data/resources/kernel-4.5/include/datacite-funderIdentifierType-v4.xsd +16 -0
  41. data/resources/kernel-4.5/include/datacite-nameType-v4.xsd +10 -0
  42. data/resources/kernel-4.5/include/datacite-numberType-v4.xsd +12 -0
  43. data/resources/kernel-4.5/include/datacite-relatedIdentifierType-v4.xsd +34 -0
  44. data/resources/kernel-4.5/include/datacite-relationType-v4.xsd +53 -0
  45. data/resources/kernel-4.5/include/datacite-resourceType-v4.xsd +45 -0
  46. data/resources/kernel-4.5/include/datacite-titleType-v4.xsd +14 -0
  47. data/resources/kernel-4.5/include/xml.xsd +286 -0
  48. data/resources/kernel-4.5/metadata.xsd +711 -0
  49. data/resources/oecd/dfg-mappings.json +1866 -0
  50. data/spec/author_utils_spec.rb +61 -2
  51. data/spec/datacite_utils_spec.rb +30 -1
  52. data/spec/fixtures/citeproc.json +4 -2
  53. data/spec/fixtures/datacite-example-ROR-nameIdentifiers.xml +117 -0
  54. data/spec/fixtures/datacite-example-full-v4.5.xml +255 -0
  55. data/spec/fixtures/datacite-example-nameIdentifier-with-schemeURI.xml +94 -0
  56. data/spec/fixtures/datacite-example-relateditems-with-attributes.xml +61 -0
  57. data/spec/fixtures/datacite-funderIdentifier.xml +20 -0
  58. data/spec/fixtures/datacite-seriesinformation.xml +7 -2
  59. data/spec/fixtures/datacite.json +9 -3
  60. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_related_items/insert.yml +73 -0
  61. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/insert_subjects/insert.yml +32 -14
  62. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_sandbox.yml +65 -0
  63. data/spec/fixtures/vcr_cassettes/Bolognese_Metadata/validate_orcid/validate_orcid_sandbox_https.yml +65 -0
  64. data/spec/metadata_spec.rb +1 -1
  65. data/spec/readers/bibtex_reader_spec.rb +2 -0
  66. data/spec/readers/citeproc_reader_spec.rb +3 -0
  67. data/spec/readers/codemeta_reader_spec.rb +4 -4
  68. data/spec/readers/crosscite_reader_spec.rb +2 -0
  69. data/spec/readers/crossref_reader_spec.rb +41 -41
  70. data/spec/readers/datacite_json_reader_spec.rb +3 -1
  71. data/spec/readers/datacite_reader_spec.rb +156 -50
  72. data/spec/readers/npm_reader_spec.rb +2 -0
  73. data/spec/readers/ris_reader_spec.rb +3 -0
  74. data/spec/readers/schema_org_reader_spec.rb +11 -11
  75. data/spec/spec_helper.rb +1 -0
  76. data/spec/utils_spec.rb +53 -4
  77. data/spec/writers/crosscite_writer_spec.rb +7 -0
  78. data/spec/writers/datacite_json_writer_spec.rb +38 -0
  79. data/spec/writers/datacite_writer_spec.rb +84 -5
  80. data/spec/writers/jats_writer_spec.rb +8 -0
  81. data/spec/writers/rdf_xml_writer_spec.rb +7 -0
  82. data/spec/writers/turtle_writer_spec.rb +18 -0
  83. metadata +49 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 809d529a1ec99aa9653b7532586134862f896e46338e33fd97ea54da86dd0ed1
4
- data.tar.gz: 85532735a718977631655c991d2c545a9974e091e5d656ab389b953b6d608165
3
+ metadata.gz: 23ccf372b59b7d9c8919ec7ad7137eef6e99512eed488977e847f938f389aa2f
4
+ data.tar.gz: 390e56023d57e637a52776a98dcd0bea4fa0acd8b8459ced05cbc6785f69fe0a
5
5
  SHA512:
6
- metadata.gz: 013f57c1d908072881e9736c29e2e623cc0b311789450a20abeb0930f2dd754a9c09cf5b69cca8647b5561ace43dec33ffe6623424f5c1e79eb5f59defc74edc
7
- data.tar.gz: 22e534387e3a579ded5f1d4da6fa46193e44169c5df2c6eb2a8a7f7fd3ba1218ecd59f74e540be67125a1dc6ab49cbf817dbaca430d26c3d3c06e2507fe127e1
6
+ metadata.gz: 3a7364a75d69846ada1320bc0e8954b72695216d2807ec39ab1694ac4d120d97806addb9ceed8b9da8c1eb06ae28740cf6d2c118cb76a05e15ca993bf81ad470
7
+ data.tar.gz: 6281527f6b312d398a96b9f1df9be55de991f6ac939417131633b24ddaa24741c3b86c3b2e4e73408ca1350e0b17addf9439ae30dff998bc6dda07e8c4459db7
@@ -5,33 +5,5 @@ on:
5
5
  branches:
6
6
  - "master"
7
7
  jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- env:
11
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
12
- 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
- - name: Notify Slack
31
- uses: adamkdean/simple-slack-notify@1.0.4
32
- with:
33
- channel: '#ops'
34
- username: 'GitHub Actions'
35
- color: 'good'
36
- text: 'A new version of the bolognese gem has been built.'
37
-
8
+ ci:
9
+ uses: ./.github/workflows/ci.yml
@@ -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
@@ -0,0 +1,9 @@
1
+ name: Pull Request - Run Tests
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+ jobs:
8
+ ci:
9
+ uses: ./.github/workflows/ci.yml
@@ -4,28 +4,21 @@ 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
- env:
10
- SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
11
12
  steps:
12
- - uses: actions/checkout@v2
13
+ - uses: actions/checkout@v3
13
14
  - name: Set up Ruby 2.6
14
- uses: actions/setup-ruby@v1
15
+ uses: ruby/setup-ruby@v1
15
16
  with:
16
- ruby-version: 2.6.x
17
+ ruby-version: "2.6"
17
18
 
18
- - name: Build and test
19
+ - name: Build
19
20
  run: |
20
- gem install bundler
21
21
  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
22
 
30
23
  - name: Publish to RubyGems
31
24
  run: |
@@ -37,11 +30,3 @@ jobs:
37
30
  gem push *.gem
38
31
  env:
39
32
  GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
40
-
41
- - name: Notify Slack
42
- uses: adamkdean/simple-slack-notify@1.0.4
43
- with:
44
- channel: '#ops'
45
- username: 'GitHub Actions'
46
- color: 'good'
47
- text: 'A new version of the bolognese gem has been released.'
data/.gitignore CHANGED
@@ -57,3 +57,4 @@ coverage/
57
57
  !.env.travis
58
58
 
59
59
  .vscode
60
+ .ruby-version
data/CHANGELOG.md CHANGED
@@ -1,5 +1,76 @@
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
+ - 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))
11
+
12
+ ## [1.9.18](https://github.com/datacite/bolognese/tree/1.9.18) (2022-10-11)
13
+
14
+ [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.17...1.9.18)
15
+
16
+ **Fixed bugs:**
17
+
18
+ - Fix related items handling to not include elements when they are blank [\#140](https://github.com/datacite/bolognese/issues/140)
19
+ - Related Items error out if RelatedItemIdentifier is nil [\#139](https://github.com/datacite/bolognese/issues/139)
20
+
21
+ **Merged pull requests:**
22
+
23
+ - bump version number [\#145](https://github.com/datacite/bolognese/pull/145) ([digitaldogsbody](https://github.com/digitaldogsbody))
24
+ - Fix relatedItems handling [\#144](https://github.com/datacite/bolognese/pull/144) ([digitaldogsbody](https://github.com/digitaldogsbody))
25
+ - 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))
26
+ - 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))
27
+
28
+ ## [1.9.17](https://github.com/datacite/bolognese/tree/1.9.17) (2022-07-04)
29
+
30
+ [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.16...1.9.17)
31
+
32
+ ## [1.9.16](https://github.com/datacite/bolognese/tree/1.9.16) (2022-07-04)
33
+
34
+ [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.15...1.9.16)
35
+
36
+ ## [1.9.15](https://github.com/datacite/bolognese/tree/1.9.15) (2022-07-04)
37
+
38
+ [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.14...1.9.15)
39
+
40
+ **Merged pull requests:**
41
+
42
+ - Fix issue Bracco 521 [\#138](https://github.com/datacite/bolognese/pull/138) ([richardhallett](https://github.com/richardhallett))
43
+
44
+ ## [1.9.14](https://github.com/datacite/bolognese/tree/1.9.14) (2022-05-25)
45
+
46
+ [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.13...1.9.14)
47
+
48
+ **Merged pull requests:**
49
+
50
+ - Update critical dependencies [\#134](https://github.com/datacite/bolognese/pull/134) ([jrhoads](https://github.com/jrhoads))
51
+
52
+ ## [1.9.13](https://github.com/datacite/bolognese/tree/1.9.13) (2022-01-06)
53
+
54
+ [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.12...1.9.13)
55
+
56
+ **Fixed bugs:**
57
+
58
+ - Schema 4 RelatedItems does not allow relatedItem without relatedItemIdentifier [\#118](https://github.com/datacite/bolognese/issues/118)
59
+
60
+ **Closed issues:**
61
+
62
+ - How to use "bolognese help \[COMMAND\]"? [\#129](https://github.com/datacite/bolognese/issues/129)
63
+ - Move nokogiri dependency up to dependency \>= 1.12.5 [\#127](https://github.com/datacite/bolognese/issues/127)
64
+
65
+ **Merged pull requests:**
66
+
67
+ - update nokogiri to latest, including updating maremma [\#130](https://github.com/datacite/bolognese/pull/130) ([orangewolf](https://github.com/orangewolf))
68
+ - mapping for DFG-to-OECD [\#125](https://github.com/datacite/bolognese/pull/125) ([kjgarza](https://github.com/kjgarza))
69
+
70
+ ## [1.9.12](https://github.com/datacite/bolognese/tree/1.9.12) (2021-08-19)
71
+
72
+ [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.11...1.9.12)
73
+
3
74
  ## [1.9.11](https://github.com/datacite/bolognese/tree/1.9.11) (2021-08-17)
4
75
 
5
76
  [Full Changelog](https://github.com/datacite/bolognese/compare/1.9.10...1.9.11)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (1.9.12)
4
+ bolognese (2.0.0)
5
5
  activesupport (>= 4.2.5)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (>= 5.1.0)
@@ -11,7 +11,6 @@ PATH
11
11
  concurrent-ruby (~> 1.1, >= 1.1.5)
12
12
  csl-styles (~> 1.0, >= 1.0.1.10)
13
13
  edtf (~> 3.0, >= 3.0.4)
14
- faraday (~> 0.17.3)
15
14
  gender_detector (~> 0.1.2)
16
15
  iso8601 (~> 0.9.1)
17
16
  json-ld-preloaded (~> 3.1, >= 3.1.3)
@@ -19,7 +18,7 @@ PATH
19
18
  loofah (~> 2.0, >= 2.0.3)
20
19
  maremma (>= 4.9.4, < 5)
21
20
  namae (~> 1.0)
22
- nokogiri (~> 1.11.2)
21
+ nokogiri (>= 1.13.2, < 1.14)
23
22
  oj (~> 3.10)
24
23
  oj_mimic_json (~> 1.0, >= 1.0.1)
25
24
  postrank-uri (~> 1.0, >= 1.0.18)
@@ -30,26 +29,26 @@ PATH
30
29
  GEM
31
30
  remote: https://rubygems.org/
32
31
  specs:
33
- activesupport (6.1.4)
32
+ activesupport (6.1.7.3)
34
33
  concurrent-ruby (~> 1.0, >= 1.0.2)
35
34
  i18n (>= 1.6, < 2)
36
35
  minitest (>= 5.1)
37
36
  tzinfo (~> 2.0)
38
37
  zeitwerk (~> 2.3)
39
- addressable (2.8.0)
40
- public_suffix (>= 2.0.2, < 5.0)
41
- amazing_print (1.3.0)
38
+ addressable (2.8.1)
39
+ public_suffix (>= 2.0.2, < 6.0)
42
40
  benchmark_methods (0.7)
43
41
  bibtex-ruby (6.0.0)
44
42
  latex-decode (~> 0.0)
45
43
  builder (3.2.4)
44
+ byebug (11.1.3)
46
45
  citeproc (1.0.10)
47
46
  namae (~> 1.0)
48
47
  citeproc-ruby (1.1.14)
49
48
  citeproc (~> 1.0, >= 1.0.9)
50
49
  csl (~> 1.6)
51
50
  colorize (0.8.1)
52
- concurrent-ruby (1.1.9)
51
+ concurrent-ruby (1.2.2)
53
52
  crack (0.4.5)
54
53
  rexml
55
54
  crass (1.0.6)
@@ -58,76 +57,87 @@ GEM
58
57
  rexml
59
58
  csl-styles (1.0.1.11)
60
59
  csl (~> 1.0)
61
- diff-lcs (1.4.4)
60
+ diff-lcs (1.5.0)
62
61
  docile (1.4.0)
63
- ebnf (2.1.3)
64
- amazing_print (~> 1.2)
62
+ ebnf (2.3.3)
65
63
  htmlentities (~> 4.3)
66
- rdf (~> 3.1)
64
+ rdf (~> 3.2)
67
65
  scanf (~> 1.0)
68
- sxp (~> 1.1)
69
- unicode-types (~> 1.6)
70
- edtf (3.0.6)
71
- activesupport (>= 3.0, < 7.0)
66
+ sxp (~> 1.2)
67
+ unicode-types (~> 1.8)
68
+ edtf (3.1.1)
69
+ activesupport (>= 3.0, < 8.0)
72
70
  excon (0.71.1)
73
- faraday (0.17.4)
74
- multipart-post (>= 1.2, < 3)
71
+ faraday (2.7.6)
72
+ faraday-net_http (>= 2.0, < 3.1)
73
+ ruby2_keywords (>= 0.0.4)
75
74
  faraday-encoding (0.0.5)
76
75
  faraday
77
- faraday_middleware (0.14.0)
78
- faraday (>= 0.7.4, < 1.0)
76
+ faraday-excon (2.1.0)
77
+ excon (>= 0.27.4)
78
+ faraday (~> 2.0)
79
+ faraday-follow_redirects (0.3.0)
80
+ faraday (>= 1, < 3)
81
+ faraday-gzip (0.1.0)
82
+ faraday (>= 1.0)
83
+ zlib (~> 2.1)
84
+ faraday-multipart (1.0.4)
85
+ multipart-post (~> 2)
86
+ faraday-net_http (3.0.2)
79
87
  gender_detector (0.1.2)
80
88
  unicode_utils (>= 1.3.0)
81
89
  haml (5.2.2)
82
90
  temple (>= 0.8.0)
83
91
  tilt
84
- hamster (3.0.0)
85
- concurrent-ruby (~> 1.0)
86
92
  hashdiff (1.0.1)
87
93
  htmlentities (4.3.4)
88
- i18n (1.8.10)
94
+ i18n (1.14.1)
89
95
  concurrent-ruby (~> 1.0)
90
96
  iso8601 (0.9.1)
91
- json (2.5.1)
92
- json-canonicalization (0.2.1)
93
- json-ld (3.1.9)
97
+ json (2.6.2)
98
+ json-canonicalization (0.3.2)
99
+ json-ld (3.2.5)
94
100
  htmlentities (~> 4.3)
95
- json-canonicalization (~> 0.2)
101
+ json-canonicalization (~> 0.3, >= 0.3.2)
96
102
  link_header (~> 0.0, >= 0.0.8)
97
- multi_json (~> 1.14)
98
- rack (~> 2.0)
99
- rdf (~> 3.1)
100
- json-ld-preloaded (3.1.6)
101
- json-ld (~> 3.1)
102
- rdf (~> 3.1)
103
+ multi_json (~> 1.15)
104
+ rack (>= 2.2, < 4)
105
+ rdf (~> 3.2, >= 3.2.10)
106
+ json-ld-preloaded (3.2.2)
107
+ json-ld (~> 3.2)
108
+ rdf (~> 3.2)
103
109
  jsonlint (0.3.0)
104
110
  oj (~> 3)
105
111
  optimist (~> 3)
106
- latex-decode (0.3.2)
112
+ latex-decode (0.4.0)
107
113
  link_header (0.0.8)
108
- loofah (2.12.0)
114
+ loofah (2.21.3)
109
115
  crass (~> 1.0.2)
110
- nokogiri (>= 1.5.9)
111
- maremma (4.9.5)
116
+ nokogiri (>= 1.12.0)
117
+ maremma (4.9.9)
112
118
  activesupport (>= 4.2.5)
113
119
  addressable (>= 2.3.6)
114
120
  builder (~> 3.2, >= 3.2.2)
115
121
  excon (~> 0.71.0)
116
- faraday (~> 0.17.3)
117
- faraday-encoding (~> 0.0.4)
118
- faraday_middleware (~> 0.14.0)
119
- nokogiri (~> 1.11.2)
122
+ faraday (>= 2.0)
123
+ faraday-encoding (~> 0.0.5)
124
+ faraday-excon (~> 2.1.0)
125
+ faraday-follow_redirects (~> 0.3.0)
126
+ faraday-gzip (~> 0.1.0)
127
+ faraday-multipart (~> 1.0.4)
128
+ nokogiri (>= 1.13.1, < 1.14.0)
120
129
  oj (>= 2.8.3)
121
130
  oj_mimic_json (~> 1.0, >= 1.0.1)
122
- mini_portile2 (2.5.3)
123
- minitest (5.14.4)
131
+ matrix (0.4.2)
132
+ mini_portile2 (2.8.0)
133
+ minitest (5.18.0)
124
134
  multi_json (1.15.0)
125
- multipart-post (2.1.1)
135
+ multipart-post (2.3.0)
126
136
  namae (1.1.1)
127
- nokogiri (1.11.7)
128
- mini_portile2 (~> 2.5.0)
137
+ nokogiri (1.13.9)
138
+ mini_portile2 (~> 2.8.0)
129
139
  racc (~> 1.4)
130
- oj (3.13.2)
140
+ oj (3.14.2)
131
141
  oj_mimic_json (1.0.1)
132
142
  optimist (3.0.1)
133
143
  postrank-uri (1.0.24)
@@ -135,74 +145,77 @@ GEM
135
145
  nokogiri (>= 1.8.0)
136
146
  public_suffix (>= 2.0.0, < 2.1)
137
147
  public_suffix (2.0.5)
138
- racc (1.5.2)
139
- rack (2.2.3)
148
+ racc (1.6.0)
149
+ rack (2.2.4)
140
150
  rack-test (0.8.3)
141
151
  rack (>= 1.0, < 3)
142
152
  rake (12.3.3)
143
- rdf (3.1.15)
144
- hamster (~> 3.0)
153
+ rdf (3.2.11)
145
154
  link_header (~> 0.0, >= 0.0.8)
146
- rdf-aggregate-repo (3.1.0)
147
- rdf (~> 3.1)
148
- rdf-rdfa (3.1.3)
149
- haml (~> 5.2)
155
+ rdf-aggregate-repo (3.2.1)
156
+ rdf (~> 3.2)
157
+ rdf-rdfa (3.2.2)
158
+ haml (>= 5.2, < 7)
150
159
  htmlentities (~> 4.3)
151
- rdf (~> 3.1, >= 3.1.13)
152
- rdf-aggregate-repo (~> 3.1)
153
- rdf-vocab (~> 3.1, >= 3.1.11)
154
- rdf-xsd (~> 3.1)
155
- rdf-rdfxml (3.1.1)
160
+ rdf (~> 3.2)
161
+ rdf-aggregate-repo (~> 3.2)
162
+ rdf-vocab (~> 3.2)
163
+ rdf-xsd (~> 3.2)
164
+ rdf-rdfxml (3.2.1)
165
+ haml (~> 5.2)
156
166
  htmlentities (~> 4.3)
157
- rdf (~> 3.1)
158
- rdf-rdfa (~> 3.1)
159
- rdf-xsd (~> 3.1)
160
- rdf-turtle (3.1.3)
161
- ebnf (~> 2.1)
162
- rdf (~> 3.1, >= 3.1.8)
163
- rdf-vocab (3.1.14)
164
- rdf (~> 3.1, >= 3.1.12)
165
- rdf-xsd (3.1.1)
166
- rdf (~> 3.1)
167
+ rdf (~> 3.2)
168
+ rdf-rdfa (~> 3.2)
169
+ rdf-xsd (~> 3.2)
170
+ rdf-turtle (3.2.1)
171
+ ebnf (~> 2.3)
172
+ rdf (~> 3.2)
173
+ rdf-vocab (3.2.6)
174
+ rdf (~> 3.2, >= 3.2.4)
175
+ rdf-xsd (3.2.1)
176
+ rdf (~> 3.2)
167
177
  rexml (~> 3.2)
168
178
  rexml (3.2.5)
169
- rspec (3.10.0)
170
- rspec-core (~> 3.10.0)
171
- rspec-expectations (~> 3.10.0)
172
- rspec-mocks (~> 3.10.0)
173
- rspec-core (3.10.1)
174
- rspec-support (~> 3.10.0)
175
- rspec-expectations (3.10.1)
179
+ rspec (3.11.0)
180
+ rspec-core (~> 3.11.0)
181
+ rspec-expectations (~> 3.11.0)
182
+ rspec-mocks (~> 3.11.0)
183
+ rspec-core (3.11.0)
184
+ rspec-support (~> 3.11.0)
185
+ rspec-expectations (3.11.1)
176
186
  diff-lcs (>= 1.2.0, < 2.0)
177
- rspec-support (~> 3.10.0)
178
- rspec-mocks (3.10.2)
187
+ rspec-support (~> 3.11.0)
188
+ rspec-mocks (3.11.1)
179
189
  diff-lcs (>= 1.2.0, < 2.0)
180
- rspec-support (~> 3.10.0)
181
- rspec-support (3.10.2)
190
+ rspec-support (~> 3.11.0)
191
+ rspec-support (3.11.1)
182
192
  rspec-xsd (0.1.0)
183
193
  nokogiri (~> 1.6)
184
194
  rspec (~> 3)
195
+ ruby2_keywords (0.0.5)
185
196
  scanf (1.0.0)
186
197
  simplecov (0.17.1)
187
198
  docile (~> 1.1)
188
199
  json (>= 1.8, < 3)
189
200
  simplecov-html (~> 0.10.0)
190
201
  simplecov-html (0.10.2)
191
- sxp (1.1.0)
192
- rdf (~> 3.1)
193
- temple (0.8.2)
194
- thor (1.1.0)
195
- tilt (2.0.10)
196
- tzinfo (2.0.4)
202
+ sxp (1.2.4)
203
+ matrix (~> 0.4)
204
+ rdf (~> 3.2)
205
+ temple (0.10.2)
206
+ thor (1.2.2)
207
+ tilt (2.2.0)
208
+ tzinfo (2.0.6)
197
209
  concurrent-ruby (~> 1.0)
198
- unicode-types (1.6.0)
210
+ unicode-types (1.8.0)
199
211
  unicode_utils (1.4.0)
200
212
  vcr (3.0.3)
201
- webmock (3.13.0)
202
- addressable (>= 2.3.6)
213
+ webmock (3.18.1)
214
+ addressable (>= 2.8.0)
203
215
  crack (>= 0.3.2)
204
216
  hashdiff (>= 0.4.0, < 2.0.0)
205
- zeitwerk (2.4.2)
217
+ zeitwerk (2.6.8)
218
+ zlib (2.1.1)
206
219
 
207
220
  PLATFORMS
208
221
  ruby
@@ -210,6 +223,7 @@ PLATFORMS
210
223
  DEPENDENCIES
211
224
  bolognese!
212
225
  bundler (>= 1.0)
226
+ byebug
213
227
  hashdiff (>= 1.0.0.beta1, < 2.0.0)
214
228
  rack-test (~> 0)
215
229
  rake (~> 12.0)
@@ -220,4 +234,4 @@ DEPENDENCIES
220
234
  webmock (~> 3.0, >= 3.0.1)
221
235
 
222
236
  BUNDLED WITH
223
- 2.2.26
237
+ 2.4.20
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 = '~> 2.3'
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
- s.add_dependency 'faraday', '~> 0.17.3'
21
- s.add_dependency 'nokogiri', '~> 1.11.2'
20
+ #s.add_dependency 'faraday', '~> 0.17.3'
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'
@@ -49,6 +49,7 @@ Gem::Specification.new do |s|
49
49
  s.add_development_dependency 'webmock', '~> 3.0', '>= 3.0.1'
50
50
  s.add_development_dependency 'simplecov', '0.17.1'
51
51
  s.add_development_dependency 'hashdiff', ['>= 1.0.0.beta1', '< 2.0.0']
52
+ s.add_development_dependency 'byebug'
52
53
 
53
54
  s.require_paths = ["lib"]
54
55
  s.files = `git ls-files`.split($/)
@@ -30,20 +30,21 @@ module Bolognese
30
30
  name_type = parse_attributes(author.fetch("creatorName", nil), content: "nameType", first: true) || parse_attributes(author.fetch("contributorName", nil), content: "nameType", first: true)
31
31
 
32
32
  name_identifiers = Array.wrap(author.fetch("nameIdentifier", nil)).map do |ni|
33
+ ni["__content__"] = ni["__content__"].strip
33
34
  if ni["nameIdentifierScheme"] == "ORCID"
34
35
  {
35
36
  "nameIdentifier" => normalize_orcid(ni["__content__"]),
36
37
  "schemeUri" => "https://orcid.org",
37
38
  "nameIdentifierScheme" => "ORCID" }.compact
38
- elsif ni["schemeURI"].present?
39
+ elsif ni["nameIdentifierScheme"] == "ROR"
39
40
  {
40
- "nameIdentifier" => ni["schemeURI"].to_s + ni["__content__"].to_s,
41
- "schemeUri" => ni["schemeURI"].to_s,
42
- "nameIdentifierScheme" => ni["nameIdentifierScheme"] }.compact
41
+ "nameIdentifier" => normalize_ror(ni["__content__"]),
42
+ "schemeUri" => "https://ror.org",
43
+ "nameIdentifierScheme" => "ROR" }.compact
43
44
  else
44
45
  {
45
46
  "nameIdentifier" => ni["__content__"],
46
- "schemeUri" => nil,
47
+ "schemeUri" => ni.fetch("schemeURI", nil),
47
48
  "nameIdentifierScheme" => ni["nameIdentifierScheme"] }.compact
48
49
  end
49
50
  end.presence
@@ -144,16 +145,28 @@ module Bolognese
144
145
  affiliation_identifier_scheme = nil
145
146
  scheme_uri = nil
146
147
  else
148
+ scheme_uri = a["schemeURI"]
147
149
  if a["affiliationIdentifier"].present?
148
150
  affiliation_identifier = a["affiliationIdentifier"]
149
151
  if a["schemeURI"].present?
150
152
  schemeURI = a["schemeURI"].end_with?("/") ? a["schemeURI"] : a["schemeURI"] + "/"
151
153
  end
152
154
  affiliation_identifier = !affiliation_identifier.to_s.start_with?("https://") && schemeURI.present? ? normalize_id(schemeURI + affiliation_identifier) : normalize_id(affiliation_identifier)
155
+ # The normalize_id(affiliation_identifier) method currently discards affiliation identifiers that don't start with a URL,
156
+ # for example: affiliation_identifier = "05bp8ka05".
157
+ # To address this issue, we are introducing the following change to handle such affiliation identifiers.
158
+ # when `normalize_id` method could not normalize, it returns nil, hence we have following condition
159
+ if affiliation_identifier.nil?
160
+ if a["affiliationIdentifierScheme"] == "ROR"
161
+ scheme_uri = "https://ror.org"
162
+ affiliation_identifier = normalize_ror(a["affiliationIdentifier"])
163
+ else
164
+ affiliation_identifier = a["affiliationIdentifier"]
165
+ end
166
+ end
153
167
  end
154
168
  name = a["__content__"].to_s.squish.presence
155
169
  affiliation_identifier_scheme = a["affiliationIdentifierScheme"]
156
- scheme_uri = a["SchemeURI"]
157
170
  end
158
171
 
159
172
  { "name" => name,