uc3-dmp-id 0.1.11 → 0.1.12

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: 61f1c9dd64fdec4ec98c5e8a703bba452ba7b17ede2e477d86523fab1c99a94d
4
- data.tar.gz: 74fefb026abdfed228bad9b4a5c37847bb46c083e125727e0a6ed37f886d4ae2
3
+ metadata.gz: d3f3549ad23c4656916e7e6daf8f9152eb755d46279b7a3b689a26dd7d02d26b
4
+ data.tar.gz: 41a955d7b0e97e1094be9fd9d80b8f7ca45d17b901464aaae6816d09b757aa5a
5
5
  SHA512:
6
- metadata.gz: 644e193728347314563daeb6874c86128f434e29b3f9ceb160b256c4e98a3fa26f37da90f5815afde631e15e6f2898ec268aca4e28f5b15ee0efa969cd32bc34
7
- data.tar.gz: eb046b292e018c428a4d0a332f92f9e96e7a8bc4158b163c0ec657771646bfe3368e325c3442802612fb2df19f66193ad92779cec57d5211c7a6d0ccee2457e3
6
+ metadata.gz: 2dd968c76f1e6fc0af048385872b93d7b3764b0f11bbfd7925c23233235b61b83a6678daec0544dcf6f0625797733b2de04e98691aff56359228caca849b1269
7
+ data.tar.gz: be3757e058012feaa9d9f0e11c0b0a75730031ad80f76793bb6f916247bff4c60f001bec49db41466e9aacc8a3b8dbbfcde303b73e5849855b119413fe202bc4
@@ -11,7 +11,7 @@ module Uc3DmpId
11
11
  # Class that adds items to the :dmphub_modifications array or directly to the
12
12
  # :dmpraodmap_related_identifiers array if the confidence level was 'Absolute'
13
13
  class Augmenter
14
- attr_accessor :augmenter, :dmp, :known_mods, :known_works, :known_awards, :logger
14
+ attr_accessor :augmenter, :run_id, :dmp, :known_mods, :known_works, :known_awards, :logger
15
15
 
16
16
  MSG_MISSING_ANNOTATIONS = 'DMP must have its DMPHub specific annotations!'
17
17
  MSG_MISSING_AUGMENTER = 'No Augmenter specified!'
@@ -21,6 +21,7 @@ module Uc3DmpId
21
21
  def initialize(**args)
22
22
  @logger = args[:logger]
23
23
  @augmenter = args[:augmenter]
24
+ @run_id = args.fetch(:run_id, 'None')
24
25
  raise AugmenterError, MSG_MISSING_AUGMENTER unless @augmenter.is_a?(Hash) && !@augmenter['PK'].nil?
25
26
 
26
27
  @dmp = args.fetch(:dmp, {})['dmp'].nil? ? args[:dmp] : args.fetch(:dmp, {})['dmp']
@@ -54,7 +55,6 @@ module Uc3DmpId
54
55
 
55
56
  # Save the DMP
56
57
  @dmp['dmphub_modifications'] = (@known_mods.nil? ? [] : @known_mods) << mod_hash
57
-
58
58
  client = Uc3DmpDynamo::Client.new
59
59
  resp = client.put_item(json: @dmp, logger:)
60
60
  raise AugmenterError, Helper::MSG_DMP_NO_DMP_ID if resp.nil?
@@ -70,6 +70,7 @@ module Uc3DmpId
70
70
  JSON.parse({
71
71
  id: "#{Time.now.utc.strftime('%Y-%m-%d')}-#{SecureRandom.hex(4)}",
72
72
  provenance: @augmenter['name'],
73
+ augmenter_run_id: @run_id,
73
74
  timestamp: Time.now.utc.iso8601,
74
75
  dmproadmap_related_identifiers: [],
75
76
  funding: []
@@ -101,6 +101,7 @@ module Uc3DmpId
101
101
  keywords: dmp.fetch('dataset', []).map { |ds| ds.fetch('keyword', []) }.flatten.compact.uniq,
102
102
  identifiers: [dmp.fetch('dmp_id', {})['identifier']],
103
103
  last_names: [],
104
+ orcids: [],
104
105
  affiliation_ids: [],
105
106
  affiliations: [],
106
107
  funder_names: [],
@@ -165,6 +166,7 @@ module Uc3DmpId
165
166
  name = entry.fetch('name', '')&.downcase&.strip
166
167
  last_name = name.include?(', ') ? name.split(', ').first : name.split.last
167
168
 
169
+ @details_hash[:orcids] << id unless id.nil?
168
170
  @details_hash[:identifiers] << [id, ror&.downcase&.strip]
169
171
  @details_hash[:last_names] << last_name
170
172
  @details_hash[:affiliation_ids] << ror
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.1.11'
4
+ VERSION = '0.1.12'
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.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-30 00:00:00.000000000 Z
11
+ date: 2023-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json