adiwg-mdtranslator 2.19.0.pre.beta.22 → 2.19.0.pre.beta.26

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: e744e49fe2c92d3e5fa2294fa194ce8ce6859d807f526bbf13cd99986111889a
4
- data.tar.gz: 18b42409a786e7e6f4f9a94154bd241f0fdfdc9dc1a500cdbde7935c5e59784d
3
+ metadata.gz: 9d88e487c8ce8e0beb2266436dec00d2d6f358a3318236a6253084801700eba4
4
+ data.tar.gz: 1b183b2183c65ea0058d160ad21e4f88f9c81678f52658f4034498910a39326f
5
5
  SHA512:
6
- metadata.gz: d447dbf152ff9c02d8a3dc96eb1f67f11fd81da4b262a9eb23efb0cdd60acf17e2cc6f7cf33aafe21fd3d1cf0098c4e93b9215f085f310d57671befcc9e66a6a
7
- data.tar.gz: 599b8a0c23ded139f5682b9d4b431f8dfba947faf6e71e688fa5a50acbb89286de64e79ea3023175e4defa37bce30233c7517d377766491a0bf62b2e5572ecb1
6
+ metadata.gz: 235d729ecc74b5b4e130e63bea84e259d4c1aad1c4f7d2e04d3e71d48ef3883b99993d6042a8709ec857978153abcd3445233f13f8abd4acd3f4cead790b9bbc
7
+ data.tar.gz: e62dbef9e1e07a7d4ba558941b25b012d35e2c4df62e2a5ee30975dea13ce3be29b7e7a281bf7b7c938155693e27a8948e1dd5ed6fa59a93915b090ee38e4edd
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adiwg-mdtranslator (2.19.0.pre.beta.22)
5
- adiwg-mdcodes (= 2.9.4.pre.beta.4)
6
- adiwg-mdjson_schemas (= 2.9.3.pre.beta.3)
4
+ adiwg-mdtranslator (2.19.0.pre.beta.26)
5
+ adiwg-mdcodes (= 2.10.0)
6
+ adiwg-mdjson_schemas (= 2.9.5)
7
7
  builder (~> 3.2)
8
8
  coderay (~> 1.1)
9
9
  jbuilder (~> 2.5)
@@ -30,9 +30,9 @@ GEM
30
30
  tzinfo (~> 1.1)
31
31
  addressable (2.8.5)
32
32
  public_suffix (>= 2.0.2, < 6.0)
33
- adiwg-mdcodes (2.9.4.pre.beta.4)
33
+ adiwg-mdcodes (2.10.0)
34
34
  json (~> 2.0)
35
- adiwg-mdjson_schemas (2.9.3.pre.beta.3)
35
+ adiwg-mdjson_schemas (2.9.5)
36
36
  builder (3.2.4)
37
37
  coderay (1.1.3)
38
38
  concurrent-ruby (1.2.2)
@@ -34,8 +34,8 @@ Gem::Specification.new do |spec|
34
34
  spec.add_runtime_dependency "thor", "~> 0.19"
35
35
  spec.add_runtime_dependency "uuidtools", "~> 2.1"
36
36
  spec.add_runtime_dependency "json-schema", "~> 2.7"
37
- spec.add_runtime_dependency "adiwg-mdjson_schemas", "2.9.3.pre.beta.3"
38
- spec.add_runtime_dependency "adiwg-mdcodes", "2.9.4.pre.beta.4"
37
+ spec.add_runtime_dependency "adiwg-mdjson_schemas", "2.9.5"
38
+ spec.add_runtime_dependency "adiwg-mdcodes", "2.10.0"
39
39
  spec.add_runtime_dependency "jbuilder", "~> 2.5"
40
40
  spec.add_runtime_dependency "kramdown", ">= 1.13", "< 3.0"
41
41
  spec.add_runtime_dependency "coderay", "~> 1.1"
@@ -56,8 +56,10 @@ module ADIWG
56
56
  # data quality 2.1.2.2 (attracce) - Attribute Accuracy Explanation
