adiwg-mdtranslator 2.20.0.pre.beta.3 → 2.20.0.pre.beta.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -10
  3. data/adiwg-mdtranslator.gemspec +2 -2
  4. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +103 -59
  5. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +5 -0
  6. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +4 -0
  7. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +7 -0
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_descriptiveResult.rb +4 -0
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_quantitativeResult.rb +4 -0
  10. data/lib/adiwg/mdtranslator/version.rb +1 -1
  11. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataQuality.rb +101 -31
  12. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQuality.rb +17 -1
  13. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQualityReport.rb +28 -0
  14. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataIdentification.rb +29 -0
  15. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataQualityReport.rb +1 -1
  16. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_gcoDateTime.rb +10 -1
  17. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb +6 -5
  18. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb +1 -0
  19. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +1 -0
  20. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_onlineResource.rb +1 -1
  21. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_quantitativeResult.rb +6 -5
  22. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +1 -1
  23. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +9 -26
  24. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQuality.rb +1 -1
  25. metadata +6 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec23318ef18dc9729c5aaa6c608b55c856234d8e31a893b6c011f02494f75718
4
- data.tar.gz: d28e618a12660f940c9fbc4d3ea380c1109cdc2c7756a32872c2f2e84b4e2c64
3
+ metadata.gz: d8d8a5f731fb5ada7138ee650206ed3a6f81d36ffcbbb52fece5f13befb9bcce
4
+ data.tar.gz: a2023846f039cdfe3dde6f851f13ad463afd36644e9a5a460c2d6416e644c450
5
5
  SHA512:
6
- metadata.gz: 6c81ced313a48931ef23b337d408f512932836b81368c535eb197dc0950795b8510deea40f5a130b4372b3110f1d9020fb943d7537de8e80184dc88b25fe8994
7
- data.tar.gz: 0566ba79a6004232a532bd7eda527bb60a90191ea0a0ba47baf38764efa014341074a31418cdc798f82a2fe5a5860f13d9f8a3e9dce8d170389edea39392a47d
6
+ metadata.gz: d297c28d28dc4f19840b476ba86fb6e89b36d106019a20f7ceedd58b9f36f27e8006eb8c49dcc0de935b060557e25466f7d3deeef8f3de6d05bc7ea981f189d0
7
+ data.tar.gz: 8093a1f20c10929bb69aa9635a6b7f1e2532300f8db5f6761e025651fde5a0ea1ca9b89d8e2111eb8d5da1b98db995f6ca66e50e49fbbfc95ec3d6cfd72027e5
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adiwg-mdtranslator (2.20.0.pre.beta.3)
5
- adiwg-mdcodes (= 2.9.4.pre.beta.0)
6
- adiwg-mdjson_schemas (= 2.9.3.pre.beta.0)
4
+ adiwg-mdtranslator (2.20.0.pre.beta.0)
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)
@@ -17,13 +17,13 @@ PATH
17
17
  GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
- actionview (7.1.3.2)
21
- activesupport (= 7.1.3.2)
20
+ actionview (7.1.3.3)
21
+ activesupport (= 7.1.3.3)
22
22
  builder (~> 3.1)
23
23
  erubi (~> 1.11)
24
24
  rails-dom-testing (~> 2.2)
25
25
  rails-html-sanitizer (~> 1.6)
26
- activesupport (7.1.3.2)
26
+ activesupport (7.1.3.3)
27
27
  base64
28
28
  bigdecimal
29
29
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -35,9 +35,9 @@ GEM
35
35
  tzinfo (~> 2.0)
36
36
  addressable (2.8.6)
37
37
  public_suffix (>= 2.0.2, < 6.0)
38
- adiwg-mdcodes (2.9.4.pre.beta.0)
38
+ adiwg-mdcodes (2.10.0)
39
39
  json (~> 2.0)
40
- adiwg-mdjson_schemas (2.9.3.pre.beta.0)
40
+ adiwg-mdjson_schemas (2.9.5)
41
41
  base64 (0.2.0)
42
42
  bigdecimal (3.1.8)
43
43
  builder (3.2.4)
@@ -67,7 +67,7 @@ GEM
67
67
  nokogiri (1.15.6-x86_64-linux)
68
68
  racc (~> 1.4)
69
69
  public_suffix (5.0.5)
70
- racc (1.7.3)
70
+ racc (1.8.0)
71
71
  rails-dom-testing (2.2.0)
72
72
  activesupport (>= 5.0.0)
73
73
  minitest
@@ -76,7 +76,9 @@ GEM
76
76
  loofah (~> 2.21)
77
77
  nokogiri (~> 1.14)
78
78
  rake (13.1.0)
79
- rexml (3.2.6)
79
+ rexml (3.2.8)
80
+ strscan (>= 3.0.9)
81
+ strscan (3.1.0)
80
82
  thor (0.20.3)
81
83
  tzinfo (2.0.6)
82
84
  concurrent-ruby (~> 1.0)
@@ -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.0"
38
- spec.add_runtime_dependency "adiwg-mdcodes", "2.9.4.pre.beta.0"
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"
@@ -28,24 +28,39 @@ module ADIWG
28
28
 
29
29
  # data quality 2.1 (attracc) - attribute accuracy
30
30
  xAccuracy = xDataQual.xpath('./attracc')
