uc3-dmp-id 0.1.11 → 0.1.12
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/lib/uc3-dmp-id/augmenter.rb +3 -2
- data/lib/uc3-dmp-id/comparator.rb +2 -0
- data/lib/uc3-dmp-id/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3f3549ad23c4656916e7e6daf8f9152eb755d46279b7a3b689a26dd7d02d26b
|
4
|
+
data.tar.gz: 41a955d7b0e97e1094be9fd9d80b8f7ca45d17b901464aaae6816d09b757aa5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dd968c76f1e6fc0af048385872b93d7b3764b0f11bbfd7925c23233235b61b83a6678daec0544dcf6f0625797733b2de04e98691aff56359228caca849b1269
|
7
|
+
data.tar.gz: be3757e058012feaa9d9f0e11c0b0a75730031ad80f76793bb6f916247bff4c60f001bec49db41466e9aacc8a3b8dbbfcde303b73e5849855b119413fe202bc4
|
data/lib/uc3-dmp-id/augmenter.rb
CHANGED
@@ -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
|
data/lib/uc3-dmp-id/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|