57
57
  xEvaluationMethod = xQuantitativeAccuracy.xpath('./attracce')
58
58
  unless xEvaluationMethod.empty?
59
- report[:evaluationMethod] = intMetadataClass.newEvaluationMethod
60
- report[:evaluationMethod][:methodDescription] = xEvaluationMethod.text
59
+ evaluationMethod = intMetadataClass.newEvaluationMethod
60
+ evaluationMethod[:name] = 'Attribute Accuracy Explanation'
61
+ evaluationMethod[:methodDescription] = xEvaluationMethod.text
62
+ report[:evaluationMethod] << evaluationMethod
61
63
  end
62
64
  hDataQuality[:report] << report unless report[:quantitativeResult].empty? && report[:evaluationMethod].empty?
63
65
  end
@@ -109,7 +109,7 @@
109
109
  module ADIWG
110
110
  module Mdtranslator
111
111
  # current mdtranslator version
112
- VERSION = "2.19.0-beta.22"
112
+ VERSION = "2.19.0-beta.26"
113
113
  end
114
114
  end
115
115
 
@@ -33,31 +33,42 @@ module ADIWG
33
33
  report[:type] == 'DQ_NonQuantitativeAttributeCorrectness' &&
34
34
  !report.dig(:descriptiveResult, 0, :statement).nil?
35
35
  end
36
- attribute_accuracy_value = hDataQuality[:report].find do |report|
37
- report[:type] == 'DQ_QuantitativeAttributeAccuracy' &&
38
- !report.dig(:quantitativeResult, 0, :values).nil?
36
+ thematic_classification_report = hDataQuality[:report].find do |report|
37
+ report[:type] == 'DQ_ThematicClassificationCorrectness'
39
38
  end
40
- attribute_evaluation_method = hDataQuality[:report].find do |report|
41
- report[:type] == 'DQ_QuantitativeAttributeAccuracy' &&
42
- !report.dig(:evaluationMethod, :methodDescription).nil?
39
+ attribute_accuracy_report_text = ''
40
+ if attribute_accuracy_report
41
+ attribute_accuracy_report_text = attribute_accuracy_report[:descriptiveResult][0][:statement]
43
42
  end
44
- if attribute_accuracy_report || attribute_accuracy_value || attribute_evaluation_method
43
+ if thematic_classification_report
44
+ if attribute_accuracy_report_text != ''
45
+ attribute_accuracy_report_text = attribute_accuracy_report_text + ' ' + thematic_classification_report[:descriptiveResult][0][:statement]
46
+ else
47
+ attribute_accuracy_report_text = thematic_classification_report[:descriptiveResult][0][:statement]
48
+ end
49
+ end
50
+ quantitative_attribute_accuracy = hDataQuality[:report].find do |report|
51
+ report[:type] == 'DQ_QuantitativeAttributeAccuracy'
52
+ end
53
+ attribute_accuracy_value = quantitative_attribute_accuracy.dig(:quantitativeResult, 0, :values, 0) if quantitative_attribute_accuracy
54
+ attribute_evaluation_method = quantitative_attribute_accuracy.dig(:evaluationMethod, :methodDescription) if quantitative_attribute_accuracy
55
+ if attribute_accuracy_report_text != '' || attribute_accuracy_value || attribute_evaluation_method
45
56
  # data quality 2.1 (attracc) - Attribute Accuracy
46
57
  @xml.tag!('attracc') do
47
- if attribute_accuracy_report
58
+ if attribute_accuracy_report_text != ''
48
59
  # data quality 2.1.1 (attraccr) - Attribute Accuracy Report
49
- @xml.tag!('attraccr', attribute_accuracy_report[:descriptiveResult][0][:statement])
60
+ @xml.tag!('attraccr', attribute_accuracy_report_text)
50
61
  end
51
62
  if attribute_accuracy_value || attribute_evaluation_method
52
63
  # data quality 2.1.2 (qattracc) - Quantitative Attribute Accuracy Assessment
53
64
  @xml.tag!('qattracc') do
