uc3-dmp-id 0.1.17 → 0.1.19

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: 07b0236754af5543d9df3785caaf83230f118babb09b68c1ff9be3d993c24807
4
- data.tar.gz: bf3f615dcafdab117909c90251e25619c18b9c0156b287ea6ed34b84c31b1a51
3
+ metadata.gz: 0375f36323f6e846bd14ad18a345a0ef42cc29ad9255e26c926f4d18c0960515
4
+ data.tar.gz: b9f5cf963f505420438731225b2663bf4d85dae6683386104d8466808588a804
5
5
  SHA512:
6
- metadata.gz: 667a1a82da392fe2e5a6be5da9e31106c9b472c8120162555ef498acf7e4a622abfb5c03ac804596434809a6942b7bf094b308c6721efd1667fd04cc6b9afa4e
7
- data.tar.gz: 8ea7bbb594f44632fa194f36701f82b43594a7edf788bb356e3b52e8bd276630b936660985f1e567b5cc5aebb22a12c15ab37954860a10e2f506bbf062a055a8
6
+ metadata.gz: 783bb2a9de8175a6c4cd57c879e6dc8a1ae0070e6e25bc344e3fbebb5791ca1cdb25718031c91d078fcba5a94f7e058cf84d4394e3bab0877d7b402a8109a95f
7
+ data.tar.gz: b75ab3c52824b16fd8bd2452272b0defd5a2663e2a62980eb405e5f323089f26ac7e65f4aee2eae2cefacf3fb209e85ff00a391e4a32623e6abfd9ce70d48acb
@@ -55,6 +55,7 @@ module Uc3DmpId
55
55
  mod_hash['funding'] = mod_hash.fetch('funding', []).flatten.compact.uniq
56
56
 
57
57
  # Save the DMP
58
+ @logger.debug(message: 'New mods:', details: mod_hash)
58
59
  @dmp['dmphub_modifications'] = (@known_mods.nil? ? [] : @known_mods) << mod_hash
59
60
  client = Uc3DmpDynamo::Client.new
60
61
  resp = client.put_item(json: @dmp, logger:)
@@ -82,6 +83,7 @@ module Uc3DmpId
82
83
  def _work_to_mod_entry(type:, work:)
83
84
  return nil if work['id'].nil?
84
85
 
86
+ @logger&.debug(message: "Incoming Work:", details: work)
85
87
  ret = {
86
88
  type: 'doi',
87
89
  identifier: work['id'],
@@ -89,13 +91,15 @@ module Uc3DmpId
89
91
  status: 'pending',
90
92
  confidence: work['confidence'],
91
93
  score: work['score'],
92
- notes: work['notes'],
93
- citation: work['citation']
94
+ notes: work['notes']
94
95
  }
95
96
  work_type = work.fetch('type', 'Text')&.downcase&.strip
96
97
  ret[:work_type] = work_type == 'text' ? type : work_type
98
+ citation_in = work.fetch('dmproadmap_related_identifier', {})['citation']
99
+ ret[:citation] = citation_in unless citation_in.nil?
100
+
97
101
  @logger&.debug(message: "Assessing Work: #{work['id']} (pre citation)", details: ret)
98
- return JSON.parse(ret.to_json) if work['bibtex'].nil? || !ret[:citation].nil?
102
+ return JSON.parse(ret.to_json) unless ret[:citation].nil? && !work['bibtex'].nil?
99
103
 
100
104
  ret[:citation] = Uc3DmpCitation::Citer.bibtex_to_citation(uri: work['id'], bibtex_as_string: work['bibtex'])
101
105
  JSON.parse(ret.to_json)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.1.17'
4
+ VERSION = '0.1.19'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.17
4
+ version: 0.1.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley