uc3-dmp-id 0.1.34 → 0.1.35

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8ed82601dab8f040bdef2ca093b8a2c90f81160c5a990533947ff3750a5d97c
4
- data.tar.gz: 563c25f02e5c85a41960bad34687bdb4376228cce26e00a8c92024ab4f289055
3
+ metadata.gz: 5828afe1afaf7214cdea0e02ed8b834587068be56f1f1a060050c7768c4d19a8
4
+ data.tar.gz: 10c0bb60320d71414959a9623e435d71ab52b74b758a38fc23cb7fad68f5bd3e
5
5
  SHA512:
6
- metadata.gz: fdd55f05e2c95cf243e8398070e9d690e4ecf7d2d35ba639f937956298e2dcb6c28e9d5600af8a846b7bc8bc0c507b1456f55a56f82f80c456a885311e64e84b
7
- data.tar.gz: 0ae5115a0d8856b72f10f86afe311e835e6bf52a950eaf5dd87a3b4af5acae3ad72958c3198485f53ff56184df2034f6c9347d69f745ad71b4d7e9d35e670fd1
6
+ metadata.gz: f4195fb80461a995b42d10e41ff6828aa79692d3cf92c7ce942f71f830c74d2544806a4c0ada2924d0aa7bf8c310c8b8f03a63eeacbd8754d4262aeb343f7dba
7
+ data.tar.gz: a1108d2311d8c8331b2b176278ae10d9283bdcbb0f4568c0b7d488e22268293b0356c36a51937857f709c64be89edcf2c8a8f98d74d98a66eda3c08f9ef0dea2
@@ -56,9 +56,7 @@ module Uc3DmpId
56
56
  scoring = []
57
57
  return scoring unless hash.is_a?(Hash) && !hash['title'].nil?
58
58
 
59
- @dmps.each do |entry|
60
- dmp = entry.fetch('_source', {})
61
-
59
+ @dmps.each do |dmp|
62
60
  # Compare the grant ids. If we have a match return the response immediately since that is
63
61
  # a very positive match!
64
62
  response = { confidence: 'None', score: 0, notes: [] }
@@ -79,7 +77,7 @@ module Uc3DmpId
79
77
  next if response[:score] <= 2
80
78
 
81
79
  # Set the confidence level based on the score
82
- response[:dmp_id] = entry['_id']
80
+ response[:dmp_id] = "DMP##{dmp['dmp_id']}"
83
81
  response[:confidence] = if response[:score] > 10
84
82
  'High'
85
83
  else
@@ -246,6 +246,7 @@ module Uc3DmpId
246
246
 
247
247
  # Change the name of the `logic` array to `notes`
248
248
  rec['notes'] = rec['logic']
249
+ rec['score'] = rec['score'].to_s
249
250
  # For `work-type` that equal `outputmanagementplan`, change it to `output_management_plan`
250
251
  rec['work_type'] = 'output_management_plan' if rec['work_type'] == 'outputmanagementplan'
251
252
 
@@ -204,6 +204,7 @@ module Uc3DmpId
204
204
  mods['related_works'][related.identifier]['status'] = related['status']
205
205
  end
206
206
  end
207
+
207
208
  client.put_item(json: mods, logger:)
208
209
  json.delete('dmphub_modifications')
209
210
  json
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.1.34'
4
+ VERSION = '0.1.35'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-24 00:00:00.000000000 Z
11
+ date: 2024-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json