31
- accuracyReport = xAccuracy.xpath('./attraccr').text
32
- report = intMetadataClass.newDataQualityReport
33
- report[:type] = 'NonQuantitativeAttributeCorrectness'
34
- descriptiveResult = intMetadataClass.newDescriptiveResult
35
- descriptiveResult[:statement] = accuracyReport
36
- report[:descriptiveResult] << descriptiveResult
37
- hDataQuality[:report] << report
38
-
39
- # data quality 2.1 (qattracc) - Quantitative Attribute Accuracy Assessment
40
- xQuantitativeAccuracy = xDataQual.xpath('./qattracc')
41
- unless xQuantitativeAccuracy.xpath('./attraccv').empty?
42
- value = xQuantitativeAccuracy.xpath('./attraccv').text
43
- report = intMetadataClass.newDataQualityReport
44
- report[:type] = 'QuantitativeAttributeAccuracy'
45
- quantitativeResult = intMetadataClass.newQuantitativeResult
46
- quantitativeResult[:values] << value
47
- report[:quantitativeResult] << quantitativeResult
48
- hDataQuality[:report] << report
31
+ unless xAccuracy.empty?
32
+ # data quality 2.1.1 (attraccr) - Attribute Accuracy Report
33
+ xAccuracyReport = xAccuracy.xpath('./attraccr')
34
+ unless xAccuracyReport.empty?
35
+ report = intMetadataClass.newDataQualityReport
36
+ report[:type] = 'DQ_NonQuantitativeAttributeCorrectness'
37
+ descriptiveResult = intMetadataClass.newDescriptiveResult
38
+ descriptiveResult[:name] = 'Attribute Accuracy Report'
39
+ descriptiveResult[:statement] = xAccuracyReport.text
40
+ report[:descriptiveResult] << descriptiveResult
41
+ hDataQuality[:report] << report
42
+ end
43
+ # data quality 2.1.2 (qattracc) - Quantitative Attribute Accuracy Assessment
44
+ xQuantitativeAccuracy = xAccuracy.xpath('./qattracc')
45
+ unless xQuantitativeAccuracy.empty?
46
+ report = intMetadataClass.newDataQualityReport
47
+ report[:type] = 'DQ_QuantitativeAttributeAccuracy'
48
+ # data quality 2.1.2.1 (attraccv) - Attribute Accuracy Value
49
+ xQuantitativeAccuracyValue = xQuantitativeAccuracy.xpath('./attraccv')
50
+ unless xQuantitativeAccuracyValue.empty?
51
+ quantitativeResult = intMetadataClass.newQuantitativeResult
52
+ quantitativeResult[:name] = 'Attribute Accuracy Value'
53
+ quantitativeResult[:values] << xQuantitativeAccuracyValue.text
54
+ report[:quantitativeResult] << quantitativeResult
55
+ end
56
+ # data quality 2.1.2.2 (attracce) - Attribute Accuracy Explanation
57
+ xEvaluationMethod = xQuantitativeAccuracy.xpath('./attracce')
58
+ unless xEvaluationMethod.empty?
59
+ report[:evaluationMethod] = intMetadataClass.newEvaluationMethod
60
+ report[:evaluationMethod][:methodDescription] = xEvaluationMethod.text
61
+ end
62
+ hDataQuality[:report] << report unless report[:quantitativeResult].empty? && report[:evaluationMethod].empty?
63
+ end
49
64
  end
50
65
 
51
66
  # data quality 2.2 (logic) - logical consistency (required) (not implemented)
@@ -55,9 +70,11 @@ module ADIWG
55
70
  else
56
71
  logic = xLogic.text
57
72
  report = intMetadataClass.newDataQualityReport
58
- report[:type] = 'ConceptualConsistency'
59
- report[:qualityMeasure] = intMetadataClass.newQualityMeasure
60
- report[:qualityMeasure][:description] = logic
73
+ report[:type] = 'DQ_ConceptualConsistency'
74
+ descriptiveResult = intMetadataClass.newDescriptiveResult
75
+ descriptiveResult[:name] = 'Logical Consistency Report'
76
+ descriptiveResult[:statement] = logic
77
+ report[:descriptiveResult] << descriptiveResult
61
78
  hDataQuality[:report] << report
62
79
  end
63
80
 
@@ -68,59 +85,86 @@ module ADIWG
68
85
  else
69
86
  complete = xComplete.text
70
87
  report = intMetadataClass.newDataQualityReport
71
- report[:type] = 'Omission'
88
+ report[:type] = 'DQ_CompletenessOmission'
72
89
  descriptiveResult = intMetadataClass.newDescriptiveResult
90
+ descriptiveResult[:name] = 'Completeness Report'
73
91
  descriptiveResult[:statement] = complete
74
92
  report[:descriptiveResult] << descriptiveResult
75
93
  hDataQuality[:report] << report
76
94
  end
77
95
 
78
- # data quality 2.4 (position) - positional accuracy
96
+ # data quality 2.4 (posacc) - Positional Accuracy
79
97
  xPositionalAccuracy = xDataQual.xpath('./posacc')
80
98
  unless xPositionalAccuracy.empty?
81
- # horizontal positional accuracy
82
- xHorizontal = xPositionalAccuracy.xpath('./horizpa')
83
- unless xHorizontal.empty?
99
+ # data quality 2.4.1 (horizpa) - Horizontal Positional Accuracy
100
+ xHorizontalAccuracy = xPositionalAccuracy.xpath('./horizpa')
101
+ unless xHorizontalAccuracy.empty?
84
102
  report = intMetadataClass.newDataQualityReport