54
65
  if attribute_accuracy_value
55
66
  # data quality 2.1.2.1 (attraccv) - Attribute Accuracy Value
56
- @xml.tag!('attraccv', attribute_accuracy_value[:quantitativeResult][0][:values][0])
67
+ @xml.tag!('attraccv', attribute_accuracy_value)
57
68
  end
58
69
  if attribute_evaluation_method
59
70
  # data quality 2.1.2.2 (attracce) - Attribute Accuracy Explanation
60
- @xml.tag!('attracce', attribute_evaluation_method[:evaluationMethod][:methodDescription])
71
+ @xml.tag!('attracce', attribute_evaluation_method)
61
72
  end
62
73
  end
63
74
  end
@@ -71,7 +82,44 @@ module ADIWG
71
82
  report[:type] == 'DQ_ConceptualConsistency' &&
72
83
  !report.dig(:descriptiveResult, 0, :statement).nil?
73
84
  end
74
- if logic = logic_report&.dig(:descriptiveResult, 0, :statement)
85
+ domain_report = hDataQuality[:report].find do |report|
86
+ report[:type] == 'DQ_DomainConsistency' &&
87
+ !report.dig(:descriptiveResult, 0, :statement).nil?
88
+ end
89
+ format_report = hDataQuality[:report].find do |report|
90
+ report[:type] == 'DQ_FormatConsistency' &&
91
+ !report.dig(:descriptiveResult, 0, :statement).nil?
92
+ end
93
+ topological_report = hDataQuality[:report].find do |report|
94
+ report[:type] == 'DQ_TopologicalConsistency' &&
95
+ !report.dig(:descriptiveResult, 0, :statement).nil?
96
+ end
97
+ logic = ''
98
+ if logic_report
99
+ logic = logic_report[:descriptiveResult][0][:statement]
100
+ end
101
+ if domain_report
102
+ if logic != ''
103
+ logic = logic + ' ' + domain_report[:descriptiveResult][0][:statement]
104
+ else
105
+ logic = domain_report[:descriptiveResult][0][:statement]
106
+ end
107
+ end
108
+ if format_report
109
+ if logic != ''
110
+ logic = logic + ' ' + format_report[:descriptiveResult][0][:statement]
111
+ else
112
+ logic = format_report[:descriptiveResult][0][:statement]
113
+ end
114
+ end
115
+ if topological_report
116
+ if logic != ''
117
+ logic = logic + ' ' + topological_report[:descriptiveResult][0][:statement]
118
+ else
119
+ logic = topological_report[:descriptiveResult][0][:statement]
120
+ end
121
+ end
122
+ if logic != ''
75
123
  @xml.tag!('logic', logic)
76
124
  else
77
125
  @xml.tag!('logic', 'Not Reported')
@@ -105,66 +153,113 @@ module ADIWG
105
153
  @xml.tag!('complete', 'Not Reported')
106
154
  end
107
155
 
108
- # data quality 2.4 (position) - Positional Accuracy
109
-
156
+ # data quality 2.4 (posacc) - Positional Accuracy
110
157
  # data quality 2.4.1 (horizpa) - Horizontal Positional Accuracy
111
- horizontal_positional_accuracy_report = hDataQuality[:report].find do |report|
112
- report[:type] == 'DQ_AbsoluteExternalPositionalAccuracy' &&
158
+ reports = hDataQuality[:report].select do |report|
159
+ [
160
+ 'DQ_AbsoluteExternalPositionalAccuracy',
161
+ 'DQ_RelativeInternalPositionalAccuracy',
162
+ 'DQ_GriddedDataPositionalAccuracy'
163
+ ].include?(report[:type]) &&
113
164
  report.dig(:descriptiveResult, 0, :name) == 'Horizontal Positional Accuracy Report' &&
114
- !report.dig(:descriptiveResult, 0, :statement).nil?
165
+ !report.dig(:descriptiveResult, 0, :statement).nil?
115
166
  end
