adiwg-mdtranslator 2.18.4 → 2.19.0.pre.beta.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +14 -0
- data/Gemfile.lock +11 -9
- data/adiwg-mdtranslator.gemspec +3 -3
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +27 -11
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +149 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +8 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQualityReport.rb +8 -16
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_evaluationMethod.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_qualityMeasure.rb +34 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_qualityResultFile.rb +72 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_rangeElementDescription.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/sbJson/modules/module_contact.rb +13 -0
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_quality.rb → class_dataQuality.rb} +14 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQuality.rb +39 -18
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQualityReport.rb +385 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_rangeElementDescription.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resultFile.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataQualityReport.rb +213 -39
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_qualityResultFile.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_rangeElementDescription.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb +3 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQualityReport.rb +12 -10
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_funding.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_legalConstraint.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityMeasure.rb +4 -3
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityResultFile.rb +23 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_standaloneQualityReport.rb +31 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +10 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_additionalDocumentation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_algorithm.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_allocation.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_associatedResource.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_attribute.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_attributeGroup.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb +12 -17
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_citation.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_classedData.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_constraint.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_contact.rb +37 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_coverageInfo.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataDictionary.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQuality.rb +31 -12
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQualityReport.rb +385 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_distributor.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_domain.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_domainItem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_entity.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_entityAttribute.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_extent.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_feature.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_featureCollection.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_featureProperties.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_format.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_funding.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geodeticParameters.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicElement.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicExtent.rb +4 -14
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geologicAge.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryCollection.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryObject.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_georectifiedRepresentation.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_georeferenceableRepresentation.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_graphic.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_gridRepresentation.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_identifier.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_imageInfo.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_keyword.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_metadataInfo.rb +9 -9
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_metadataRepository.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_processStep.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_processing.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_rangeElementDescription.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_resourceInfo.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_responsibility.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_resultFile.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_scope.rb +12 -12
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_source.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_taxonomy.rb +1 -1
- metadata +23 -13
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +0 -181
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_bodyScript.js +0 -317
@@ -1,3 +1,14 @@
|
|
1
|
+
require_relative '../iso19115_3_writer'
|
2
|
+
require_relative 'class_format'
|
3
|
+
require_relative 'class_qualityResultFile'
|
4
|
+
require_relative 'class_date'
|
5
|
+
require_relative 'class_scope'
|
6
|
+
require_relative 'class_spatialRepresentation'
|
7
|
+
require_relative 'class_coverageDescription'
|
8
|
+
require_relative 'class_codelist'
|
9
|
+
require_relative 'class_identifier'
|
10
|
+
require_relative 'class_citation'
|
11
|
+
|
1
12
|
module ADIWG
|
2
13
|
module Mdtranslator
|
3
14
|
module Writers
|
@@ -12,83 +23,246 @@ module ADIWG
|
|
12
23
|
def writeXML(hReport)
|
13
24
|
# require 'pry'; binding.pry
|
14
25
|
|
26
|
+
formatClass = MD_Format.new(@xml, @hResponseObj)
|
27
|
+
qualityResultFileClass = QualityResultFile.new(@xml, @hResponseObj)
|
28
|
+
dateClass = CI_Date.new(@xml, @hResponseObj)
|
29
|
+
scopeClass = MD_Scope.new(@xml, @hResponseObj)
|
30
|
+
spatialRepresentationClass = SpatialRepresentation.new(@xml, @hResponseObj)
|
31
|
+
coverageDescriptionClass = MD_CoverageDescription.new(@xml, @hResponseObj)
|
32
|
+
codeListClass = MD_Codelist.new(@xml, @hResponseObj)
|
33
|
+
identifierClass = MD_Identifier.new(@xml, @hResponseObj)
|
34
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
35
|
+
|
15
36
|
@xml.tag!('mdq:report') do
|
16
37
|
@xml.tag!("mdq:#{hReport[:type]}") do
|
17
38
|
|
18
|
-
#
|
19
|
-
|
20
|
-
|
39
|
+
# standaloneQualityReportDetails
|
40
|
+
unless hReport[:standaloneQualityReportDetails].nil?
|
41
|
+
@xml.tag!('mdq:standaloneQualityReportDetails') do
|
42
|
+
@xml.tag!('gco:CharacterString', hReport[:standaloneQualityReportDetails])
|
43
|
+
end
|
44
|
+
end
|
21
45
|
|
22
|
-
#
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
46
|
+
# qualityMeasure {}
|
47
|
+
qualityMeasure = hReport[:qualityMeasure]
|
48
|
+
unless qualityMeasure.empty?
|
49
|
+
@xml.tag!('mdq:measure') do
|
50
|
+
@xml.tag!('mdq:DQ_MeasureReference') do
|
51
|
+
unless qualityMeasure[:identifier].empty?
|
52
|
+
@xml.tag!('mdq:measureIdentification') do
|
53
|
+
identifierClass.writeXML(qualityMeasure[:identifier])
|
54
|
+
end
|
55
|
+
end
|
56
|
+
unless qualityMeasure[:nameOfMeasure].nil?
|
57
|
+
qualityMeasure[:nameOfMeasure].each do |value|
|
58
|
+
@xml.tag!('mdq:nameOfMeasure') do
|
59
|
+
@xml.tag!('gco:CharacterString', value)
|
30
60
|
end
|
31
61
|
end
|
32
62
|
end
|
63
|
+
unless qualityMeasure[:description].nil?
|
64
|
+
@xml.tag!('mdq:measureDescription') do
|
65
|
+
@xml.tag!('gco:CharacterString', qualityMeasure[:description])
|
66
|
+
end
|
67
|
+
end
|
33
68
|
end
|
34
69
|
end
|
35
|
-
end
|
70
|
+
end # qualityMeasure
|
36
71
|
|
37
72
|
# evaluationMethod {}
|
38
73
|
evaluationMethod = hReport[:evaluationMethod]
|
39
|
-
unless evaluationMethod.
|
74
|
+
unless evaluationMethod.empty?
|
40
75
|
@xml.tag!('mdq:evaluationMethod') do
|
41
76
|
@xml.tag!('mdq:DQ_EvaluationMethod') do
|
42
|
-
|
43
|
-
|
77
|
+
unless evaluationMethod[:dateTime].empty?
|
78
|
+
evaluationMethod[:dateTime].each do |dateTime|
|
79
|
+
dateTimeValue = DateTime.parse(dateTime).strftime('%Y-%m-%dT%H:%M:%S')
|
80
|
+
@xml.tag!('mdq:dateTime') do
|
81
|
+
@xml.tag!('gco:DateTime', dateTimeValue)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
unless evaluationMethod[:methodDescription].nil?
|
86
|
+
@xml.tag!('mdq:evaluationMethodDescription') do
|
87
|
+
@xml.tag!('gco:CharacterString', evaluationMethod[:methodDescription])
|
88
|
+
end
|
89
|
+
end
|
90
|
+
unless evaluationMethod[:evaluationProcedure].empty?
|
91
|
+
@xml.tag!('mdq:evaluationProcedure') do
|
92
|
+
citationClass.writeXML(evaluationMethod[:evaluationProcedure])
|
93
|
+
end
|
44
94
|
end
|
95
|
+
unless evaluationMethod[:referenceDocuments].empty?
|
96
|
+
evaluationMethod[:referenceDocuments].each do |citation|
|
97
|
+
@xml.tag!('mdq:referenceDoc') do
|
98
|
+
citationClass.writeXML(citation)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
# TODO the following will not work until the iso_evaluationMethodType codelist is added to mdCodes
|
103
|
+
# unless evaluationMethod[:evaluationMethodType].nil?
|
104
|
+
# @xml.tag!('mdq:evaluationMethodType') do
|
105
|
+
# codeListClass.writeXML('mcc', 'iso_evaluationMethodType', evaluationMethod[:evaluationMethodType])
|
106
|
+
# end
|
107
|
+
# end
|
45
108
|
end
|
46
109
|
end
|
47
|
-
end
|
110
|
+
end # evaluationMethod
|
48
111
|
|
49
|
-
#
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
@xml.tag!('mdq:
|
57
|
-
@xml.tag!('gco:
|
112
|
+
# conformanceResult []
|
113
|
+
unless hReport[:conformanceResult].empty?
|
114
|
+
hReport[:conformanceResult].each do |conformanceResult|
|
115
|
+
@xml.tag!('mdq:result') do
|
116
|
+
@xml.tag!('mdq:DQ_ConformanceResult') do
|
117
|
+
unless conformanceResult[:dateTime].nil?
|
118
|
+
dateTimeValue = DateTime.parse(conformanceResult[:dateTime]).strftime('%Y-%m-%dT%H:%M:%S')
|
119
|
+
@xml.tag!('mdq:dateTime') do
|
120
|
+
@xml.tag!('gco:DateTime', dateTimeValue)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
unless conformanceResult[:scope].empty?
|
124
|
+
@xml.tag!('mdq:resultScope') do
|
125
|
+
scopeClass.writeXML(conformanceResult[:scope])
|
126
|
+
end
|
127
|
+
end
|
128
|
+
unless conformanceResult[:specification].empty?
|
129
|
+
@xml.tag!('mdq:specification') do
|
130
|
+
citationClass.writeXML(conformanceResult[:specification])
|
131
|
+
end
|
132
|
+
end
|
133
|
+
unless conformanceResult[:explanation].nil?
|
134
|
+
@xml.tag!('mdq:explanation') do
|
135
|
+
@xml.tag!('gco:CharacterString', conformanceResult[:explanation])
|
136
|
+
end
|
137
|
+
end
|
138
|
+
unless conformanceResult[:pass].nil?
|
139
|
+
@xml.tag!('mdq:pass') do
|
140
|
+
@xml.tag!('gco:Boolean', conformanceResult[:pass])
|
58
141
|
end
|
59
142
|
end
|
60
143
|
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end # conformanceResult
|
61
147
|
|
62
|
-
|
63
|
-
|
64
|
-
|
148
|
+
# descriptiveResult []
|
149
|
+
unless hReport[:descriptiveResult].empty?
|
150
|
+
hReport[:descriptiveResult].each do |descriptiveResult|
|
151
|
+
@xml.tag!('mdq:result') do
|
152
|
+
@xml.tag!('mdq:DQ_DescriptiveResult') do
|
153
|
+
unless descriptiveResult[:dateTime].nil?
|
154
|
+
dateTimeValue = DateTime.parse(descriptiveResult[:dateTime]).strftime('%Y-%m-%dT%H:%M:%S')
|
155
|
+
@xml.tag!('mdq:dateTime') do
|
156
|
+
@xml.tag!('gco:DateTime', dateTimeValue)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
unless descriptiveResult[:scope].empty?
|
160
|
+
@xml.tag!('mdq:resultScope') do
|
161
|
+
scopeClass.writeXML(descriptiveResult[:scope])
|
162
|
+
end
|
163
|
+
end
|
164
|
+
unless descriptiveResult[:statement].nil?
|
165
|
+
@xml.tag!('mdq:statement') do
|
166
|
+
@xml.tag!('gco:CharacterString', descriptiveResult[:statement])
|
167
|
+
end
|
65
168
|
end
|
66
169
|
end
|
67
170
|
end
|
68
171
|
end
|
69
|
-
end
|
70
|
-
|
172
|
+
end # descriptiveResult
|
71
173
|
|
72
174
|
# quantitativeResult []
|
73
|
-
unless hReport[:quantitativeResult].
|
175
|
+
unless hReport[:quantitativeResult].empty?
|
74
176
|
hReport[:quantitativeResult].each do |quantitativeResult|
|
75
177
|
@xml.tag!('mdq:result') do
|
76
178
|
@xml.tag!('mdq:DQ_QuantitativeResult') do
|
77
|
-
quantitativeResult[:
|
78
|
-
|
79
|
-
|
179
|
+
unless quantitativeResult[:dateTime].nil?
|
180
|
+
dateTimeValue = DateTime.parse(quantitativeResult[:dateTime]).strftime('%Y-%m-%dT%H:%M:%S')
|
181
|
+
@xml.tag!('mdq:dateTime') do
|
182
|
+
@xml.tag!('gco:DateTime', dateTimeValue)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
unless quantitativeResult[:scope].empty?
|
186
|
+
@xml.tag!('mdq:resultScope') do
|
187
|
+
scopeClass.writeXML(quantitativeResult[:scope])
|
188
|
+
end
|
189
|
+
end
|
190
|
+
unless quantitativeResult[:values].empty?
|
191
|
+
quantitativeResult[:values].each do |value|
|
192
|
+
@xml.tag!('mdq:value') do
|
193
|
+
@xml.tag!('gco:Record', value)
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
unless quantitativeResult[:valueUnits].nil?
|
198
|
+
@xml.tag!('mdq:valueUnit') do
|
199
|
+
@xml.tag!('gml:UnitDefinition') do
|
200
|
+
@xml.tag!('gml:identifier', {'codeSpace' => 'units'}, quantitativeResult[:valueUnits])
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
unless quantitativeResult[:valueRecordType].nil?
|
205
|
+
@xml.tag!('mdq:valueType') do
|
206
|
+
@xml.tag!('gco:RecordType', quantitativeResult[:valueRecordType])
|
80
207
|
end
|
81
208
|
end
|
82
209
|
end
|
83
210
|
end
|
84
211
|
end
|
85
|
-
end
|
212
|
+
end # quantitativeResult
|
86
213
|
|
87
|
-
|
88
|
-
|
89
|
-
|
214
|
+
# coverageResult []
|
215
|
+
unless hReport[:coverageResult].empty?
|
216
|
+
hReport[:coverageResult].each do |coverageResult|
|
217
|
+
@xml.tag!('mdq:result') do
|
218
|
+
@xml.tag!('mdq:QE_CoverageResult') do
|
219
|
+
unless coverageResult[:dateTime].nil?
|
220
|
+
dateTimeValue = DateTime.parse(coverageResult[:dateTime]).strftime('%Y-%m-%dT%H:%M:%S')
|
221
|
+
@xml.tag!('mdq:dateTime') do
|
222
|
+
@xml.tag!('gco:DateTime', dateTimeValue)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
unless coverageResult[:scope].empty?
|
226
|
+
@xml.tag!('mdq:resultScope') do
|
227
|
+
scopeClass.writeXML(coverageResult[:scope])
|
228
|
+
end
|
229
|
+
end
|
230
|
+
unless coverageResult[:spatialRepresentationType].nil?
|
231
|
+
@xml.tag!('mdq:spatialRepresentationType') do
|
232
|
+
codeListClass.writeXML('mcc', 'iso_spatialRepresentation', coverageResult[:spatialRepresentationType])
|
233
|
+
end
|
234
|
+
end
|
235
|
+
unless coverageResult[:resultFile].empty?
|
236
|
+
@xml.tag!('mdq:resultFile') do
|
237
|
+
qualityResultFileClass.writeXML(coverageResult[:resultFile])
|
238
|
+
end
|
239
|
+
end
|
240
|
+
unless coverageResult[:spatialRepresentation].empty?
|
241
|
+
@xml.tag!('mdq:resultSpatialRepresentation') do
|
242
|
+
spatialRepresentationClass.writeXML(coverageResult[:spatialRepresentation])
|
243
|
+
end
|
244
|
+
end
|
245
|
+
unless coverageResult[:resultContentDescription].empty?
|
246
|
+
@xml.tag!('mdq:resultContentDescription') do
|
247
|
+
coverageDescriptionClass.writeXML(coverageResult[:resultContentDescription])
|
248
|
+
end
|
249
|
+
end
|
250
|
+
unless coverageResult[:resourceFormat].empty?
|
251
|
+
@xml.tag!('mdq:resultFormat') do
|
252
|
+
formatClass.writeXML(coverageResult[:resourceFormat])
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
257
|
+
end
|
258
|
+
end # coverageResult
|
259
|
+
|
260
|
+
end # mdq:<type>
|
261
|
+
end # mdq:report
|
262
|
+
|
263
|
+
end # writeXML
|
90
264
|
|
91
|
-
end
|
265
|
+
end # DataQualityReport class
|
92
266
|
end
|
93
267
|
end
|
94
268
|
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require_relative '../iso19115_3_writer'
|
2
|
+
require_relative 'class_format'
|
3
|
+
|
4
|
+
module ADIWG
|
5
|
+
module Mdtranslator
|
6
|
+
module Writers
|
7
|
+
module Iso19115_3
|
8
|
+
|
9
|
+
class QualityResultFile
|
10
|
+
|
11
|
+
def initialize(xml, hResponseObj)
|
12
|
+
@xml = xml
|
13
|
+
@hResponseObj = hResponseObj
|
14
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_3
|
15
|
+
end
|
16
|
+
|
17
|
+
def writeXML(hResultFile, inContext = nil)
|
18
|
+
|
19
|
+
# classes used
|
20
|
+
formatClass = MD_Format.new(@xml, @hResponseObj)
|
21
|
+
|
22
|
+
@xml.tag!('mdq:QualityResultFile') do
|
23
|
+
|
24
|
+
unless hResultFile[:fileName].nil?
|
25
|
+
@xml.tag!('mdq:fileName') do
|
26
|
+
@xml.tag!('gcx:FileName', hResultFile[:fileName])
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
unless hResultFile[:fileType].nil?
|
31
|
+
@xml.tag!('mdq:fileType') do
|
32
|
+
@xml.tag!('gcx:MimeFileType', {:type => hResultFile[:fileType]})
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
unless hResultFile[:fileDescription].nil?
|
37
|
+
@xml.tag!('mdq:fileDescription') do
|
38
|
+
@xml.tag!('gco:CharacterString', hResultFile[:fileDescription])
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
unless hResultFile[:fileFormat].empty?
|
43
|
+
@xml.tag!('mdq:fileFormat') do
|
44
|
+
formatClass.writeXML(hResultFile[:fileFormat], inContext)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end # writeXML
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -28,8 +28,8 @@ module ADIWG
|
|
28
28
|
json.recipientId hAllocation[:recipientId]
|
29
29
|
json.responsibleParty @Namespace.json_map(hAllocation[:responsibleParties], ResponsibleParty)
|
30
30
|
json.matching hAllocation[:matching]
|
31
|
-
json.onlineResource @Namespace.json_map(hAllocation[:onlineResources], OnlineResource)
|
32
31
|
json.comment hAllocation[:comment]
|
32
|
+
json.onlineResource @Namespace.json_map(hAllocation[:onlineResources], OnlineResource)
|
33
33
|
end
|
34
34
|
|
35
35
|
end # build
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_scope'
|
3
|
+
require_relative 'mdJson_spatialRepresentation'
|
4
|
+
require_relative 'mdJson_format'
|
5
|
+
require_relative 'mdJson_qualityResultFile'
|
6
|
+
require_relative 'mdJson_coverageDescription'
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module MdJson
|
12
|
+
|
13
|
+
module CoverageResult
|
14
|
+
def self.build(hCoverageResult)
|
15
|
+
Jbuilder.new do |json|
|
16
|
+
json.dateTime hCoverageResult[:dateTime]
|
17
|
+
json.scope Scope.build(hCoverageResult[:scope]) unless hCoverageResult[:scope].empty?
|
18
|
+
json.spatialRepresentationType hCoverageResult[:spatialRepresentationType]
|
19
|
+
json.spatialRepresentation SpatialRepresentation.build(hCoverageResult[:spatialRepresentation]) unless hCoverageResult[:spatialRepresentation].empty?
|
20
|
+
json.resultContentDescription CoverageDescription.build(hCoverageResult[:resultContentDescription]) unless hCoverageResult[:resultContentDescription].empty?
|
21
|
+
json.resourceFormat Format.build(hCoverageResult[:resourceFormat]) unless hCoverageResult[:resourceFormat].empty?
|
22
|
+
json.resultFile QualityResultFile.build(hCoverageResult[:resultFile]) unless hCoverageResult[:resultFile].empty?
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -3,6 +3,8 @@
|
|
3
3
|
require 'jbuilder'
|
4
4
|
require_relative 'mdJson_scope'
|
5
5
|
require_relative 'mdJson_dataQualityReport'
|
6
|
+
require_relative 'mdJson_citation'
|
7
|
+
require_relative 'mdJson_standaloneQualityReport'
|
6
8
|
|
7
9
|
module ADIWG
|
8
10
|
module Mdtranslator
|
@@ -17,7 +19,7 @@ module ADIWG
|
|
17
19
|
Jbuilder.new do |json|
|
18
20
|
json.scope Scope.build(hDataQuality[:scope])
|
19
21
|
json.systemIdentifier hDataQuality[:systemIdentifier]
|
20
|
-
json.standaloneQualityReport hDataQuality[:
|
22
|
+
json.standaloneQualityReport StandaloneQualityReport.build(hDataQuality[:standaloneReport]) unless hDataQuality[:standaloneReport].nil?
|
21
23
|
json.report @Namespace.json_map(hDataQuality[:report], DataQualityReport)
|
22
24
|
end
|
23
25
|
|
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'jbuilder'
|
2
|
-
require_relative 'mdJson_conformanceResult'
|
3
|
-
require_relative 'mdJson_descriptiveResult'
|
4
2
|
require_relative 'mdJson_qualityMeasure'
|
5
|
-
require_relative 'mdJson_quantitativeResult'
|
6
3
|
require_relative 'mdJson_evaluationMethod'
|
4
|
+
require_relative 'mdJson_quantitativeResult'
|
5
|
+
require_relative 'mdJson_descriptiveResult'
|
6
|
+
require_relative 'mdJson_conformanceResult'
|
7
|
+
require_relative 'mdJson_coverageResult'
|
7
8
|
|
8
9
|
module ADIWG
|
9
10
|
module Mdtranslator
|
@@ -16,13 +17,14 @@ module ADIWG
|
|
16
17
|
|
17
18
|
def self.build(hReport)
|
18
19
|
Jbuilder.new do |json|
|
19
|
-
json.type hReport[:type]
|
20
|
-
json.
|
21
|
-
json.
|
22
|
-
json.evaluationMethod EvaluationMethod.build(hReport[:evaluationMethod]) unless hReport[:evaluationMethod].
|
23
|
-
json.
|
24
|
-
json.
|
25
|
-
|
20
|
+
json.type hReport[:type] unless hReport[:type].nil?
|
21
|
+
json.standaloneQualityReportDetails hReport[:standaloneQualityReportDetails] unless hReport[:standaloneQualityReportDetails].nil?
|
22
|
+
json.qualityMeasure QualityMeasure.build(hReport[:qualityMeasure]) unless hReport[:qualityMeasure].empty?
|
23
|
+
json.evaluationMethod EvaluationMethod.build(hReport[:evaluationMethod]) unless hReport[:evaluationMethod].empty?
|
24
|
+
json.quantitativeResult @Namespace.json_map(hReport[:quantitativeResult], QuantitativeResult) unless hReport[:quantitativeResult].empty?
|
25
|
+
json.descriptiveResult @Namespace.json_map(hReport[:descriptiveResult], DescriptiveResult) unless hReport[:descriptiveResult].empty?
|
26
|
+
json.conformanceResult @Namespace.json_map(hReport[:conformanceResult], ConformanceResult) unless hReport[:conformanceResult].empty?
|
27
|
+
json.coverageResult @Namespace.json_map(hReport[:coverageResult], CoverageResult) unless hReport[:coverageResult].empty?
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
@@ -9,9 +9,9 @@ module ADIWG
|
|
9
9
|
module DescriptiveResult
|
10
10
|
def self.build(hResult)
|
11
11
|
Jbuilder.new do |json|
|
12
|
-
json.dateTime hResult[:dateTime]
|
13
|
-
json.scope Scope.build(hResult[:scope]) unless hResult[:scope].
|
14
|
-
json.statement hResult[:statement]
|
12
|
+
json.dateTime hResult[:dateTime] unless hResult[:dateTime].nil?
|
13
|
+
json.scope Scope.build(hResult[:scope]) unless hResult[:scope].empty?
|
14
|
+
json.statement hResult[:statement] unless hResult[:statement].nil?
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -20,9 +20,9 @@ module ADIWG
|
|
20
20
|
def self.build(hFunding)
|
21
21
|
|
22
22
|
Jbuilder.new do |json|
|
23
|
-
json.description hFunding[:description]
|
24
|
-
json.timePeriod TimePeriod.build(hFunding[:timePeriod]) unless hFunding[:timePeriod].empty?
|
25
23
|
json.allocation @Namespace.json_map(hFunding[:allocations], Allocation)
|
24
|
+
json.timePeriod TimePeriod.build(hFunding[:timePeriod]) unless hFunding[:timePeriod].empty?
|
25
|
+
json.description hFunding[:description]
|
26
26
|
end
|
27
27
|
|
28
28
|
end # build
|
@@ -15,8 +15,8 @@ module ADIWG
|
|
15
15
|
def self.build(hLegal)
|
16
16
|
|
17
17
|
Jbuilder.new do |json|
|
18
|
-
json.useConstraint hLegal[:useCodes] unless hLegal[:useCodes].empty?
|
19
18
|
json.accessConstraint hLegal[:accessCodes] unless hLegal[:accessCodes].empty?
|
19
|
+
json.useConstraint hLegal[:useCodes] unless hLegal[:useCodes].empty?
|
20
20
|
json.otherConstraint hLegal[:otherCons] unless hLegal[:otherCons].empty?
|
21
21
|
end
|
22
22
|
|
@@ -28,12 +28,12 @@ module ADIWG
|
|
28
28
|
Jbuilder.new do |json|
|
29
29
|
json.metadataInfo MetadataInfo.build(hMetadata[:metadataInfo])
|
30
30
|
json.resourceInfo ResourceInfo.build(hMetadata[:resourceInfo])
|
31
|
+
json.dataQuality @Namespace.json_map(hMetadata[:dataQuality], DataQuality)
|
31
32
|
json.resourceLineage @Namespace.json_map(hMetadata[:lineageInfo], LineageInfo)
|
32
33
|
json.resourceDistribution @Namespace.json_map(hMetadata[:distributorInfo], Distribution)
|
33
34
|
json.associatedResource @Namespace.json_map(hMetadata[:associatedResources], AssociatedResource)
|
34
35
|
json.additionalDocumentation @Namespace.json_map(hMetadata[:additionalDocuments], AdditionalDocument)
|
35
36
|
json.funding @Namespace.json_map(hMetadata[:funding], Funding)
|
36
|
-
json.dataQuality @Namespace.json_map(hMetadata[:dataQuality], DataQuality)
|
37
37
|
end
|
38
38
|
|
39
39
|
end # build
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_identifier'
|
2
3
|
|
3
4
|
module ADIWG
|
4
5
|
module Mdtranslator
|
@@ -8,9 +9,9 @@ module ADIWG
|
|
8
9
|
module QualityMeasure
|
9
10
|
def self.build(hQualityMeasure)
|
10
11
|
Jbuilder.new do |json|
|
11
|
-
json.identifier hQualityMeasure[:identifier]
|
12
|
-
json.name hQualityMeasure[:
|
13
|
-
json.description hQualityMeasure[:description]
|
12
|
+
json.identifier Identifier.build(hQualityMeasure[:identifier]) unless hQualityMeasure[:identifier].empty?
|
13
|
+
json.name hQualityMeasure[:nameOfMeasure] unless hQualityMeasure[:nameOfMeasure].empty?
|
14
|
+
json.description hQualityMeasure[:description] unless hQualityMeasure[:description].nil?
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_format'
|
3
|
+
|
4
|
+
module ADIWG
|
5
|
+
module Mdtranslator
|
6
|
+
module Writers
|
7
|
+
module MdJson
|
8
|
+
|
9
|
+
module QualityResultFile
|
10
|
+
def self.build(hQualityResultFile)
|
11
|
+
Jbuilder.new do |json|
|
12
|
+
json.fileName hQualityResultFile[:fileName]
|
13
|
+
json.fileDescription hQualityResultFile[:fileDescription]
|
14
|
+
json.fileType hQualityResultFile[:fileType]
|
15
|
+
json.fileFormat Format.build(hQualityResultFile[:fileFormat]) unless hQualityResultFile[:fileFormat].nil?
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# mdJson 2.0 writer - dataQuality
|
2
|
+
|
3
|
+
require 'jbuilder'
|
4
|
+
require_relative 'mdJson_citation'
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Writers
|
9
|
+
module MdJson
|
10
|
+
|
11
|
+
module StandaloneQualityReport
|
12
|
+
|
13
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
14
|
+
|
15
|
+
def self.build(hStandaloneReport)
|
16
|
+
reportReference = hStandaloneReport[:reportReference]
|
17
|
+
Jbuilder.new do |json|
|
18
|
+
json.reportReference Citation.build(reportReference)
|
19
|
+
json.abstract hStandaloneReport[:abstract]
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
|
@@ -149,6 +149,16 @@ module ADIWG
|
|
149
149
|
end
|
150
150
|
end
|
151
151
|
end
|
152
|
+
|
153
|
+
if hContact[:externalIdentifier] && type == 'person'
|
154
|
+
hContact[:externalIdentifier].each do |hExternalIdentifier|
|
155
|
+
if hExternalIdentifier[:namespace] == 'ORCID'
|
156
|
+
json.orcId hExternalIdentifier[:identifier]
|
157
|
+
break
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
152
162
|
end
|
153
163
|
end
|
154
164
|
|
@@ -33,7 +33,7 @@ module ADIWG
|
|
33
33
|
# additional documentation - citation [] {citation}
|
34
34
|
hAddDoc[:citation].each do |hCitation|
|
35
35
|
@html.div do
|
36
|
-
@html.
|
36
|
+
@html.h5(hCitation[:title], {'class' => 'h5'})
|
37
37
|
@html.div(:class => 'block') do
|
38
38
|
citationClass.writeHtml(hCitation)
|
39
39
|
end
|
@@ -32,7 +32,7 @@ module ADIWG
|
|
32
32
|
# algorithm - citation {citation}
|
33
33
|
unless hAlgorithm[:citation].empty?
|
34
34
|
@html.div do
|
35
|
-
@html.
|
35
|
+
@html.h5('Algorithm citation', {'class' => 'h5'})
|
36
36
|
@html.div(:class => 'block') do
|
37
37
|
citationClass.writeHtml(hAlgorithm[:citation])
|
38
38
|
end
|
@@ -80,7 +80,7 @@ module ADIWG
|
|
80
80
|
# allocation - responsible parties [] {responsibleParty}
|
81
81
|
hAllocation[:responsibleParties].each do |hResponsibility|
|
82
82
|
@html.div do
|
83
|
-
@html.
|
83
|
+
@html.h5(hResponsibility[:roleName], 'class' => 'h5')
|
84
84
|
@html.div(:class => 'block') do
|
85
85
|
responsibilityClass.writeHtml(hResponsibility)
|
86
86
|
end
|