85
- report[:type] = 'AbsoluteExternalPositionalAccuracy'
86
- unless xHorizontal.xpath('qhorizpa/horizpae').empty?
87
- report[:qualityMeasure] = intMetadataClass.newQualityMeasure
88
- report[:qualityMeasure][:description] = xHorizontal.xpath('qhorizpa/horizpae').text
89
- name = 'Horizontal Positional Accuracy Report'
90
- report[:qualityMeasure][:nameOfMeasure] << name
103
+ report[:type] = 'DQ_AbsoluteExternalPositionalAccuracy'
104
+ # data quality 2.4.1.1 (horizpar) - Horizontal Positional Accuracy Report
105
+ xHorizontalAccuracyReport = xHorizontalAccuracy.xpath('./horizpar')
106
+ unless xHorizontalAccuracyReport.empty?
107
+ descriptiveResult = intMetadataClass.newDescriptiveResult
108
+ descriptiveResult[:name] = 'Horizontal Positional Accuracy Report'
109
+ descriptiveResult[:statement] = xHorizontalAccuracyReport.text
110
+ report[:descriptiveResult] << descriptiveResult
91
111
  end
92
- unless xHorizontal.xpath('horizpar').empty?
93
- report[:evaluationMethod] = intMetadataClass.newEvaluationMethod
94
- report[:evaluationMethod][:methodDescription] = xHorizontal.xpath('horizpar').text
95
- end
96
- unless xHorizontal.xpath('qhorizpa/horizpav').empty?
97
- quantitativeResult = intMetadataClass.newQuantitativeResult
98
- value = xHorizontal.xpath('qhorizpa/horizpav').text
99
- quantitativeResult[:values] << value
100
- report[:quantitativeResult] << quantitativeResult
112
+ # data quality 2.4.1.2 (qhorizpa) - Quantitative Horizontal Positional Accuracy Assessment
113
+ xQuantitativeHorizontalAccuracy = xHorizontalAccuracy.xpath('./qhorizpa')
114
+ unless xQuantitativeHorizontalAccuracy.empty?
115
+ # data quality 2.4.1.2.1 (horizpav) - Horizontal Positional Accuracy Value
116
+ xHorizontalAccuracyValue = xQuantitativeHorizontalAccuracy.xpath('horizpav')
117
+ unless xHorizontalAccuracyValue.empty?
118
+ quantitativeResult = intMetadataClass.newQuantitativeResult
119
+ value = xHorizontalAccuracyValue.text
120
+ quantitativeResult[:name] = 'Horizontal Positional Accuracy Value'
121
+ quantitativeResult[:values] << value
122
+ report[:quantitativeResult] << quantitativeResult
123
+ end
124
+ # data quality 2.4.1.2.2 (horizpae) - Horizontal Positional Accuracy Explanation
125
+ xHorizontalAccuracyExplanation = xQuantitativeHorizontalAccuracy.xpath('horizpae')
126
+ unless xHorizontalAccuracyExplanation.empty?
127
+ descriptiveResult = intMetadataClass.newDescriptiveResult
128
+ descriptiveResult[:name] = 'Horizontal Positional Accuracy Explanation'
129
+ descriptiveResult[:statement] = xHorizontalAccuracyExplanation.text
130
+ report[:descriptiveResult] << descriptiveResult
131
+ end
101
132
  end
102
133
  hDataQuality[:report] << report
103
134
  end
104
- # vertical positional accuracy
105
- xVertical = xPositionalAccuracy.xpath('./vertacc')
106
- unless xVertical.empty?
135
+ # data quality 2.4.2 (vertacc) - Vertical Positional Accuracy
136
+ xVerticalAccuracy = xPositionalAccuracy.xpath('./vertacc')
137
+ unless xVerticalAccuracy.empty?
107
138
  report = intMetadataClass.newDataQualityReport
108
- report[:type] = 'AbsoluteExternalPositionalAccuracy'
109
- unless xVertical.xpath('qvertpa/vertacce').empty?
110
- report[:qualityMeasure] = intMetadataClass.newQualityMeasure
111
- report[:qualityMeasure][:description] = xVertical.xpath('qvertpa/vertacce').text
112
- name = 'Vertical Positional Accuracy Report'
113
- report[:qualityMeasure][:nameOfMeasure] << name
114
- end
115
- unless xVertical.xpath('vertaccr').empty?
116
- report[:evaluationMethod] = intMetadataClass.newEvaluationMethod
117
- report[:evaluationMethod][:methodDescription] = xVertical.xpath('vertaccr').text
139
+ report[:type] = 'DQ_AbsoluteExternalPositionalAccuracy'
140
+ # data quality 2.4.2.1 (vertaccr) - Vertical Positional Accuracy Report
141
+ xVerticalAccuracyReport = xVerticalAccuracy.xpath('./vertaccr')
142
+ unless xVerticalAccuracyReport.empty?
143
+ descriptiveResult = intMetadataClass.newDescriptiveResult
144
+ descriptiveResult[:name] = 'Vertical Positional Accuracy Report'
145
+ descriptiveResult[:statement] = xVerticalAccuracyReport.text
146
+ report[:descriptiveResult] << descriptiveResult
118
147
  end
