bolognese 1.6.9 → 1.6.10
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/Gemfile.lock +1 -1
- data/lib/bolognese/utils.rb +7 -7
- data/lib/bolognese/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7587e889005dfc54745f8159ad04ee1d301dbace34b81ce46df75d3244988446
|
|
4
|
+
data.tar.gz: 49a9ecf9265f23855bbe348343e50a8ff38e87929287ec2d7af52c34d9775cdb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68575504503ab0c3ec6e38164da0c43c1a52d29a76ba048f8320cf1b0b33261c43cac64e18f49195baac0798c4baee1ea7393dbd59f05744413b42ef78e7bc39
|
|
7
|
+
data.tar.gz: ea1bc0f124b11d17bc1b941a94aef32befe128b8c8ce6ef8c1d96b5985ce1732612ec6179ef6df05808d9110fdcd5f47e4b89f91f5b314ed8a9672a908fcaf01
|
data/Gemfile.lock
CHANGED
data/lib/bolognese/utils.rb
CHANGED
|
@@ -1177,11 +1177,11 @@ module Bolognese
|
|
|
1177
1177
|
def hsh_to_fos(hsh)
|
|
1178
1178
|
# first find subject in Fields of Science (OECD)
|
|
1179
1179
|
fos = JSON.load(File.read(File.expand_path('../../../resources/oecd/fos-mappings.json', __FILE__))).fetch("fosFields")
|
|
1180
|
-
subject = fos.find { |l| l["fosLabel"] == hsh["__content__"] || "FOS: " + l["fosLabel"] == hsh["__content__"] }
|
|
1180
|
+
subject = fos.find { |l| l["fosLabel"] == hsh["__content__"] || "FOS: " + l["fosLabel"] == hsh["__content__"] || l["fosLabel"] == hsh["subject"]}
|
|
1181
1181
|
|
|
1182
1182
|
if subject
|
|
1183
1183
|
return [{
|
|
1184
|
-
"subject" => sanitize(hsh["__content__"]),
|
|
1184
|
+
"subject" => sanitize(hsh["__content__"] || hsh["subject"]),
|
|
1185
1185
|
"subjectScheme" => hsh["subjectScheme"],
|
|
1186
1186
|
"schemeUri" => hsh["schemeURI"],
|
|
1187
1187
|
"valueUri" => hsh["valueURI"],
|
|
@@ -1200,19 +1200,19 @@ module Bolognese
|
|
|
1200
1200
|
|
|
1201
1201
|
# try to extract forId
|
|
1202
1202
|
if hsh["subjectScheme"] == "FOR"
|
|
1203
|
-
for_id = hsh["__content__"].split(" ").first
|
|
1203
|
+
for_id = hsh["__content__"].split(" ").first || hsh["subject"].split(" ").first
|
|
1204
1204
|
for_id = for_id.rjust(6, "0")
|
|
1205
1205
|
|
|
1206
1206
|
subject = for_fields.find { |l| l["forId"] == for_id } ||
|
|
1207
1207
|
for_disciplines.find { |l| l["forId"] == for_id[0..3] }
|
|
1208
1208
|
else
|
|
1209
|
-
subject = for_fields.find { |l| l["forLabel"] == hsh["__content__"] } ||
|
|
1210
|
-
for_disciplines.find { |l| l["forLabel"] == hsh["__content__"] }
|
|
1209
|
+
subject = for_fields.find { |l| l["forLabel"] == hsh["__content__"] || l["forLabel"] == hsh["subject"] } ||
|
|
1210
|
+
for_disciplines.find { |l| l["forLabel"] == hsh["__content__"] || l["forLabel"] == hsh["subject"] }
|
|
1211
1211
|
end
|
|
1212
1212
|
|
|
1213
1213
|
if subject
|
|
1214
1214
|
[{
|
|
1215
|
-
"subject" => sanitize(hsh["__content__"]),
|
|
1215
|
+
"subject" => sanitize(hsh["__content__"] || hsh["subject"]),
|
|
1216
1216
|
"subjectScheme" => hsh["subjectScheme"],
|
|
1217
1217
|
"schemeUri" => hsh["schemeURI"],
|
|
1218
1218
|
"valueUri" => hsh["valueURI"],
|
|
@@ -1224,7 +1224,7 @@ module Bolognese
|
|
|
1224
1224
|
}]
|
|
1225
1225
|
else
|
|
1226
1226
|
[{
|
|
1227
|
-
"subject" => sanitize(hsh["__content__"]),
|
|
1227
|
+
"subject" => sanitize(hsh["__content__"] || hsh["subject"]),
|
|
1228
1228
|
"subjectScheme" => hsh["subjectScheme"],
|
|
1229
1229
|
"schemeUri" => hsh["schemeURI"],
|
|
1230
1230
|
"valueUri" => hsh["valueURI"],
|
data/lib/bolognese/version.rb
CHANGED