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
@@ -12,7 +12,7 @@ module ADIWG
|
|
12
12
|
module Writers
|
13
13
|
module Fgdc
|
14
14
|
|
15
|
-
class
|
15
|
+
class DataQuality
|
16
16
|
|
17
17
|
def initialize(xml, hResponseObj)
|
18
18
|
@xml = xml
|
@@ -30,7 +30,7 @@ module ADIWG
|
|
30
30
|
if hDataQuality && hDataQuality[:report]
|
31
31
|
# data quality 2.1 (attracc) - attribute accuracy (not implemented)
|
32
32
|
attribute_completeness_report = hDataQuality[:report].find do |report|
|
33
|
-
report[:type] == '
|
33
|
+
report[:type] == 'NonQuantitativeAttributeCompleteness' &&
|
34
34
|
!report.dig(:descriptiveResult, 0, :statement).nil?
|
35
35
|
end
|
36
36
|
|
@@ -44,11 +44,11 @@ module ADIWG
|
|
44
44
|
|
45
45
|
# data quality 2.2 (logic) - logical consistency (not implemented) (required)
|
46
46
|
logic_report = hDataQuality[:report].find do |report|
|
47
|
-
report[:type] == '
|
47
|
+
report[:type] == 'ConceptualConsistency' &&
|
48
48
|
!report.dig(:qualityMeasure, :description).nil?
|
49
49
|
end
|
50
50
|
|
51
|
-
if logic = logic_report&.dig(:qualityMeasure, :
|
51
|
+
if logic = logic_report&.dig(:qualityMeasure, :description)
|
52
52
|
@xml.tag!('logic', logic)
|
53
53
|
else
|
54
54
|
@xml.tag!('logic', 'Not Reported')
|
@@ -56,7 +56,7 @@ module ADIWG
|
|
56
56
|
|
57
57
|
# data quality 2.3 (complete) - completion report (not implemented) (required)
|
58
58
|
completeness_report = hDataQuality[:report].find do |report|
|
59
|
-
report[:type] == '
|
59
|
+
report[:type] == 'CompletenessOmission' &&
|
60
60
|
!report.dig(:descriptiveResult, 0, :statement).nil?
|
61
61
|
end
|
62
62
|
|
@@ -66,20 +66,24 @@ module ADIWG
|
|
66
66
|
@xml.tag!('complete', 'Not Reported')
|
67
67
|
end
|
68
68
|
|
69
|
-
# data quality 2.4 (position) - positional accuracy
|
69
|
+
# data quality 2.4 (position) - positional accuracy
|
70
70
|
|
71
71
|
|
72
72
|
horizontal_positional_accuracy_report = hDataQuality[:report].find do |report|
|
73
|
-
report[:type] == '
|
74
|
-
report.dig(:qualityMeasure, :
|
73
|
+
report[:type] == 'AbsoluteExternalPositionalAccuracy' &&
|
74
|
+
report.dig(:qualityMeasure, :nameOfMeasure)&.any? { |name|
|
75
|
+
name == 'Horizontal Positional Accuracy Report'
|
76
|
+
}
|
75
77
|
end
|
76
78
|
|
77
79
|
horizpar = horizontal_positional_accuracy_report&.dig(:evaluationMethod, :methodDescription)
|
78
80
|
|
79
81
|
|
80
82
|
vertical_positional_accuracy_report = hDataQuality[:report].find do |report|
|
81
|
-
report[:type] == '
|
82
|
-
report.dig(:qualityMeasure, :
|
83
|
+
report[:type] == 'AbsoluteExternalPositionalAccuracy' &&
|
84
|
+
report.dig(:qualityMeasure, :nameOfMeasure)&.any? { |name|
|
85
|
+
name == 'Vertical Positional Accuracy Report'
|
86
|
+
}
|
83
87
|
end
|
84
88
|
|
85
89
|
vertaccr = vertical_positional_accuracy_report&.dig(:evaluationMethod, :methodDescription)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
# Stan Smith 2017-11-16 original script
|
6
6
|
|
7
7
|
require_relative 'class_identification'
|
8
|
-
require_relative '
|
8
|
+
require_relative 'class_dataQuality'
|
9
9
|
require_relative 'class_spatialOrganization'
|
10
10
|
require_relative 'class_spatialReference'
|
11
11
|
require_relative 'class_dictionary'
|
@@ -33,7 +33,7 @@ module ADIWG
|
|
33
33
|
|
34
34
|
# classes used
|
35
35
|
idClass = Identification.new(@xml, @hResponseObj)
|
36
|
-
|
36
|
+
dataQualityClass = DataQuality.new(@xml, @hResponseObj)
|
37
37
|
spaceOrgClass = SpatialOrganization.new(@xml, @hResponseObj)
|
38
38
|
spaceRefClass = SpatialReference.new(@xml, @hResponseObj)
|
39
39
|
dictionaryClass = DataDictionary.new(@xml, @hResponseObj)
|
@@ -62,7 +62,7 @@ module ADIWG
|
|
62
62
|
# currently only lineage is implemented
|
63
63
|
unless intObj[:metadata][:lineageInfo].empty?
|
64
64
|
@xml.tag!('dataqual') do
|
65
|
-
|
65
|
+
dataQualityClass.writeXML(intObj)
|
66
66
|
end
|
67
67
|
end
|
68
68
|
if intObj[:metadata][:lineageInfo].empty? && @hResponseObj[:writerShowTags]
|
@@ -71,6 +71,7 @@ module ADIWG
|
|
71
71
|
@html.a(' Contacts', {'href' => '#body-contacts', 'class' => 'btn navBtn', 'id' => 'contactButton'})
|
72
72
|
@html.a(' Metadata', {'href' => '#body-metadataInfo', 'class' => 'btn navBtn', 'id' => 'metadataButton'})
|
73
73
|
@html.a(' Resource', {'href' => '#body-resourceInfo', 'class' => 'btn navBtn', 'id' => 'resourceButton'})
|
74
|
+
@html.a(' Quality', {'href' => '#body-dataQuality', 'class' => 'btn navBtn', 'id' => 'qualityButton'})
|
74
75
|
@html.a(' Lineage', {'href' => '#body-lineage', 'class' => 'btn navBtn', 'id' => 'lineageButton'})
|
75
76
|
@html.a(' Distribution', {'href' => '#body-distribution', 'class' => 'btn navBtn', 'id' => 'distributionButton'})
|
76
77
|
@html.a(' Associated', {'href' => '#body-associatedResource', 'class' => 'btn navBtn', 'id' => 'associatedButton'})
|
@@ -169,7 +170,10 @@ module ADIWG
|
|
169
170
|
@html.summary('Data Quality', {'id' => 'body-dataQuality', 'class' => 'h2'})
|
170
171
|
aDataQuality.each do |hDataQuality|
|
171
172
|
@html.section(:class => 'block') do
|
172
|
-
|
173
|
+
@html.details do
|
174
|
+
@html.summary('Quality', {'class' => 'h3'})
|
175
|
+
dataQualityClass.writeHtml(hDataQuality)
|
176
|
+
end
|
173
177
|
end
|
174
178
|
end
|
175
179
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
require_relative 'html_citation'
|
2
|
+
require_relative 'html_dataQualityReport'
|
3
|
+
require_relative 'html_scope'
|
2
4
|
|
3
5
|
module ADIWG
|
4
6
|
module Mdtranslator
|
@@ -12,46 +14,65 @@ module ADIWG
|
|
12
14
|
def writeHtml(hDataQuality)
|
13
15
|
citationClass = Html_Citation.new(@html)
|
14
16
|
scopeClass = Html_Scope.new(@html)
|
17
|
+
dataQualityReportClass = Html_DataQualityReport.new(@html)
|
15
18
|
|
16
|
-
|
17
|
-
|
19
|
+
# scope
|
20
|
+
unless hDataQuality[:scope].empty?
|
21
|
+
@html.section(:class => 'block') do
|
18
22
|
@html.details do
|
19
|
-
@html.summary('Scope', {'class' => '
|
20
|
-
@html.section(class
|
23
|
+
@html.summary('Scope', {'class' => 'h4'})
|
24
|
+
@html.section(:class => 'block') do
|
21
25
|
scopeClass.writeHtml(hDataQuality[:scope])
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
25
29
|
end
|
26
30
|
|
27
|
-
|
28
|
-
unless hDataQuality[:
|
29
|
-
( hDataQuality[:
|
30
|
-
hDataQuality[:
|
31
|
-
report = hDataQuality[:
|
32
|
-
|
33
|
-
@html.section(class: 'block') do
|
31
|
+
# standalone quality report
|
32
|
+
unless hDataQuality[:standaloneReport].nil? ||
|
33
|
+
( hDataQuality[:standaloneReport][:abstract].nil? &&
|
34
|
+
hDataQuality[:standaloneReport][:reportReference].nil? )
|
35
|
+
report = hDataQuality[:standaloneReport]
|
36
|
+
@html.section(:class => 'block') do
|
34
37
|
@html.details do
|
35
|
-
@html.summary('Standalone Quality Report', {'class' => '
|
38
|
+
@html.summary('Standalone Quality Report', {'class' => 'h4'})
|
36
39
|
unless report[:abstract].nil?
|
37
|
-
@html.section(class
|
40
|
+
@html.section(:class => 'block') do
|
38
41
|
@html.em('Abstract:')
|
39
42
|
@html.text!(report[:abstract])
|
40
43
|
end
|
41
44
|
end
|
42
|
-
|
43
45
|
unless report[:reportReference].nil?
|
44
|
-
@html.
|
45
|
-
@html.
|
46
|
-
|
47
|
-
|
46
|
+
@html.section(:class => 'block') do
|
47
|
+
@html.details do
|
48
|
+
@html.summary('Report Reference', {'class' => 'h5'})
|
49
|
+
@html.section(:class => 'block') do
|
50
|
+
citationClass.writeHtml(report[:reportReference])
|
51
|
+
end
|
48
52
|
end
|
49
53
|
end
|
50
54
|
end
|
51
55
|
end
|
52
56
|
end
|
57
|
+
end
|
53
58
|
|
59
|
+
# reports
|
60
|
+
unless hDataQuality[:report].nil? || hDataQuality[:report].empty?
|
61
|
+
@html.section(:class => 'block') do
|
62
|
+
@html.details do
|
63
|
+
@html.summary('Reports', {'class' => 'h4'})
|
64
|
+
hDataQuality[:report].each do |report|
|
65
|
+
@html.section(:class => 'block') do
|
66
|
+
@html.details do
|
67
|
+
@html.summary('Report', {'class' => 'h5'})
|
68
|
+
dataQualityReportClass.writeHtml(report)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
54
74
|
end
|
75
|
+
|
55
76
|
end
|
56
77
|
end
|
57
78
|
end
|
@@ -0,0 +1,385 @@
|
|
1
|
+
require_relative 'html_citation'
|
2
|
+
require_relative 'html_identifier'
|
3
|
+
require_relative 'html_scope'
|
4
|
+
require_relative 'html_spatialRepresentation'
|
5
|
+
require_relative 'html_format'
|
6
|
+
require_relative 'html_resultFile'
|
7
|
+
require_relative 'html_coverageInfo'
|
8
|
+
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Writers
|
12
|
+
module Html
|
13
|
+
class Html_DataQualityReport
|
14
|
+
def initialize(html)
|
15
|
+
@html = html
|
16
|
+
end
|
17
|
+
|
18
|
+
def writeHtml(hDataQualityReport)
|
19
|
+
@html.section(:class => 'block') do
|
20
|
+
writeQualityMeasure(hDataQualityReport[:qualityMeasure]) unless hDataQualityReport[:qualityMeasure].empty?
|
21
|
+
end
|
22
|
+
@html.section(:class => 'block') do
|
23
|
+
writeEvaluationMethod(hDataQualityReport[:evaluationMethod]) unless hDataQualityReport[:evaluationMethod].empty?
|
24
|
+
end
|
25
|
+
@html.section(:class => 'block') do
|
26
|
+
writeConformanceResult(hDataQualityReport[:conformanceResult]) unless hDataQualityReport[:conformanceResult].empty?
|
27
|
+
end
|
28
|
+
@html.section(:class => 'block') do
|
29
|
+
writeCoverageResult(hDataQualityReport[:coverageResult]) unless hDataQualityReport[:coverageResult].empty?
|
30
|
+
end
|
31
|
+
@html.section(:class => 'block') do
|
32
|
+
writeDescriptiveResult(hDataQualityReport[:descriptiveResult]) unless hDataQualityReport[:descriptiveResult].empty?
|
33
|
+
end
|
34
|
+
@html.section(:class => 'block') do
|
35
|
+
writeQuantitativeResult(hDataQualityReport[:quantitativeResult]) unless hDataQualityReport[:quantitativeResult].empty?
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def writeQualityMeasure(qualityMeasure)
|
42
|
+
identifierClass = Html_Identifier.new(@html)
|
43
|
+
|
44
|
+
@html.details do
|
45
|
+
@html.summary('Quality Measure', {'class' => 'h5'})
|
46
|
+
@html.section(:class => 'block') do
|
47
|
+
# Identifier
|
48
|
+
unless qualityMeasure[:identifier].empty?
|
49
|
+
@html.details do
|
50
|
+
@html.summary('Identifier', {'class' => 'h5'})
|
51
|
+
@html.section(:class => 'block') do
|
52
|
+
identifierClass.writeHtml(qualityMeasure[:identifier])
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Description
|
58
|
+
unless qualityMeasure[:description].nil?
|
59
|
+
@html.em('Description: ')
|
60
|
+
@html.text!(qualityMeasure[:description])
|
61
|
+
@html.br
|
62
|
+
end
|
63
|
+
|
64
|
+
# Names
|
65
|
+
unless qualityMeasure[:nameOfMeasure].empty?
|
66
|
+
@html.em('Names: ')
|
67
|
+
@html.text!(qualityMeasure[:nameOfMeasure].join('; '))
|
68
|
+
@html.br
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def writeEvaluationMethod(evaluationMethod)
|
75
|
+
citationClass = Html_Citation.new(@html)
|
76
|
+
|
77
|
+
@html.details do
|
78
|
+
@html.summary('Evaluation Method', {'class' => 'h5'})
|
79
|
+
@html.section(:class => 'block') do
|
80
|
+
# Type
|
81
|
+
unless evaluationMethod[:type].nil?
|
82
|
+
@html.em('Type: ')
|
83
|
+
@html.text!(evaluationMethod[:type])
|
84
|
+
@html.br
|
85
|
+
end
|
86
|
+
|
87
|
+
# DateTime
|
88
|
+
unless evaluationMethod[:dateTime].nil?
|
89
|
+
@html.em('Date Time: ')
|
90
|
+
evaluationMethod[:dateTime].each do |datetime|
|
91
|
+
@html.text!(datetime)
|
92
|
+
@html.br
|
93
|
+
end
|
94
|
+
@html.br
|
95
|
+
end
|
96
|
+
|
97
|
+
# MethodDescription
|
98
|
+
unless evaluationMethod[:methodDescription].nil?
|
99
|
+
@html.em('Evaluation Method Description: ')
|
100
|
+
@html.text!(evaluationMethod[:methodDescription])
|
101
|
+
@html.br
|
102
|
+
end
|
103
|
+
|
104
|
+
# EvaluationMethodType
|
105
|
+
unless evaluationMethod[:evaluationMethodType].nil?
|
106
|
+
@html.em('Evaluation Method Type: ')
|
107
|
+
@html.text!(evaluationMethod[:evaluationMethodType])
|
108
|
+
@html.br
|
109
|
+
end
|
110
|
+
|
111
|
+
# DeductiveSource
|
112
|
+
unless evaluationMethod[:deductiveSource].nil?
|
113
|
+
@html.em('Deductive Source: ')
|
114
|
+
@html.text!(evaluationMethod[:deductiveSource])
|
115
|
+
@html.br
|
116
|
+
end
|
117
|
+
|
118
|
+
# SamplingScheme
|
119
|
+
unless evaluationMethod[:samplingScheme].nil?
|
120
|
+
@html.em('Sampling Scheme: ')
|
121
|
+
@html.text!(evaluationMethod[:samplingScheme])
|
122
|
+
@html.br
|
123
|
+
end
|
124
|
+
|
125
|
+
# LotDescription
|
126
|
+
unless evaluationMethod[:lotDescription].nil?
|
127
|
+
@html.em('Lot Description: ')
|
128
|
+
@html.text!(evaluationMethod[:lotDescription])
|
129
|
+
@html.br
|
130
|
+
end
|
131
|
+
|
132
|
+
# SamplingRatio
|
133
|
+
unless evaluationMethod[:samplingRatio].nil?
|
134
|
+
@html.em('Sampling Ratio: ')
|
135
|
+
@html.text!(evaluationMethod[:samplingRatio])
|
136
|
+
@html.br
|
137
|
+
end
|
138
|
+
|
139
|
+
# EvaluationProcedure
|
140
|
+
unless evaluationMethod[:evaluationProcedure].empty?
|
141
|
+
@html.details do
|
142
|
+
@html.summary('Evaluation Procedure', {'class' => 'h5'})
|
143
|
+
@html.section(:class => 'block') do
|
144
|
+
citationClass.writeHtml(evaluationMethod[:evaluationProcedure])
|
145
|
+
end
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
# ReferenceDocument
|
150
|
+
unless evaluationMethod[:referenceDocuments].empty?
|
151
|
+
@html.details do
|
152
|
+
@html.summary('Reference Document', {'class' => 'h5'})
|
153
|
+
evaluationMethod[:referenceDocuments].each do |doc|
|
154
|
+
@html.section(:class => 'block') do
|
155
|
+
citationClass.writeHtml(doc)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
def writeConformanceResult(conformanceResult)
|
165
|
+
citationClass = Html_Citation.new(@html)
|
166
|
+
scopeClass = Html_Scope.new(@html)
|
167
|
+
|
168
|
+
@html.details do
|
169
|
+
@html.summary('Conformance Result', {'class' => 'h5'})
|
170
|
+
conformanceResult.each do |result|
|
171
|
+
@html.section(:class => 'block') do
|
172
|
+
# DateTime
|
173
|
+
unless result[:dateTime].nil?
|
174
|
+
@html.em('Date Time: ')
|
175
|
+
@html.text!(result[:dateTime])
|
176
|
+
@html.br
|
177
|
+
end
|
178
|
+
|
179
|
+
# Scope
|
180
|
+
unless result[:scope].empty?
|
181
|
+
@html.details do
|
182
|
+
@html.summary('Scope', {'class' => 'h5'})
|
183
|
+
@html.section(:class => 'block') do
|
184
|
+
scopeClass.writeHtml(result[:scope])
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
# Specification (citation)
|
190
|
+
unless result[:specification].empty?
|
191
|
+
@html.details do
|
192
|
+
@html.summary('Specification', {'class' => 'h5'})
|
193
|
+
@html.section(:class => 'block') do
|
194
|
+
citationClass.writeHtml(result[:specification])
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
# Explanation
|
200
|
+
unless result[:explanation].nil?
|
201
|
+
@html.em('Explanation: ')
|
202
|
+
@html.text!(result[:explanation])
|
203
|
+
@html.br
|
204
|
+
end
|
205
|
+
|
206
|
+
# Pass (boolean)
|
207
|
+
unless result[:pass].nil?
|
208
|
+
@html.em('Pass: ')
|
209
|
+
@html.text!(result[:pass] ? 'Yes' : 'No')
|
210
|
+
@html.br
|
211
|
+
end
|
212
|
+
end
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
def writeCoverageResult(coverageResult)
|
218
|
+
scopeClass = Html_Scope.new(@html)
|
219
|
+
spatialRepresentationClass = Html_SpatialRepresentation.new(@html)
|
220
|
+
formatClass = Html_Format.new(@html)
|
221
|
+
resultFileClass = Html_ResultFile.new(@html)
|
222
|
+
coverageInfoClass = Html_CoverageInfo.new(@html)
|
223
|
+
|
224
|
+
@html.details do
|
225
|
+
@html.summary('Coverage Result', {'class' => 'h5'})
|
226
|
+
coverageResult.each do |result|
|
227
|
+
@html.section(:class => 'block') do
|
228
|
+
# DateTime
|
229
|
+
unless result[:dateTime].nil?
|
230
|
+
@html.em('Date Time: ')
|
231
|
+
@html.text!(result[:dateTime])
|
232
|
+
@html.br
|
233
|
+
end
|
234
|
+
|
235
|
+
# Scope
|
236
|
+
unless result[:scope].empty?
|
237
|
+
@html.details do
|
238
|
+
@html.summary('Scope', {'class' => 'h5'})
|
239
|
+
@html.section(:class => 'block') do
|
240
|
+
scopeClass.writeHtml(result[:scope])
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
# SpatialRepresentationType
|
246
|
+
unless result[:spatialRepresentationType].nil?
|
247
|
+
@html.em('Spatial Representation Type: ')
|
248
|
+
@html.text!(result[:spatialRepresentationType])
|
249
|
+
@html.br
|
250
|
+
end
|
251
|
+
|
252
|
+
# SpatialRepresentation
|
253
|
+
unless result[:spatialRepresentation].empty?
|
254
|
+
@html.details do
|
255
|
+
@html.summary('Spatial Representation', {'class' => 'h5'})
|
256
|
+
@html.section(:class => 'block') do
|
257
|
+
spatialRepresentationClass.writeHtml(result[:spatialRepresentation])
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
|
262
|
+
# ResultContentDescription
|
263
|
+
unless result[:resultContentDescription].empty?
|
264
|
+
@html.details do
|
265
|
+
@html.summary('Result Content Description', {'class' => 'h5'})
|
266
|
+
@html.section(:class => 'block') do
|
267
|
+
coverageInfoClass.writeHtml(result[:resultContentDescription])
|
268
|
+
end
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
# ResourceFormat
|
273
|
+
unless result[:resourceFormat].empty?
|
274
|
+
@html.details do
|
275
|
+
@html.summary('Resource Format', {'class' => 'h5'})
|
276
|
+
@html.section(:class => 'block') do
|
277
|
+
formatClass.writeHtml(result[:resourceFormat])
|
278
|
+
end
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
# ResultFile
|
283
|
+
unless result[:resultFile].empty?
|
284
|
+
@html.details do
|
285
|
+
@html.summary('Result File', {'class' => 'h5'})
|
286
|
+
@html.section(:class => 'block') do
|
287
|
+
resultFileClass.writeHtml(result[:resultFile])
|
288
|
+
end
|
289
|
+
end
|
290
|
+
end
|
291
|
+
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
296
|
+
|
297
|
+
def writeDescriptiveResult(descriptiveResult)
|
298
|
+
scopeClass = Html_Scope.new(@html) # Assuming a class to handle scope objects
|
299
|
+
|
300
|
+
@html.details do
|
301
|
+
@html.summary('Descriptive Result', {'class' => 'h5'})
|
302
|
+
descriptiveResult.each do |result|
|
303
|
+
@html.section(:class => 'block') do
|
304
|
+
# DateTime
|
305
|
+
unless result[:dateTime].nil?
|
306
|
+
@html.em('Date Time: ')
|
307
|
+
@html.text!(result[:dateTime])
|
308
|
+
@html.br
|
309
|
+
end
|
310
|
+
|
311
|
+
# Scope
|
312
|
+
unless result[:scope].empty?
|
313
|
+
@html.details do
|
314
|
+
@html.summary('Scope', {'class' => 'h5'})
|
315
|
+
@html.section(:class => 'block') do
|
316
|
+
scopeClass.writeHtml(result[:scope])
|
317
|
+
end
|
318
|
+
end
|
319
|
+
end
|
320
|
+
|
321
|
+
# Statement
|
322
|
+
unless result[:statement].nil?
|
323
|
+
@html.em('Statement: ')
|
324
|
+
@html.text!(result[:statement])
|
325
|
+
@html.br
|
326
|
+
end
|
327
|
+
end
|
328
|
+
end
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
def writeQuantitativeResult(quantitativeResult)
|
333
|
+
scopeClass = Html_Scope.new(@html)
|
334
|
+
|
335
|
+
@html.details do
|
336
|
+
@html.summary('Quantitative Result', {'class' => 'h5'})
|
337
|
+
quantitativeResult.each do |result|
|
338
|
+
@html.section(:class => 'block') do
|
339
|
+
# DateTime
|
340
|
+
unless result[:dateTime].nil?
|
341
|
+
@html.em('Date Time: ')
|
342
|
+
@html.text!(result[:dateTime])
|
343
|
+
@html.br
|
344
|
+
end
|
345
|
+
|
346
|
+
# Scope
|
347
|
+
unless result[:scope].empty?
|
348
|
+
@html.details do
|
349
|
+
@html.summary('Scope', {'class' => 'h5'})
|
350
|
+
@html.section(:class => 'block') do
|
351
|
+
scopeClass.writeHtml(result[:scope])
|
352
|
+
end
|
353
|
+
end
|
354
|
+
end
|
355
|
+
|
356
|
+
# Value
|
357
|
+
unless result[:values].empty?
|
358
|
+
@html.em('Value: ')
|
359
|
+
@html.text!(result[:values].join(', '))
|
360
|
+
@html.br
|
361
|
+
end
|
362
|
+
|
363
|
+
# ValueUnits
|
364
|
+
unless result[:valueUnits].nil?
|
365
|
+
@html.em('Value Units: ')
|
366
|
+
@html.text!(result[:valueUnits])
|
367
|
+
@html.br
|
368
|
+
end
|
369
|
+
|
370
|
+
# ValueRecordType
|
371
|
+
unless result[:valueRecordType].nil?
|
372
|
+
@html.em('Value Record Type: ')
|
373
|
+
@html.text!(result[:valueRecordType])
|
374
|
+
@html.br
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
378
|
+
end
|
379
|
+
end
|
380
|
+
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|
384
|
+
end
|
385
|
+
end
|
@@ -25,12 +25,12 @@ module ADIWG
|
|
25
25
|
@html.br
|
26
26
|
end
|
27
27
|
|
28
|
-
red[:
|
28
|
+
red[:rangeElement].each do |hRangeElement|
|
29
29
|
@html.em('Range Element:')
|
30
30
|
@html.text!(hRangeElement)
|
31
|
+
@html.br
|
31
32
|
end
|
32
33
|
|
33
|
-
@html.br
|
34
34
|
end # writeHtml
|
35
35
|
end # Html_RangeElementDescription
|
36
36
|
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# HTML writer
|
2
|
+
# result file
|
3
|
+
|
4
|
+
require_relative 'html_format'
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Writers
|
9
|
+
module Html
|
10
|
+
|
11
|
+
class Html_ResultFile
|
12
|
+
|
13
|
+
def initialize(html)
|
14
|
+
@html = html
|
15
|
+
end
|
16
|
+
|
17
|
+
def writeHtml(hResultFile)
|
18
|
+
|
19
|
+
# classes used
|
20
|
+
formatClass = Html_Format.new(@html)
|
21
|
+
|
22
|
+
|
23
|
+
# result file - file name
|
24
|
+
unless hResultFile[:fileName].nil?
|
25
|
+
@html.em('File Name: ')
|
26
|
+
@html.text!(hResultFile[:fileName])
|
27
|
+
@html.br
|
28
|
+
end
|
29
|
+
|
30
|
+
# result file - file type
|
31
|
+
unless hResultFile[:fileType].nil?
|
32
|
+
@html.em('File Type: ')
|
33
|
+
@html.text!(hResultFile[:fileType])
|
34
|
+
@html.br
|
35
|
+
end
|
36
|
+
|
37
|
+
# result file - file description
|
38
|
+
unless hResultFile[:fileDescription].nil?
|
39
|
+
@html.em('File Description: ')
|
40
|
+
@html.text!(hResultFile[:fileDescription])
|
41
|
+
@html.br
|
42
|
+
end
|
43
|
+
|
44
|
+
# resource format - format specification {citation}
|
45
|
+
unless hResultFile[:fileFormat].empty?
|
46
|
+
@html.details do
|
47
|
+
@html.summary(hResultFile[:fileFormat][:title], {'class' => 'h5'})
|
48
|
+
@html.section(:class => 'block') do
|
49
|
+
formatClass.writeHtml(hResultFile[:fileFormat])
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end # writeHtml
|
55
|
+
end # Html_Format
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|