119
- unless xVertical.xpath('qvertpa/vertaccv').empty?
120
- quantitativeResult = intMetadataClass.newQuantitativeResult
121
- value = xVertical.xpath('qvertpa/vertaccv').text
122
- quantitativeResult[:values] << value
123
- report[:quantitativeResult] << quantitativeResult
148
+ # data quality 2.4.2.2 (qvertpa) - Quantitative Vertical Positional Accuracy Assessment
149
+ xVerticalAccuracyAssessment = xVerticalAccuracy.xpath('./qvertpa')
150
+ unless xVerticalAccuracyAssessment.empty?
151
+ # data quality 2.4.2.2.1 (vertaccv) - Vertical Positional Accuracy Value
152
+ xVerticalAccuracyValue = xVerticalAccuracyAssessment.xpath('vertaccv')
153
+ unless xVerticalAccuracyValue.empty?
154
+ quantitativeResult = intMetadataClass.newQuantitativeResult
155
+ value = xVerticalAccuracyValue.text
156
+ quantitativeResult[:name] = 'Vertical Positional Accuracy Value'
157
+ quantitativeResult[:values] << value
158
+ report[:quantitativeResult] << quantitativeResult
159
+ end
160
+ # data quality 2.4.2.2.2 (vertacce) - Vertical Positional Accuracy Explanation
161
+ xVerticalAccuracyExplanation = xVerticalAccuracyAssessment.xpath('vertacce')
162
+ unless xVerticalAccuracyExplanation.empty?
163
+ descriptiveResult = intMetadataClass.newDescriptiveResult
164
+ descriptiveResult[:name] = 'Vertical Positional Accuracy Explanation'
165
+ descriptiveResult[:statement] = xVerticalAccuracyExplanation.text
166
+ report[:descriptiveResult] << descriptiveResult
167
+ end
124
168
  end
125
169
  hDataQuality[:report] << report
126
170
  end
@@ -23,6 +23,11 @@ module ADIWG
23
23
  intConformanceResult[:scope] = Scope.unpack(hConformanceResult['scope'], responseObj)
24
24
  end
25
25
 
26
+ # name
27
+ if hConformanceResult.has_key?('name')
28
+ intConformanceResult[:name] = hConformanceResult['name']
29
+ end
30
+
26
31
  #specification
27
32
  if hConformanceResult.has_key?('specification')
28
33
  intConformanceResult[:specification] = Citation.unpack(hConformanceResult['specification'], responseObj)
@@ -26,6 +26,10 @@ module ADIWG
26
26
  intResult[:scope] = Scope.unpack(hResult['scope'], responseObj)
27
27
  end
28
28
 
29
+ # name
30
+ if hResult.has_key?('name')
31
+ intResult[:name] = hResult['name']
32
+ end
29
33
 
30
34
  # spatialRepresentationType
31
35
  if hResult.has_key?('spatialRepresentationType')
@@ -35,6 +35,13 @@ module ADIWG
35
35
  end
36
36
  end
37
37
 
38
+ if hDataQuality.has_key?('systemIdentifier')
39
+ systemIdentifier = hDataQuality['systemIdentifier']
40
+ intDataQuality[:systemIdentifier] = {}
41
+ intDataQuality[:systemIdentifier][:uid] = systemIdentifier['uid']
42
+ intDataQuality[:systemIdentifier][:label] = systemIdentifier['label']
43
+ end
44
+
38
45
  if hDataQuality.has_key?('standaloneQualityReport')
39
46
  hObject = hDataQuality['standaloneQualityReport']
40
47
  unless hObject.empty?
@@ -25,6 +25,10 @@ module ADIWG
25
25
  intResult[:scope] = Scope.unpack(hResult['scope'], responseObj)
26
26
  end
27
27
 
28
+ if hResult.has_key?('name')
29
+ intResult[:name] = hResult['name']
30
+ end
31
+
28
32
  if hResult.has_key?('statement')
29
33
  intResult[:statement] = hResult['statement']
30
34
  end
@@ -25,6 +25,10 @@ module ADIWG
25
25
  intResult[:scope] = Scope.unpack(hResult['scope'], responseObj)
26
26
  end
27
27
 
28
+ if hResult.has_key?('name')
29
+ intResult[:name] = hResult['name']
30
+ end
31
+
28
32
  if hResult.has_key?('value')
29
33
  intResult[:values] = hResult['value']
30
34
  end
@@ -109,7 +109,7 @@
109
109
  module ADIWG
110
110
  module Mdtranslator
111
111
  # current mdtranslator version
112
- VERSION = "2.20.0-beta.3"
112
+ VERSION = "2.20.0-beta.5"
113
113
  end
114
114
  end
115
115
 
@@ -28,77 +28,147 @@ module ADIWG
28
28
  hDataQuality = intObj.dig(:metadata, :dataQuality, 0)
29
29
 
30
30
  if hDataQuality && hDataQuality[:report]
31
- # data quality 2.1 (attracc) - attribute accuracy (not implemented)
32
- attribute_completeness_report = hDataQuality[:report].find do |report|
33
- report[:type] == 'NonQuantitativeAttributeCorrectness' &&
31
+ # data quality 2.1 (attracc) - Attribute Accuracy
32
+ attribute_accuracy_report = hDataQuality[:report].find do |report|
33
+ report[:type] == 'DQ_NonQuantitativeAttributeCorrectness' &&
34
34
  !report.dig(:descriptiveResult, 0, :statement).nil?
35
35
  end
36
-
37
- if attribute_completeness_report
36
+ attribute_accuracy_value = hDataQuality[:report].find do |report|
37
+ report[:type] == 'DQ_QuantitativeAttributeAccuracy' &&
38
+ !report.dig(:quantitativeResult, 0, :values).nil?
39
+ end
40
+ attribute_evaluation_method = hDataQuality[:report].find do |report|
41
+ report[:type] == 'DQ_QuantitativeAttributeAccuracy' &&
42
+ !report.dig(:evaluationMethod, :methodDescription).nil?
43
+ end
44
+ if attribute_accuracy_report || attribute_accuracy_value || attribute_evaluation_method
45
+ # data quality 2.1 (attracc) - Attribute Accuracy
38
46
  @xml.tag!('attracc') do