116
- horizpar = horizontal_positional_accuracy_report&.dig(:descriptiveResult, 0, :statement)
117
- horizpav = horizontal_positional_accuracy_report&.dig(:quantitativeResult, 0, :values, 0)
118
- horizpae = horizontal_positional_accuracy_report&.dig(:descriptiveResult, 1, :statement)
119
-
167
+
168
+ horizpar = ''
169
+ horizpav = ''
170
+ horizpae = ''
171
+
172
+ reports.each do |report|
173
+ if report[:descriptiveResult]
174
+ report[:descriptiveResult].each do |result|
175
+ if result[:name] == 'Horizontal Positional Accuracy Report'
176
+ horizpar = horizpar.empty? ? result[:statement] : "#{horizpar} #{result[:statement]}"
177
+ elsif result[:name] == 'Horizontal Positional Accuracy Explanation'
178
+ horizpae = horizpae.empty? ? result[:statement] : "#{horizpae} #{result[:statement]}"
179
+ end
180
+ end
181
+ end
182
+ if report[:quantitativeResult]
183
+ report[:quantitativeResult].each do |result|
184
+ if result[:name] == 'Horizontal Positional Accuracy Value' && horizpav.empty?
185
+ horizpav = result[:values][0]
186
+ end
187
+ end
188
+ end
189
+ end
190
+
120
191
  # data quality 2.4.2 (vertacc) - Vertical Positional Accuracy
121
- vertical_positional_accuracy_report = hDataQuality[:report].find do |report|
122
- report[:type] == 'DQ_AbsoluteExternalPositionalAccuracy' &&
192
+ reports = hDataQuality[:report].select do |report|
193
+ [
194
+ 'DQ_AbsoluteExternalPositionalAccuracy',
195
+ 'DQ_RelativeInternalPositionalAccuracy',
196
+ 'DQ_GriddedDataPositionalAccuracy'
197
+ ].include?(report[:type]) &&
123
198
  report.dig(:descriptiveResult, 0, :name) == 'Vertical Positional Accuracy Report' &&
124
199
  !report.dig(:descriptiveResult, 0, :statement).nil?
200
+ end
201
+
202
+ vertaccr = ''
203
+ vertaccv = ''
204
+ vertacce = ''
205
+
206
+ reports.each do |report|
207
+ if report[:descriptiveResult]
208
+ report[:descriptiveResult].each do |result|
209
+ if result[:name] == 'Vertical Positional Accuracy Report'
210
+ vertaccr = vertaccr.empty? ? result[:statement] : "#{vertaccr} #{result[:statement]}"
211
+ elsif result[:name] == 'Vertical Positional Accuracy Explanation'
212
+ vertacce = vertacce.empty? ? result[:statement] : "#{vertacce} #{result[:statement]}"
213
+ end
214
+ end
215
+ end
216
+ if report[:quantitativeResult]
217
+ report[:quantitativeResult].each do |result|
218
+ if result[:name] == 'Vertical Positional Accuracy Value' && vertaccv.empty?
219
+ vertaccv = result[:values][0]
220
+ end
221
+ end
222
+ end
125
223
  end
126
- vertaccr = vertical_positional_accuracy_report&.dig(:descriptiveResult, 0, :statement)
127
- vertaccv = vertical_positional_accuracy_report&.dig(:quantitativeResult, 0, :values, 0)
128
- vertacce = vertical_positional_accuracy_report&.dig(:descriptiveResult, 1, :statement)
129
224
 
130
- if horizpar || vertaccr
131
- # data quality 2.4 (posacc) - Positional Accuracy
225
+ if !horizpar.empty? || !vertaccr.empty?
226
+ # Data quality 2.4 (posacc) - Positional Accuracy
132
227
  @xml.tag!('posacc') do
133
- if horizpar
134
- # data quality 2.4.1 (horizpa) - Horizontal Positional Accuracy
228
+ if !horizpar.empty?
229
+ # Data quality 2.4.1 (horizpa) - Horizontal Positional Accuracy
135
230
  @xml.tag!('horizpa') do
