adiwg-mdtranslator 2.19.0.pre.beta.19 → 2.19.0.pre.beta.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +103 -59
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +7 -0
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataQuality.rb +101 -31
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQuality.rb +16 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataIdentification.rb +29 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataQualityReport.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_gcoDateTime.rb +10 -1
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +9 -26
- 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: e744e49fe2c92d3e5fa2294fa194ce8ce6859d807f526bbf13cd99986111889a
|
4
|
+
data.tar.gz: 18b42409a786e7e6f4f9a94154bd241f0fdfdc9dc1a500cdbde7935c5e59784d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d447dbf152ff9c02d8a3dc96eb1f67f11fd81da4b262a9eb23efb0cdd60acf17e2cc6f7cf33aafe21fd3d1cf0098c4e93b9215f085f310d57671befcc9e66a6a
|
7
|
+
data.tar.gz: 599b8a0c23ded139f5682b9d4b431f8dfba947faf6e71e688fa5a50acbb89286de64e79ea3023175e4defa37bce30233c7517d377766491a0bf62b2e5572ecb1
|
data/Gemfile.lock
CHANGED
@@ -28,24 +28,39 @@ module ADIWG
|
|
28
28
|
|
29
29
|
# data quality 2.1 (attracc) - attribute accuracy
|
30
30
|
xAccuracy = xDataQual.xpath('./attracc')
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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] = '
|
59
|
-
|
60
|
-
|
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] = '
|
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 (
|
96
|
+
# data quality 2.4 (posacc) - Positional Accuracy
|
79
97
|
xPositionalAccuracy = xDataQual.xpath('./posacc')
|
80
98
|
unless xPositionalAccuracy.empty?
|
81
|
-
#
|
82
|
-
|
83
|
-
unless
|
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] = '
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
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
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
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
|
-
#
|
105
|
-
|
106
|
-
unless
|
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] = '
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
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
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
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
|
@@ -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?
|
@@ -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) -
|
32
|
-
|
33
|
-
report[:type] == '
|
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
|
-
|
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
|
-
|
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 (
|
69
|
+
# data quality 2.2 (logic) - logical consistency (required)
|
46
70
|
logic_report = hDataQuality[:report].find do |report|
|
47
|
-
report[:type] == '
|
48
|
-
!report.dig(:
|
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 (
|
58
|
-
|
59
|
-
report[:type] == '
|
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
|
-
|
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) -
|
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] == '
|
74
|
-
report.dig(:
|
75
|
-
|
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
|
-
|
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] == '
|
84
|
-
report.dig(:
|
85
|
-
|
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
|
-
|
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
|
@@ -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
|
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'
|
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'
|
@@ -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
|
-
|
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
|
|
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.
|
4
|
+
version: 2.19.0.pre.beta.22
|
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-
|
12
|
+
date: 2024-05-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|