39
- @xml.tag!('attraccr', attribute_completeness_report[:descriptiveResult][0][:statement])
47
+ if attribute_accuracy_report
48
+ # data quality 2.1.1 (attraccr) - Attribute Accuracy Report
49
+ @xml.tag!('attraccr', attribute_accuracy_report[:descriptiveResult][0][:statement])
50
+ end
51
+ if attribute_accuracy_value || attribute_evaluation_method
52
+ # data quality 2.1.2 (qattracc) - Quantitative Attribute Accuracy Assessment
53
+ @xml.tag!('qattracc') do
54
+ if attribute_accuracy_value
55
+ # data quality 2.1.2.1 (attraccv) - Attribute Accuracy Value
56
+ @xml.tag!('attraccv', attribute_accuracy_value[:quantitativeResult][0][:values][0])
57
+ end
58
+ if attribute_evaluation_method
59
+ # data quality 2.1.2.2 (attracce) - Attribute Accuracy Explanation
60
+ @xml.tag!('attracce', attribute_evaluation_method[:evaluationMethod][:methodDescription])
61
+ end
62
+ end
63
+ end
40
64
  end
41
65
  elsif @hResponseObj[:writerShowTags]
42
66
  @xml.tag!('attracc', 'Not Reported')
43
67
  end
44
68
 
45
- # data quality 2.2 (logic) - logical consistency (not implemented) (required)
69
+ # data quality 2.2 (logic) - logical consistency (required)
46
70
  logic_report = hDataQuality[:report].find do |report|
47
- report[:type] == 'ConceptualConsistency' &&
48
- !report.dig(:qualityMeasure, :description).nil?
71
+ report[:type] == 'DQ_ConceptualConsistency' &&
72
+ !report.dig(:descriptiveResult, 0, :statement).nil?
49
73
  end
50
-
51
- if logic = logic_report&.dig(:qualityMeasure, :description)
74
+ if logic = logic_report&.dig(:descriptiveResult, 0, :statement)
52
75
  @xml.tag!('logic', logic)
53
76
  else
54
77
  @xml.tag!('logic', 'Not Reported')
55
78
  end
56
79
 
57
- # data quality 2.3 (complete) - completion report (not implemented) (required)
58
- completeness_report = hDataQuality[:report].find do |report|
59
- report[:type] == 'Omission' &&
80
+ # data quality 2.3 (complete) - completion report (required)
81
+ omission_report = hDataQuality[:report].find do |report|
82
+ report[:type] == 'DQ_CompletenessOmission' &&
60
83
  !report.dig(:descriptiveResult, 0, :statement).nil?
61
84
  end
62
-
63
- if complete = completeness_report&.dig(:descriptiveResult, 0, :statement)
85
+ omission = omission_report&.dig(:descriptiveResult, 0, :statement)
86
+ commission_report = hDataQuality[:report].find do |report|
87
+ report[:type] == 'DQ_CompletenessCommission' &&
88
+ !report.dig(:descriptiveResult, 0, :statement).nil?
89
+ end
90
+ commission = commission_report&.dig(:descriptiveResult, 0, :statement)
91
+ complete = ''
92
+ if omission
93
+ complete = omission
94
+ end
95
+ if commission
96
+ if complete != ''
97
+ complete = complete + ' ' + commission
98
+ else
99
+ complete = commission
100
+ end
101
+ end
102
+ if complete != ''
64
103
  @xml.tag!('complete', complete)
65
104
  else
66
105
  @xml.tag!('complete', 'Not Reported')
67
106
  end
68
107
 
69
- # data quality 2.4 (position) - positional accuracy
70
-
108
+ # data quality 2.4 (position) - Positional Accuracy
71
109
 
110
+ # data quality 2.4.1 (horizpa) - Horizontal Positional Accuracy
72
111
  horizontal_positional_accuracy_report = hDataQuality[:report].find do |report|
73
- report[:type] == 'AbsoluteExternalPositionalAccuracy' &&
74
- report.dig(:qualityMeasure, :nameOfMeasure)&.any? { |name|
75
- name == 'Horizontal Positional Accuracy Report'
76
- }
112
+ report[:type] == 'DQ_AbsoluteExternalPositionalAccuracy' &&
113
+ report.dig(:descriptiveResult, 0, :name) == 'Horizontal Positional Accuracy Report' &&
114
+ !report.dig(:descriptiveResult, 0, :statement).nil?
77
115
  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)
78
119
 
79
- horizpar = horizontal_positional_accuracy_report&.dig(:evaluationMethod, :methodDescription)
80
-
81
-
120
+ # data quality 2.4.2 (vertacc) - Vertical Positional Accuracy
82
121
  vertical_positional_accuracy_report = hDataQuality[:report].find do |report|
83
- report[:type] == 'AbsoluteExternalPositionalAccuracy' &&
84
- report.dig(:qualityMeasure, :nameOfMeasure)&.any? { |name|
85
- name == 'Vertical Positional Accuracy Report'
86
- }
122
+ report[:type] == 'DQ_AbsoluteExternalPositionalAccuracy' &&
123
+ report.dig(:descriptiveResult, 0, :name) == 'Vertical Positional Accuracy Report' &&
124
+ !report.dig(:descriptiveResult, 0, :statement).nil?
87
125
  end
