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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25ab3b7ce79c4ab19b986230a63bd1bb5e583f257fa2281432d10e08cdec529f
4
- data.tar.gz: db1f7a4704f00cefe310edba0eca9dd69181f87861d8b9693b05056347cce759
3
+ metadata.gz: 7587e889005dfc54745f8159ad04ee1d301dbace34b81ce46df75d3244988446
4
+ data.tar.gz: 49a9ecf9265f23855bbe348343e50a8ff38e87929287ec2d7af52c34d9775cdb
5
5
  SHA512:
6
- metadata.gz: b795e4deddb046f5cd6acfdb1b75f8455428facc31aed10a2cb4215dbda6d7ad22344df8a470ebe18c7672f30a76476570aca151f2006dd2c3166f9984468bd5
7
- data.tar.gz: a3b5aa9640cf3fdd4b3cd2c6d7eac32be36adf242acd585277a01ce2355a8c61243aae170622b113aeb0ca16c92da7cf7c80f38b2bc76acbf9bdf7e066525389
6
+ metadata.gz: 68575504503ab0c3ec6e38164da0c43c1a52d29a76ba048f8320cf1b0b33261c43cac64e18f49195baac0798c4baee1ea7393dbd59f05744413b42ef78e7bc39
7
+ data.tar.gz: ea1bc0f124b11d17bc1b941a94aef32befe128b8c8ce6ef8c1d96b5985ce1732612ec6179ef6df05808d9110fdcd5f47e4b89f91f5b314ed8a9672a908fcaf01
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (1.6.9)
4
+ bolognese (1.6.10)
5
5
  activesupport (>= 4.2.5)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (>= 5.1.0)
@@ -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"],
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "1.6.9"
2
+ VERSION = "1.6.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.9
4
+ version: 1.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner