uc3-dmp-id 0.0.130 → 0.0.132
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/creator.rb +3 -1
- data/lib/uc3-dmp-id/helper.rb +4 -1
- data/lib/uc3-dmp-id/updater.rb +3 -8
- data/lib/uc3-dmp-id/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: 13e1f0d8f891230656da5e17d827b51fcf6987658ca9a087512b099d93bb0407
|
4
|
+
data.tar.gz: 00e76554133bd49b7b439767a2b46293f9c572592f2321ac9ebe2976f86a19b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3464eb17042087f154f5c57262d5df7ec70ec5af4ca069ded7359d67560e923d1f36505f6cbe7c600161426620559d24418f88364e7ecc915807e229717628a5
|
7
|
+
data.tar.gz: 1b4ff143b32d04ab7e3c00efb1006a4feee0706f50d9695fa4c578138d16f62f91599ff8bbf1ea399c73335fb91d3b3cde6afda112e4f0ddae2314be489e2910
|
data/lib/uc3-dmp-id/creator.rb
CHANGED
@@ -94,15 +94,17 @@ module Uc3DmpId
|
|
94
94
|
publisher.publish(source: 'DmpCreator', dmp: json, logger: logger)
|
95
95
|
|
96
96
|
# Determine if there are any related identifiers that we should try to fetch a citation for
|
97
|
-
citable_identifiers = Helper.citable_related_identifiers(
|
97
|
+
citable_identifiers = Helper.citable_related_identifiers(dmp: json)
|
98
98
|
return true if citable_identifiers.empty?
|
99
99
|
|
100
100
|
# Process each citation individually because they can be slow to fetch
|
101
101
|
citable_identifiers.each do |identifier|
|
102
102
|
citer_detail = {
|
103
103
|
PK: json['PK'],
|
104
|
+
SK: json['SK'],
|
104
105
|
dmproadmap_related_identifier: identifier
|
105
106
|
}
|
107
|
+
logger.debug(message: "Fetching citation for: #{identifier['identifier']}", detail: citer_detail)
|
106
108
|
publisher.publish(source: 'DmpCreator', dmp: json, event_type: 'Citation Fetch', detail: citer_detail, logger: logger)
|
107
109
|
end
|
108
110
|
true
|
data/lib/uc3-dmp-id/helper.rb
CHANGED
@@ -233,7 +233,10 @@ module Uc3DmpId
|
|
233
233
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
234
234
|
|
235
235
|
# Extracts the related identifiers that we can fetch a citation for
|
236
|
-
def citable_related_identifiers(
|
236
|
+
def citable_related_identifiers(dmp:)
|
237
|
+
return [] unless dmp.is_a?(Hash)
|
238
|
+
|
239
|
+
related_identifiers = dmp.fetch('dmproadmap_related_identifiers', [])
|
237
240
|
# Ignore the identifier that points to the narrative PDF document and any identifiers that
|
238
241
|
# we have already fetched the citation for
|
239
242
|
related_identifiers.reject do |id|
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
@@ -143,22 +143,17 @@ module Uc3DmpId
|
|
143
143
|
publisher.publish(source: 'DmpUpdater', dmp: json, logger: logger)
|
144
144
|
|
145
145
|
# Determine if there are any related identifiers that we should try to fetch a citation for
|
146
|
-
citable_identifiers = Helper.citable_related_identifiers(
|
147
|
-
|
148
|
-
puts "CITATION BIT:"
|
149
|
-
puts citable_identifiers
|
150
|
-
|
146
|
+
citable_identifiers = Helper.citable_related_identifiers(dmp: json)
|
151
147
|
return true if citable_identifiers.empty?
|
152
148
|
|
153
149
|
# Process each citation individually because they can be slow to fetch
|
154
150
|
citable_identifiers.each do |identifier|
|
155
151
|
citer_detail = {
|
156
152
|
PK: json['PK'],
|
153
|
+
SK: json['SK'],
|
157
154
|
dmproadmap_related_identifier: identifier
|
158
155
|
}
|
159
|
-
|
160
|
-
puts "SENDING MESSAGE To BRIDGE FOR: #{identifier['identifier']}"
|
161
|
-
|
156
|
+
logger.debug(message: "Fetching citation for: #{identifier['identifier']}", detail: citer_detail)
|
162
157
|
publisher.publish(source: 'DmpUpdater', dmp: json, event_type: 'Citation Fetch', detail: citer_detail, logger: logger)
|
163
158
|
end
|
164
159
|
true
|
data/lib/uc3-dmp-id/version.rb
CHANGED