88
-
89
- vertaccr = vertical_positional_accuracy_report&.dig(:evaluationMethod, :methodDescription)
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)
90
129
 
91
130
  if horizpar || vertaccr
131
+ # data quality 2.4 (posacc) - Positional Accuracy
92
132
  @xml.tag!('posacc') do
93
133
  if horizpar
134
+ # data quality 2.4.1 (horizpa) - Horizontal Positional Accuracy
94
135
  @xml.tag!('horizpa') do
136
+ # data quality 2.4.1.1 (horizpar) - Horizontal Positional Accuracy Report
95
137
  @xml.tag!('horizpar', horizpar)
138
+ if horizpav || horizpae
139
+ # data quality 2.4.1.2 (qhorizpa) - Quantitative Horizontal Positional Accuracy
140
+ @xml.tag!('qhorizpa') do
141
+ if horizpav
142
+ # data quality 2.4.1.2.1 (horizpav) - Horizontal Positional Accuracy Value
143
+ @xml.tag!('horizpav', horizpav)
144
+ end
145
+ if horizpae
146
+ # data quality 2.4.1.2.2 (horizpae) - Horizontal Positional Accuracy Explanation
147
+ @xml.tag!('horizpae', horizpae)
148
+ end
149
+ end
150
+ end
96
151
  end
97
152
  end
98
153
 
99
154
  if vertaccr
155
+ # data quality 2.4.2 (vertacc) - Vertical Positional Accuracy
100
156
  @xml.tag!('vertacc') do
157
+ # data quality 2.4.2.1 (vertaccr) - Vertical Positional Accuracy Report
101
158
  @xml.tag!('vertaccr', vertaccr)
159
+ if vertaccv || vertacce
160
+ # data quality 2.4.2.2 (qvertpa) - Quantitative Vertical Positional Accuracy
161
+ @xml.tag!('qvertpa') do
162
+ if vertaccv
163
+ # data quality 2.4.2.2.1 (vertaccv) - Vertical Positional Accuracy Value
164
+ @xml.tag!('vertaccv', vertaccv)
165
+ end
166
+ if vertacce
167
+ # data quality 2.4.2.2.2 (vertacce) - Vertical Positional Accuracy Explanation
168
+ @xml.tag!('vertacce', vertacce)
169
+ end
170
+ end
171
+ end
102
172
  end
103
173
  end
104
174
  end
@@ -16,6 +16,22 @@ module ADIWG
16
16
  scopeClass = Html_Scope.new(@html)
17
17
  dataQualityReportClass = Html_DataQualityReport.new(@html)
18
18
 
19
+ # system identifier
20
+ unless hDataQuality[:systemIdentifier].nil?
21
+ systemIdentifier = hDataQuality[:systemIdentifier]
22
+ @html.section(:class => 'block') do
23
+ @html.details do
24
+ @html.summary('System Identifier', {'class' => 'h4'})
25
+ @html.em('UUID: ')
26
+ @html.text!(systemIdentifier[:uid])
27
+ @html.br
28
+ @html.em('Label:')
29
+ @html.text!(systemIdentifier[:label])
30
+ @html.br
31
+ end
32
+ end
33
+ end
34
+
19
35
  # scope
20
36
  unless hDataQuality[:scope].empty?
21
37
  @html.section(:class => 'block') do
@@ -64,7 +80,7 @@ module ADIWG
64
80
  hDataQuality[:report].each do |report|
65
81
  @html.section(:class => 'block') do
66
82
  @html.details do
67
- @html.summary('Report', {'class' => 'h5'})
83
+ @html.summary(report[:type], {'class' => 'h5'})
68
84
  dataQualityReportClass.writeHtml(report)
69
85
  end
70
86
  end
@@ -185,6 +185,13 @@ module ADIWG
185
185
  end
186
186
  end
187
187
  end
188
+
189
+ # Name
190
+ unless result[:name].nil?
191
+ @html.em('Name: ')
192
+ @html.text!(result[:name])
193
+ @html.br
194
+ end
188
195
 
189
196
  # Specification (citation)
190
197
  unless result[:specification].empty?
@@ -242,6 +249,13 @@ module ADIWG
242
249
  end
243
250
  end
244
251
 
252
+ # Name
253
+ unless result[:name].nil?
254
+ @html.em('Name: ')
255
+ @html.text!(result[:name])
256
+ @html.br
257
+ end
258
+
245
259
  # SpatialRepresentationType
246
260
  unless result[:spatialRepresentationType].nil?
247
261
  @html.em('Spatial Representation Type: ')
@@ -317,6 +331,13 @@ module ADIWG
317
331
  end
318
332
  end
319
333
  end
334
+
335
+ # Name
336
+ unless result[:name].nil?
337
+ @html.em('Name: ')
338
+ @html.text!(result[:name])
339
+ @html.br
340
+ end
320
341
 
321
342
  # Statement
322
343
  unless result[:statement].nil?
@@ -352,6 +373,13 @@ module ADIWG
352
373
  end
353
374
  end
354
375
  end
376
+
377
+ # Name
378
+ unless result[:name].nil?
379
+ @html.em('Name: ')
380
+ @html.text!(result[:name])
381
+ @html.br
382
+ end
355
383
 
356
384
  # Value
357
385
  unless result[:values].empty?