136
- # data quality 2.4.1.1 (horizpar) - Horizontal Positional Accuracy Report
231
+ # Data quality 2.4.1.1 (horizpar) - Horizontal Positional Accuracy Report
137
232
  @xml.tag!('horizpar', horizpar)
138
- if horizpav || horizpae
139
- # data quality 2.4.1.2 (qhorizpa) - Quantitative Horizontal Positional Accuracy
233
+ if horizpav != '' || !horizpae.empty?
234
+ # Data quality 2.4.1.2 (qhorizpa) - Quantitative Horizontal Positional Accuracy
140
235
  @xml.tag!('qhorizpa') do
141
- if horizpav
142
- # data quality 2.4.1.2.1 (horizpav) - Horizontal Positional Accuracy Value
236
+ if horizpav != ''
237
+ # Data quality 2.4.1.2.1 (horizpav) - Horizontal Positional Accuracy Value
143
238
  @xml.tag!('horizpav', horizpav)
144
239
  end
145
- if horizpae
146
- # data quality 2.4.1.2.2 (horizpae) - Horizontal Positional Accuracy Explanation
240
+ if !horizpae.empty?
241
+ # Data quality 2.4.1.2.2 (horizpae) - Horizontal Positional Accuracy Explanation
147
242
  @xml.tag!('horizpae', horizpae)
148
243
  end
149
244
  end
150
245
  end
151
246
  end
152
247
  end
153
-
154
- if vertaccr
155
- # data quality 2.4.2 (vertacc) - Vertical Positional Accuracy
248
+
249
+ if !vertaccr.empty?
250
+ # Data quality 2.4.2 (vertacc) - Vertical Positional Accuracy
156
251
  @xml.tag!('vertacc') do
157
- # data quality 2.4.2.1 (vertaccr) - Vertical Positional Accuracy Report
252
+ # Data quality 2.4.2.1 (vertaccr) - Vertical Positional Accuracy Report
158
253
  @xml.tag!('vertaccr', vertaccr)
159
- if vertaccv || vertacce
160
- # data quality 2.4.2.2 (qvertpa) - Quantitative Vertical Positional Accuracy
254
+ if vertaccv != '' || !vertacce.empty?
255
+ # Data quality 2.4.2.2 (qvertpa) - Quantitative Vertical Positional Accuracy
161
256
  @xml.tag!('qvertpa') do
162
- if vertaccv
163
- # data quality 2.4.2.2.1 (vertaccv) - Vertical Positional Accuracy Value
257
+ if vertaccv != ''
258
+ # Data quality 2.4.2.2.1 (vertaccv) - Vertical Positional Accuracy Value
164
259
  @xml.tag!('vertaccv', vertaccv)
165
260
  end
166
- if vertacce
167
- # data quality 2.4.2.2.2 (vertacce) - Vertical Positional Accuracy Explanation
261
+ if !vertacce.empty?
262
+ # Data quality 2.4.2.2.2 (vertacce) - Vertical Positional Accuracy Explanation
168
263
  @xml.tag!('vertacce', vertacce)
169
264
  end
170
265
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdtranslator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.0.pre.beta.22
4
+ version: 2.19.0.pre.beta.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Smith
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-05-24 00:00:00.000000000 Z
12
+ date: 2024-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -129,28 +129,28 @@ dependencies:
129
129
  requirements:
130
130
  - - '='
131
131
  - !ruby/object:Gem::Version
132
- version: 2.9.3.pre.beta.3
132
+ version: 2.9.5
133
133
  type: :runtime
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - '='
138
138
  - !ruby/object:Gem::Version
139
- version: 2.9.3.pre.beta.3
139
+ version: 2.9.5
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: adiwg-mdcodes
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - '='
145
145
  - !ruby/object:Gem::Version
146
- version: 2.9.4.pre.beta.4
146
+ version: 2.10.0
147
147
  type: :runtime
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - '='
152
152
  - !ruby/object:Gem::Version
153
- version: 2.9.4.pre.beta.4
153
+ version: 2.10.0
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: jbuilder
156
156
  requirement: !ruby/object:Gem::Requirement