bolognese 1.9.18 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +4 -18
- data/.github/workflows/ci.yml +22 -0
- data/.github/workflows/pull-request.yml +2 -14
- data/.github/workflows/release.yml +8 -13
- data/CHANGELOG.md +21 -12
- data/Gemfile.lock +2 -2
- data/bolognese.gemspec +1 -1
- data/lib/bolognese/doi_utils.rb +4 -0
- data/lib/bolognese/utils.rb +50 -9
- data/lib/bolognese/version.rb +1 -1
- data/spec/utils_spec.rb +53 -4
- metadata +4 -3
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
|
@@ -5,17 +5,5 @@ on:
|
|
5
5
|
branches:
|
6
6
|
- master
|
7
7
|
jobs:
|
8
|
-
|
9
|
-
|
10
|
-
steps:
|
11
|
-
- uses: actions/checkout@v2
|
12
|
-
- name: Set up Ruby 2.6
|
13
|
-
uses: actions/setup-ruby@v1
|
14
|
-
with:
|
15
|
-
ruby-version: 2.6.x
|
16
|
-
|
17
|
-
- name: Install and test
|
18
|
-
run: |
|
19
|
-
gem install bundler
|
20
|
-
bundle install
|
21
|
-
bundle exec rspec
|
8
|
+
ci:
|
9
|
+
uses: ./.github/workflows/ci.yml
|
@@ -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/CHANGELOG.md
CHANGED
@@ -1,20 +1,25 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## [
|
3
|
+
## [1.10.0](https://github.com/datacite/bolognese/tree/1.10.0) (2022-10-14)
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.18...
|
5
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.18...1.10.0)
|
6
6
|
|
7
|
-
**
|
7
|
+
**Merged pull requests:**
|
8
8
|
|
9
|
-
-
|
10
|
-
- Related Items error out if RelatedItemIdentifier is nil [\#139](https://github.com/datacite/bolognese/issues/139)
|
9
|
+
- Add DFG-to-FOS mappings utility function [\#147](https://github.com/datacite/bolognese/pull/147) ([jrhoads](https://github.com/jrhoads))
|
11
10
|
|
12
11
|
## [1.9.18](https://github.com/datacite/bolognese/tree/1.9.18) (2022-10-11)
|
13
12
|
|
14
13
|
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.17...1.9.18)
|
15
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
|
+
|
16
20
|
**Merged pull requests:**
|
17
21
|
|
22
|
+
- bump version number [\#145](https://github.com/datacite/bolognese/pull/145) ([digitaldogsbody](https://github.com/digitaldogsbody))
|
18
23
|
- Fix relatedItems handling [\#144](https://github.com/datacite/bolognese/pull/144) ([digitaldogsbody](https://github.com/digitaldogsbody))
|
19
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))
|
20
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))
|
@@ -59,7 +64,6 @@
|
|
59
64
|
**Merged pull requests:**
|
60
65
|
|
61
66
|
- update nokogiri to latest, including updating maremma [\#130](https://github.com/datacite/bolognese/pull/130) ([orangewolf](https://github.com/orangewolf))
|
62
|
-
- mapping for DFG-to-OECD [\#125](https://github.com/datacite/bolognese/pull/125) ([kjgarza](https://github.com/kjgarza))
|
63
67
|
|
64
68
|
## [1.9.12](https://github.com/datacite/bolognese/tree/1.9.12) (2021-08-19)
|
65
69
|
|
@@ -75,6 +79,7 @@
|
|
75
79
|
|
76
80
|
**Merged pull requests:**
|
77
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))
|
78
83
|
- Allow Orcid URLs to have been issued from the sandbox [\#121](https://github.com/datacite/bolognese/pull/121) ([prdanelli](https://github.com/prdanelli))
|
79
84
|
|
80
85
|
## [1.9.10](https://github.com/datacite/bolognese/tree/1.9.10) (2021-07-20)
|
@@ -110,6 +115,7 @@
|
|
110
115
|
|
111
116
|
**Merged pull requests:**
|
112
117
|
|
118
|
+
- mapping for DFG-to-OECD [\#125](https://github.com/datacite/bolognese/pull/125) ([kjgarza](https://github.com/kjgarza))
|
113
119
|
- Fix missing affiliation identifier [\#117](https://github.com/datacite/bolognese/pull/117) ([richardhallett](https://github.com/richardhallett))
|
114
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))
|
115
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))
|
@@ -130,6 +136,10 @@
|
|
130
136
|
|
131
137
|
- Singular geoLocationPolygons are wrapped in additional array [\#110](https://github.com/datacite/bolognese/issues/110)
|
132
138
|
|
139
|
+
**Merged pull requests:**
|
140
|
+
|
141
|
+
- Support returning single geoLocationPolygon [\#111](https://github.com/datacite/bolognese/pull/111) ([richardhallett](https://github.com/richardhallett))
|
142
|
+
|
133
143
|
## [1.9.3](https://github.com/datacite/bolognese/tree/1.9.3) (2021-03-26)
|
134
144
|
|
135
145
|
[Full Changelog](https://github.com/datacite/bolognese/compare/1.9.2...1.9.3)
|
@@ -159,7 +169,6 @@
|
|
159
169
|
|
160
170
|
**Merged pull requests:**
|
161
171
|
|
162
|
-
- Support returning single geoLocationPolygon [\#111](https://github.com/datacite/bolognese/pull/111) ([richardhallett](https://github.com/richardhallett))
|
163
172
|
- Change detection for crosscite format [\#107](https://github.com/datacite/bolognese/pull/107) ([richardhallett](https://github.com/richardhallett))
|
164
173
|
- Add support for multiple geolocation polygons [\#106](https://github.com/datacite/bolognese/pull/106) ([richardhallett](https://github.com/richardhallett))
|
165
174
|
- Support schema 4 4 [\#105](https://github.com/datacite/bolognese/pull/105) ([richardhallett](https://github.com/richardhallett))
|
@@ -1380,15 +1389,15 @@
|
|
1380
1389
|
|
1381
1390
|
## [v.0.9.70](https://github.com/datacite/bolognese/tree/v.0.9.70) (2018-01-12)
|
1382
1391
|
|
1383
|
-
[Full Changelog](https://github.com/datacite/bolognese/compare/v.0.
|
1392
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/v.0.9.69...v.0.9.70)
|
1384
1393
|
|
1385
|
-
## [v.0.
|
1394
|
+
## [v.0.9.69](https://github.com/datacite/bolognese/tree/v.0.9.69) (2018-01-11)
|
1386
1395
|
|
1387
|
-
[Full Changelog](https://github.com/datacite/bolognese/compare/v.0.
|
1396
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/v.0.6.69...v.0.9.69)
|
1388
1397
|
|
1389
|
-
## [v.0.
|
1398
|
+
## [v.0.6.69](https://github.com/datacite/bolognese/tree/v.0.6.69) (2018-01-11)
|
1390
1399
|
|
1391
|
-
[Full Changelog](https://github.com/datacite/bolognese/compare/v.0.9.68...v.0.
|
1400
|
+
[Full Changelog](https://github.com/datacite/bolognese/compare/v.0.9.68...v.0.6.69)
|
1392
1401
|
|
1393
1402
|
## [v.0.9.68](https://github.com/datacite/bolognese/tree/v.0.9.68) (2018-01-11)
|
1394
1403
|
|
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)
|
@@ -219,4 +219,4 @@ DEPENDENCIES
|
|
219
219
|
webmock (~> 3.0, >= 3.0.1)
|
220
220
|
|
221
221
|
BUNDLED WITH
|
222
|
-
2.3.
|
222
|
+
2.3.12
|
data/bolognese.gemspec
CHANGED
@@ -13,7 +13,7 @@ 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'
|
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
|
data/lib/bolognese/utils.rb
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
module Bolognese
|
4
4
|
module Utils
|
5
|
+
class << self
|
6
|
+
include Utils
|
7
|
+
end
|
8
|
+
|
5
9
|
NORMALIZED_LICENSES = {
|
6
10
|
"https://creativecommons.org/licenses/by/1.0" => "https://creativecommons.org/licenses/by/1.0/legalcode",
|
7
11
|
"https://creativecommons.org/licenses/by/2.0" => "https://creativecommons.org/licenses/by/2.0/legalcode",
|
@@ -484,6 +488,28 @@ module Bolognese
|
|
484
488
|
":etal" => "too numerous to list (et alia)"
|
485
489
|
}
|
486
490
|
|
491
|
+
RESOURCE_PATHS = {
|
492
|
+
spdx: 'spdx/licenses.json',
|
493
|
+
fos: 'oecd/fos-mappings.json',
|
494
|
+
for: 'oecd/for-mappings.json',
|
495
|
+
dfg: 'oecd/dfg-mappings.json'
|
496
|
+
}
|
497
|
+
|
498
|
+
def resources_dir_path
|
499
|
+
File.expand_path('../../../resources', __FILE__) + '/'
|
500
|
+
end
|
501
|
+
|
502
|
+
def resource_file( extra_path )
|
503
|
+
File.read(resources_dir_path + extra_path)
|
504
|
+
end
|
505
|
+
|
506
|
+
def resource_json( resource_symbol )
|
507
|
+
if RESOURCE_PATHS.keys().include?(resource_symbol)
|
508
|
+
JSON.load(resource_file(RESOURCE_PATHS[resource_symbol]))
|
509
|
+
end
|
510
|
+
end
|
511
|
+
|
512
|
+
|
487
513
|
def find_from_format(id: nil, string: nil, ext: nil, filename: nil)
|
488
514
|
if id.present?
|
489
515
|
find_from_format_by_id(id)
|
@@ -615,7 +641,7 @@ module Bolognese
|
|
615
641
|
return nil unless id.present?
|
616
642
|
|
617
643
|
# check for valid DOI
|
618
|
-
doi = normalize_doi(id, options)
|
644
|
+
doi = DoiUtils::normalize_doi(id, options)
|
619
645
|
return doi if doi.present?
|
620
646
|
|
621
647
|
# check for valid HTTP uri
|
@@ -674,8 +700,8 @@ module Bolognese
|
|
674
700
|
def normalize_ids(ids: nil, relation_type: nil)
|
675
701
|
Array.wrap(ids).select { |idx| idx["@id"].present? }.map do |idx|
|
676
702
|
id = normalize_id(idx["@id"])
|
677
|
-
related_identifier_type = doi_from_url(id).present? ? "DOI" : "URL"
|
678
|
-
id = doi_from_url(id) || id
|
703
|
+
related_identifier_type = DoiUtils::doi_from_url(id).present? ? "DOI" : "URL"
|
704
|
+
id = DoiUtils::doi_from_url(id) || id
|
679
705
|
|
680
706
|
{ "relatedIdentifier" => id,
|
681
707
|
"relationType" => relation_type,
|
@@ -1233,7 +1259,7 @@ module Bolognese
|
|
1233
1259
|
end
|
1234
1260
|
|
1235
1261
|
def name_to_spdx(name)
|
1236
|
-
spdx =
|
1262
|
+
spdx = resource_json(:spdx).fetch("licenses")
|
1237
1263
|
license = spdx.find { |l| l["name"] == name || l["licenseId"] == name || l["seeAlso"].first == normalize_cc_url(name) }
|
1238
1264
|
|
1239
1265
|
if license
|
@@ -1249,7 +1275,7 @@ module Bolognese
|
|
1249
1275
|
end
|
1250
1276
|
|
1251
1277
|
def hsh_to_spdx(hsh)
|
1252
|
-
spdx =
|
1278
|
+
spdx = resource_json(:spdx).fetch("licenses")
|
1253
1279
|
license = spdx.find { |l| l["licenseId"].casecmp?(hsh["rightsIdentifier"]) || l["seeAlso"].first == normalize_cc_url(hsh["rightsURI"]) || l["name"] == hsh["rights"] || l["seeAlso"].first == normalize_cc_url(hsh["rights"]) }
|
1254
1280
|
|
1255
1281
|
if license
|
@@ -1273,7 +1299,7 @@ module Bolognese
|
|
1273
1299
|
|
1274
1300
|
def name_to_fos(name)
|
1275
1301
|
# first find subject in Fields of Science (OECD)
|
1276
|
-
fos =
|
1302
|
+
fos = resource_json(:fos).fetch("fosFields")
|
1277
1303
|
|
1278
1304
|
subject = fos.find { |l| l["fosLabel"] == name || "FOS: " + l["fosLabel"] == name }
|
1279
1305
|
|
@@ -1289,7 +1315,7 @@ module Bolognese
|
|
1289
1315
|
|
1290
1316
|
# if not found, look in Fields of Research (Australian and New Zealand Standard Research Classification)
|
1291
1317
|
# and map to Fields of Science. Add an extra entry for the latter
|
1292
|
-
fores =
|
1318
|
+
fores = resource_json(:for)
|
1293
1319
|
for_fields = fores.fetch("forFields")
|
1294
1320
|
for_disciplines = fores.fetch("forDisciplines")
|
1295
1321
|
|
@@ -1311,7 +1337,7 @@ module Bolognese
|
|
1311
1337
|
|
1312
1338
|
def hsh_to_fos(hsh)
|
1313
1339
|
# first find subject in Fields of Science (OECD)
|
1314
|
-
fos =
|
1340
|
+
fos = resource_json(:fos).fetch("fosFields")
|
1315
1341
|
subject = fos.find { |l| l["fosLabel"] == hsh["__content__"] || "FOS: " + l["fosLabel"] == hsh["__content__"] || l["fosLabel"] == hsh["subject"]}
|
1316
1342
|
|
1317
1343
|
if subject
|
@@ -1330,7 +1356,7 @@ module Bolognese
|
|
1330
1356
|
|
1331
1357
|
# if not found, look in Fields of Research (Australian and New Zealand Standard Research Classification)
|
1332
1358
|
# and map to Fields of Science. Add an extra entry for the latter
|
1333
|
-
fores =
|
1359
|
+
fores = resource_json(:for)
|
1334
1360
|
for_fields = fores.fetch("forFields")
|
1335
1361
|
for_disciplines = fores.fetch("forDisciplines")
|
1336
1362
|
|
@@ -1369,5 +1395,20 @@ module Bolognese
|
|
1369
1395
|
"lang" => hsh["lang"] }.compact]
|
1370
1396
|
end
|
1371
1397
|
end
|
1398
|
+
|
1399
|
+
def dfg_ids_to_fos(dfg_ids)
|
1400
|
+
dfgs = resource_json(:dfg).fetch("dfgFields")
|
1401
|
+
ids = Array.wrap(dfg_ids)
|
1402
|
+
|
1403
|
+
subjects = dfgs.select { |l| ids.include?(l["dfgId"])}
|
1404
|
+
subjects.map do |subject|
|
1405
|
+
{
|
1406
|
+
"classificationCode" => subject["fosId"],
|
1407
|
+
"subject" => subject["fosLabel"],
|
1408
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)",
|
1409
|
+
"schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf"
|
1410
|
+
}
|
1411
|
+
end
|
1412
|
+
end
|
1372
1413
|
end
|
1373
1414
|
end
|
data/lib/bolognese/version.rb
CHANGED
data/spec/utils_spec.rb
CHANGED
@@ -2,10 +2,8 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe Bolognese::
|
6
|
-
|
7
|
-
|
8
|
-
subject { Bolognese::Metadata.new(input: input, from: "crossref") }
|
5
|
+
describe Bolognese::Utils do
|
6
|
+
subject { Bolognese::Utils }
|
9
7
|
|
10
8
|
context "validate url" do
|
11
9
|
it "DOI" do
|
@@ -614,4 +612,55 @@ describe Bolognese::Metadata, vcr: true do
|
|
614
612
|
end
|
615
613
|
|
616
614
|
end
|
615
|
+
|
616
|
+
context "DFG mappings" do
|
617
|
+
it "dfg_id_to_fos match" do
|
618
|
+
dfg_id = "20108"
|
619
|
+
response = subject.dfg_ids_to_fos(dfg_id)
|
620
|
+
expect(response).to eq([
|
621
|
+
{
|
622
|
+
"classificationCode" =>"1.6",
|
623
|
+
"subject" => "Biological sciences",
|
624
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)",
|
625
|
+
"schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf"
|
626
|
+
},
|
627
|
+
{
|
628
|
+
"classificationCode" =>"3.1",
|
629
|
+
"subject" => "Basic medicine",
|
630
|
+
"subjectScheme" => "Fields of Science and Technology (FOS)",
|
631
|
+
"schemeUri" => "http://www.oecd.org/science/inno/38235147.pdf"
|
632
|
+
},
|
633
|
+
])
|
634
|
+
end
|
635
|
+
it "dfg_id_to_fos no match" do
|
636
|
+
dfg_id = "000"
|
637
|
+
response = subject.dfg_ids_to_fos(dfg_id)
|
638
|
+
expect(response).to eq([])
|
639
|
+
end
|
640
|
+
|
641
|
+
it "dfg_id_to_fos match list" do
|
642
|
+
dfg_ids = ["101", "20108"]
|
643
|
+
response = subject.dfg_ids_to_fos(dfg_ids)
|
644
|
+
expect(response).to eq([
|
645
|
+
{"classificationCode"=>"6.1",
|
646
|
+
"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
647
|
+
"subject"=>"History and archaeology",
|
648
|
+
"subjectScheme"=>"Fields of Science and Technology (FOS)"},
|
649
|
+
{"classificationCode"=>"6.2",
|
650
|
+
"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
651
|
+
"subject"=>"Languages and literature",
|
652
|
+
"subjectScheme"=>"Fields of Science and Technology (FOS)"},
|
653
|
+
{"classificationCode"=>"1.6",
|
654
|
+
"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
655
|
+
"subject"=>"Biological sciences",
|
656
|
+
"subjectScheme"=>"Fields of Science and Technology (FOS)"},
|
657
|
+
{"classificationCode"=>"3.1",
|
658
|
+
"schemeUri"=>"http://www.oecd.org/science/inno/38235147.pdf",
|
659
|
+
"subject"=>"Basic medicine",
|
660
|
+
"subjectScheme"=>"Fields of Science and Technology (FOS)"}
|
661
|
+
])
|
662
|
+
end
|
663
|
+
|
664
|
+
|
665
|
+
end
|
617
666
|
end
|
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.
|
4
|
+
version: 1.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|
@@ -567,6 +567,7 @@ extra_rdoc_files:
|
|
567
567
|
files:
|
568
568
|
- ".github/workflows/build.yml"
|
569
569
|
- ".github/workflows/changelog.yml"
|
570
|
+
- ".github/workflows/ci.yml"
|
570
571
|
- ".github/workflows/pull-request.yml"
|
571
572
|
- ".github/workflows/release.yml"
|
572
573
|
- ".gitignore"
|
@@ -1288,7 +1289,7 @@ require_paths:
|
|
1288
1289
|
- lib
|
1289
1290
|
required_ruby_version: !ruby/object:Gem::Requirement
|
1290
1291
|
requirements:
|
1291
|
-
- - "
|
1292
|
+
- - ">="
|
1292
1293
|
- !ruby/object:Gem::Version
|
1293
1294
|
version: '2.3'
|
1294
1295
|
required_rubygems_version: !ruby/object:Gem::Requirement
|