@@ -277,6 +277,33 @@ module ADIWG
277
277
 
278
278
  # data identification - resource constraints [] {MD_Constraints}
279
279
  aConstraint = hResource[:constraints]
280
+ legalConstraint = aConstraint.find { |hCon| hCon[:type] == 'legal' }
281
+ # handle distribution liability statements - add to legal constraint -> other constraints
282
+ aDistInfo = hMetadata[:distributorInfo]
283
+ liabilityStatements = []
284
+ aDistInfo.each do |hDistribution|
285
+ unless hDistribution.empty?
286
+ unless hDistribution[:liabilityStatement].nil?
287
+ liabilityStatements << hDistribution[:liabilityStatement]
288
+ end
289
+ end
290
+ end
291
+ if liabilityStatements.any?
292
+ # Create a new legal constraint if it doesn't exist
293
+ unless legalConstraint
294
+ legalConstraint = {
295
+ type: 'legal',
296
+ legalConstraint: {
297
+ otherCons: []
298
+ }
299
+ }
300
+ aConstraint << legalConstraint
301
+ end
302
+ liabilityStatements.each do |liabilityStatement|
303
+ legalConstraint[:legalConstraint][:otherCons] << liabilityStatement
304
+ end
305
+ end
306
+
280
307
  aConstraint.each do |hCon|
281
308
  @xml.tag!('mri:resourceConstraints') do
282
309
  constraintClass.writeXML(hCon, 'resource information')
@@ -286,6 +313,8 @@ module ADIWG
286
313
  @xml.tag!('mri:resourceConstraints')
287
314
  end
288
315
 
316
+ # data identification - resource constraints {} from distribution liability statement
317
+
289
318
  # data identification - associated resource [] {MD_AssociatedResource}
290
319
  aAssocRes.each do |hAssocRes|
291
320
  @xml.tag!('mri:associatedResource') do
@@ -34,7 +34,7 @@ module ADIWG
34
34
  citationClass = CI_Citation.new(@xml, @hResponseObj)
35
35
 
36
36
  @xml.tag!('mdq:report') do
37
- @xml.tag!("mdq:DQ_#{hReport[:type]}") do
37
+ @xml.tag!("mdq:#{hReport[:type]}") do
38
38
 
39
39
  # standaloneQualityReportDetails
40
40
  unless hReport[:standaloneQualityReportDetails].nil?
@@ -24,7 +24,16 @@ module ADIWG
24
24
  # date - date (required)
25
25
  unless date.nil?
26
26
  case dateRes
27
- when 'Y', 'YM', 'YMD', 'YMDh', 'YMDhm', 'YMDhms'
27
+ when 'Y'
28
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, 'Y')
29
+ @xml.tag!('gco:Date', dateStr)
30
+ when 'YM'
31
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, 'YM')
32
+ @xml.tag!('gco:Date', dateStr)
33
+ when 'YMD'
34
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, 'YMD')
35
+ @xml.tag!('gco:Date', dateStr)
36
+ when 'YMDh', 'YMDhm', 'YMDhms'
28
37
  dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(date, 'YMDhms')
29
38
  @xml.tag!('gco:DateTime', dateStr)
30
39
  when 'YMDhZ', 'YMDhmZ', 'YMDhmsZ'
@@ -10,11 +10,12 @@ module ADIWG
10
10
  module ConformanceResult
11
11
  def self.build(hConformanceResult)
12
12
  Jbuilder.new do |json|
13
- json.dateTime hConformanceResult[:dateTime]
14
- json.scope Scope.build(hConformanceResult[:scope])
15
- json.specification Citation.build(hConformanceResult[:specification])
16
- json.explanation hConformanceResult[:explanation]
17
- json.pass hConformanceResult[:pass]
13
+ json.dateTime hConformanceResult[:dateTime] unless hConformanceResult[:dateTime].nil?
14
+ json.scope Scope.build(hConformanceResult[:scope]) unless hConformanceResult[:scope].empty?
15
+ json.name hConformanceResult[:name] unless hConformanceResult[:name].nil?
16
+ json.specification Citation.build(hConformanceResult[:specification]) unless hConformanceResult[:specification].empty?
17
+ json.explanation hConformanceResult[:explanation] unless hConformanceResult[:explanation].nil?
18
+ json.pass hConformanceResult[:pass] unless hConformanceResult[:pass].nil?
18
19
  end
19
20
  end
20
21
  end
@@ -15,6 +15,7 @@ module ADIWG
15
15
  Jbuilder.new do |json|
16
16
  json.dateTime hCoverageResult[:dateTime]
17
17
  json.scope Scope.build(hCoverageResult[:scope]) unless hCoverageResult[:scope].empty?
18
+ json.name hCoverageResult[:name] unless hCoverageResult[:name].nil?
18
19
  json.spatialRepresentationType hCoverageResult[:spatialRepresentationType]
19
20
  json.spatialRepresentation SpatialRepresentation.build(hCoverageResult[:spatialRepresentation]) unless hCoverageResult[:spatialRepresentation].empty?
20
21
  json.resultContentDescription CoverageDescription.build(hCoverageResult[:resultContentDescription]) unless hCoverageResult[:resultContentDescription].empty?
@@ -11,6 +11,7 @@ module ADIWG
11
11
  Jbuilder.new do |json|
12
12
  json.dateTime hResult[:dateTime] unless hResult[:dateTime].nil?
13
13
  json.scope Scope.build(hResult[:scope]) unless hResult[:scope].empty?
14
+ json.name hResult[:name] unless hResult[:name].nil?
14
15
  json.statement hResult[:statement] unless hResult[:statement].nil?
15
16
  end
16
17
  end
@@ -19,10 +19,10 @@ module ADIWG
19
19
  Jbuilder.new do |json|
20
20
  json.uri hOlRes[:olResURI]
21
21
  json.name hOlRes[:olResName]
22
+ json.protocol hOlRes[:olResProtocol]
22
23
  json.description hOlRes[:olResDesc]
23
24
  json.function hOlRes[:olResFunction]
24
25
  json.applicationProfile hOlRes[:olResApplicationProfile]
25
- json.protocol hOlRes[:olResProtocol]
26
26
  json.protocolRequest hOlRes[:olResProtocolRequest]
27
27
  end
28
28
 
@@ -9,11 +9,12 @@ module ADIWG
9
9
  module QuantitativeResult
10
10
  def self.build(hResult)
11
11
  Jbuilder.new do |json|
12
- json.dateTime hResult[:dateTime]
13
- json.scope Scope.build(hResult[:scope]) if hResult[:scope]
14
- json.value hResult[:values]
15
- json.valueUnits hResult[:valueUnits]
16
- json.valueRecordType hResult[:valueRecordType]
12
+ json.dateTime hResult[:dateTime] unless hResult[:dateTime].nil?
13
+ json.scope Scope.build(hResult[:scope]) unless hResult[:scope].empty?
14
+ json.name hResult[:name] unless hResult[:name].nil?
15
+ json.value hResult[:values] unless hResult[:values].empty?
16
+ json.valueUnits hResult[:valueUnits] unless hResult[:valueUnits].nil?
17
+ json.valueRecordType hResult[:valueRecordType] unless hResult[:valueRecordType].nil?
17
18
  end
18
19
  end
19
20
  end
@@ -42,8 +42,8 @@ module ADIWG
42
42
  json.abstract hResInfo[:abstract]
43
43
  json.shortAbstract hResInfo[:shortAbstract]
44
44
  json.purpose hResInfo[:purpose]
45
- json.credit hResInfo[:credits] unless hResInfo[:credits].empty?
46
45
  json.timePeriod TimePeriod.build(hResInfo[:timePeriod]) unless hResInfo[:timePeriod].empty?
46
+ json.credit hResInfo[:credits] unless hResInfo[:credits].empty?
47
47
  json.status hResInfo[:status] unless hResInfo[:status].empty?
48
48
  json.pointOfContact @Namespace.json_map(hResInfo[:pointOfContacts], ResponsibleParty)
49
49
  json.spatialReferenceSystem @Namespace.json_map(hResInfo[:spatialReferenceSystems], SpatialReference)
@@ -12,15 +12,15 @@ module ADIWG
12
12
 
13
13
  module Citation
14
14
 
15
- # build from citation as follows ...
16
- # names, [] {citation.responsibleParty[]}
17
- # dates(type), [] {citation.dates[]}
18
- # title, {citation.title}
19
- # uri, [] {citation.onlineResource[]}
20
15
  def self.build(hCitation)
21
16
 
22
17
  citation = ''
23
18
 
19
+ if hCitation[:otherDetails].length > 0
20
+ citation = hCitation[:otherDetails][0]
21
+ return citation
22
+ end
23
+
24
24
  # names
25
25
  aParties = []
26
26
  hCitation[:responsibleParties].each do |hResponsibility|
@@ -45,32 +45,15 @@ module ADIWG
45
45
  unless hContact[:name].nil?
46
46
  sbRole = Codelists.codelist_adiwg2sb('role_adiwg2sb', hParty[:role])
47
47
  sbRole = sbRole.nil? ? hParty[:role] : sbRole
48
- citation += hContact[:name] + '(' + sbRole + '), '
48
+ if sbRole.downcase == 'author'
49
+ citation += hContact[:name] + ', '
50
+ end
49
51
  end
50
52
  end
51
53
  end
52
54
 
53
- # dates
54
- hCitation[:dates].each do |hDate|
55
- dateStr = AdiwgDateTimeFun.stringDateFromDateObject(hDate)
56
- dateType = Codelists.codelist_adiwg2sb('date_adiwg2sb', hDate[:dateType])
57
- unless dateType.nil?
58
- citation += dateStr + '(' + dateType + '), '
59
- end
60
- end
61
-
62
55
  # title
63
- citation += hCitation[:title] + ', '
64
-
65
- # uri
66
- hCitation[:onlineResources].each do |hOnline|
67
- citation += hOnline[:olResURI] + ', '
68
- end
69
-
70
- # clean off last comma
71
- if citation.length > 0
72
- citation = citation[0...-2]
73
- end
56
+ citation += hCitation[:title]
74
57
 
75
58
  citation
76
59
 
@@ -62,7 +62,7 @@ module ADIWG
62
62
  hDataQuality[:report].each do |report|
63
63
  @html.div(:class =>'block') do
64
64
  @html.div do
65
- @html.h5('Report', {'class' => 'h5'})
65
+ @html.h5(report[:type], {'class' => 'h5'})
66
66
  dataQualityReportClass.writeHtml(report)
67
67
  end
68
68
  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.20.0.pre.beta.3
4
+ version: 2.20.0.pre.beta.5
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-09 00:00:00.000000000 Z
12
+ date: 2024-05-26 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.0
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.0
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.0
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.0
153
+ version: 2.10.0
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: jbuilder
156
156
  requirement: !ruby/object:Gem::Requirement