adiwg-mdtranslator 2.18.0rc3 → 2.18.0rc4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/adiwg-mdtranslator.gemspec +1 -1
  3. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +29 -17
  4. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +3 -1
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalPlanar.rb +1 -1
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +122 -7
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialDomain.rb +1 -1
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +49 -0
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +66 -0
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +69 -0
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQualityReport.rb +109 -0
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_descriptiveResult.rb +40 -0
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distribution.rb +0 -8
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_evaluationMethod.rb +80 -0
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +11 -0
  16. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_quantitativeResult.rb +47 -0
  17. data/lib/adiwg/mdtranslator/version.rb +1 -1
  18. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_distribution.rb +2 -24
  19. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityDetail.rb +1 -1
  20. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +0 -1
  21. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +64 -4
  22. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +2 -2
  23. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +1 -1
  24. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +14 -0
  25. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQuality.rb +47 -0
  26. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dataQuality.rb +64 -0
  27. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dataQualityReport.rb +95 -0
  28. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_individual.rb +10 -10
  29. data/lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_mdMetadata.rb +16 -0
  30. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +60 -11
  31. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQualityReport.rb +95 -0
  32. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +13 -1
  33. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb +25 -0
  34. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb +32 -0
  35. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQualityReport.rb +33 -0
  36. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +23 -0
  37. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_evaluationMethod.rb +33 -0
  38. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +2 -0
  39. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_qualityMeasure.rb +21 -0
  40. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_quantitativeResult.rb +24 -0
  41. metadata +25 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f08fafd68b7dea4229ec4fc18db6a148cc4e99785fb042b364636ec85c15f2e
4
- data.tar.gz: 450d585d18e84c1867252046c065847c209d32a20d53612a7face363141f012a
3
+ metadata.gz: 4bba7e5cbfb11e69e8f2539c9033c72a960aefa7d4f5ed33d796b7c9aff452f0
4
+ data.tar.gz: ae8e40fb781e69671306c4ecb36f24ee9336eb31c6877342aa88421756e1e621
5
5
  SHA512:
6
- metadata.gz: 91322e2506f598e2f6cfa26a0b11eda18b33bae4de10ca67c651e63dc7947373a4f09a261a47e86e8980cb324019da0853a3f83cab043986c594905f8a80c22e
7
- data.tar.gz: 5851f314179dcee20d6e295c9ab5770199a2c7e59e450c5b6a7df4ba232b00d396df8c1798b8bb9232826820f5b6c73786fc3b802ec180874896a8f0c15f7e60
6
+ metadata.gz: 0d1bebfac93b1bf2756e4893396836ed63cc9b663477fae22bab7e5c0b9784fd85ffabe308f15d1d513c42e0ba0e4fbc92ab8cb9f9a7e1927def5769e47dc115
7
+ data.tar.gz: cb25b0dc4553ff72738010a006daaf9e8e2894db099789793a57a805dd843e7896f7666c7f448ca7239988e57a90b5bd694a95f7bf1e4baecff821d895b6b5c5
@@ -34,7 +34,7 @@ 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.8.0.pre.beta2"
37
+ spec.add_runtime_dependency "adiwg-mdjson_schemas", "2.8.0.pre.beta6"
38
38
  spec.add_runtime_dependency "adiwg-mdcodes", "~> 2.8"
39
39
  spec.add_runtime_dependency "jbuilder", "~> 2.5"
40
40
  spec.add_runtime_dependency "kramdown", "~> 1.13"
@@ -142,7 +142,8 @@ class InternalMetadata
142
142
  distributorInfo: [],
143
143
  associatedResources: [],
144
144
  additionalDocuments: [],
145
- funding: []
145
+ funding: [],
146
+ dataQuality: []
146
147
  }
147
148
  end
148
149
 
@@ -635,7 +636,7 @@ class InternalMetadata
635
636
  {
636
637
  scope: {},
637
638
  standaloneReport: {},
638
- reports: []
639
+ report: []
639
640
  }
640
641
  end
641
642
 
@@ -649,6 +650,18 @@ class InternalMetadata
649
650
  }
650
651
  end
651
652
 
653
+ def newCoverageResult
654
+ {
655
+ dateTime: nil,
656
+ scope: {},
657
+ spatialRepresentationType: {},
658
+ spatialRepresentation: {},
659
+ resultContent: [],
660
+ resourceFormat: {},
661
+ resultFile: {}
662
+ }
663
+ end
664
+
652
665
  def newDescriptiveResult
653
666
  {
654
667
  dateTime: nil,
@@ -661,14 +674,14 @@ class InternalMetadata
661
674
  {
662
675
  type: nil,
663
676
  dateTime: [],
664
- description: nil,
677
+ methodDescription: nil,
665
678
  evaluationProcedure: {},
666
679
  referenceDocuments: [],
667
680
  evaluationMethodType: nil,
668
- deductiveSource: 'deductive source',
669
- samplingScheme: 'sampling scheme',
670
- lotDescription: 'lot description',
671
- samplingRatio: 'sampling ratio'
681
+ deductiveSource: nil,
682
+ samplingScheme: nil,
683
+ lotDescription: nil,
684
+ samplingRatio: nil
672
685
  }
673
686
  end
674
687
 
@@ -690,18 +703,17 @@ class InternalMetadata
690
703
  }
691
704
  end
692
705
 
693
- def newReport
706
+ def newDataQualityReport
694
707
  {
695
- type: nil,
696
- dateTime: [],
697
- standaloneQualityReportDetails: nil,
698
- qualityMeasure: {},
708
+ # standaloneQualityReportDetails: nil,
709
+ conformanceResult: [],
710
+ coverageResult: [],
711
+ # derivedElementReport: [],
712
+ descriptiveResult: [],
699
713
  evaluationMethod: {},
700
- quantitativeResults: [],
701
- descriptiveResults: [],
702
- conformanceResults: [],
703
- derivedElementReports: [],
704
- relatedElementReports: []
714
+ qualityMeasure: {},
715
+ quantitativeResult: [],
716
+ # relatedElementReport: []
705
717
  }
706
718
  end
707
719
 
@@ -37,6 +37,7 @@ module ADIWG
37
37
  # build basic mdTranslator internal object
38
38
  hMetadata = intMetadataClass.newMetadata
39
39
  hResourceInfo = intMetadataClass.newResourceInfo
40
+ hDataQuality = intMetadataClass.newDataQuality
40
41
  hMetadata[:resourceInfo] = hResourceInfo
41
42
  intObj[:metadata] = hMetadata
42
43
 
@@ -69,7 +70,8 @@ module ADIWG
69
70
  # metadata (dataqual 2) - data quality
70
71
  xDataQual = xMetadata.xpath('./dataqual')
71
72
  unless xDataQual.empty?
72
- Quality.unpack(xDataQual, hMetadata, hResponseObj)
73
+ dataQuality = Quality.unpack(xDataQual, hMetadata, hDataQuality, hResponseObj)
74
+ hMetadata[:dataQuality] << dataQuality
73
75
  end
74
76
 
75
77
  # metadata (spdoinfo 3) - spatial data organization
@@ -56,7 +56,7 @@ module ADIWG
56
56
  end
57
57
 
58
58
  # packing
59
- unless hProjection.nil? || hProjection.empty?
59
+ unless hProjection.empty?
60
60
  unless distanceUnits.nil?
61
61
  hProjection[:falseEastingNorthingUnits] = distanceUnits
62
62
  end
@@ -15,23 +15,138 @@ module ADIWG
15
15
 
16
16
  module Quality
17
17
 
18
- def self.unpack(xDataQual, hMetadata, hResponseObj)
18
+ def self.unpack(xDataQual, hMetadata, hDataQuality, hResponseObj)
19
19
 
20
- # data quality 2.1 (attracc) - attribute accuracy (not implemented)
20
+ # data quality 2.1 (attracc) - attribute accuracy
21
+ xAccuracy = xDataQual.xpath('./attracc')
22
+ accuracyReport = xAccuracy.xpath('./attraccr').text
23
+ hDataQuality[:report] << {
24
+ type: 'DQ_NonQuantitativeAttributeCompleteness',
25
+ descriptiveResult: [ {statement: accuracyReport} ]
26
+ }
27
+
28
+ # data quality 2.1 (qattracc) - Quantitative Attribute Accuracy Assessment
29
+
30
+ xQuantitativeAccuracy = xDataQual.xpath('./qattracc')
31
+ unless xQuantitativeAccuracy.xpath('./attraccv').empty?
32
+ hDataQuality[:report] << {
33
+ type: 'DQ_QuantitativeAttributeAccuracy',
34
+ quantitativeResult: [{
35
+ value: xQuantitativeAccuracy.xpath('./attraccv').text
36
+ }]
37
+ }
38
+ end
21
39
 
22
40
  # data quality 2.2 (logic) - logical consistency (required) (not implemented)
23
41
  xLogic = xDataQual.xpath('./logic')
24
- if xLogic.nil?
42
+ if xLogic.empty?
25
43
  hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: data quality logical consistency section is missing'
44
+ else
45
+ logic = xLogic.text
46
+ hDataQuality[:report] << {
47
+ type: 'DQ_ConceptualConsistency',
48
+ qualityMeasure: {
49
+ description: logic
50
+ }
51
+ }
26
52
  end
27
53
 
28
- # data quality 2.3 (complete) - completion report (required) (not implemented)
54
+ # data quality 2.3 (complete) - completion report (required)
29
55
  xComplete = xDataQual.xpath('./complete')
30
- if xComplete.nil?
56
+ if xComplete.empty?
31
57
  hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: data quality completion report section is missing'
58
+ else
59
+ complete = xComplete.text
60
+ hDataQuality[:report] << {
61
+ type: 'DQ_CompletenessOmission',
62
+ descriptiveResult: [{
63
+ statement: complete
64
+ }]
65
+ }
32
66
  end
33
67
 
34
- # data quality 2.4 (position) - positional accuracy (not implemented)
68
+ # data quality 2.4 (position) - positional accuracy
69
+ xPositionalAccuracy = xDataQual.xpath('./posacc')
70
+ unless xPositionalAccuracy.empty?
71
+
72
+ # horizontal positional accuracy
73
+ xHorizontal = xPositionalAccuracy.xpath('./horizpa')
74
+ unless xHorizontal.empty?
75
+
76
+ report = {}
77
+
78
+ unless xHorizontal.xpath('horizpar').empty?
79
+ report[:evaluationMethod] = {
80
+ methodDescription: xHorizontal.xpath('horizpar').text
81
+ }
82
+ end
83
+
84
+ unless xHorizontal.xpath('qhorizpa/horizpae').empty?
85
+ report[:qualityMeasure] = {
86
+ description: xHorizontal.xpath('qhorizpa/horizpae').text
87
+ }
88
+ end
89
+
90
+ unless xHorizontal.xpath('qhorizpa/horizpav').empty?
91
+ report[:quantitativeResult] = [{
92
+ value: [ xHorizontal.xpath('qhorizpa/horizpav').text ]
93
+ }]
94
+ end
95
+
96
+ unless report.empty?
97
+ if report[:qualityMeasure].nil?
98
+ report[:qualityMeasure] = {
99
+ name: ['Horizontal Positional Accuracy Report']
100
+ }
101
+ else
102
+ report[:qualityMeasure][:name] = ['Horizontal Positional Accuracy Report']
103
+ end
104
+
105
+ report[:type] = 'DQ_AbsoluteExternalPositionalAccuracy'
106
+
107
+ hDataQuality[:report] << report
108
+ end
109
+ end
110
+
111
+ # vertical positional accuracy
112
+ xVertical = xPositionalAccuracy.xpath('./vertacc')
113
+ unless xVertical.empty?
114
+
115
+ report = {}
116
+
117
+ unless xVertical.xpath('vertaccr').empty?
118
+ report[:evaluationMethod] = {
119
+ methodDescription: xVertical.xpath('vertaccr').text
120
+ }
121
+ end
122
+
123
+ unless xVertical.xpath('qvertpa/vertacce').empty?
124
+ report[:qualityMeasure] = {
125
+ description: xVertical.xpath('qvertpa/vertacce').text
126
+ }
127
+ end
128
+
129
+ unless xVertical.xpath('qvertpa/vertaccv').empty?
130
+ report[:quantitativeResult] = [{
131
+ value: [ xVertical.xpath('qvertpa/vertaccv').text ]
132
+ }]
133
+ end
134
+
135
+ unless report.empty?
136
+ if report[:qualityMeasure].nil?
137
+ report[:qualityMeasure] = {
138
+ name: ['Vertical Positional Accuracy Report']
139
+ }
140
+ else
141
+ report[:qualityMeasure][:name] = ['Vertical Positional Accuracy Report']
142
+ end
143
+
144
+ report[:type] = 'DQ_AbsoluteExternalPositionalAccuracy'
145
+
146
+ hDataQuality[:report] << report
147
+ end
148
+ end
149
+ end
35
150
 
36
151
  # data quality 2.5 (lineage) - lineage (required)
37
152
  xLineage = xDataQual.xpath('./lineage')
@@ -47,7 +162,7 @@ module ADIWG
47
162
 
48
163
  # data quality 2.6 (cloud) - cloud cover (not implemented)
49
164
 
50
- return hMetadata
165
+ return hDataQuality
51
166
 
52
167
  end
53
168
 
@@ -120,7 +120,7 @@ module ADIWG
120
120
  end
121
121
 
122
122
  # bounding box bio (altunit) - altitude unit of measure
123
- hBbox[:unitsOfAltitude] = xAltitude.xpath('./altunits').text
123
+ hBbox[:unitsOfAltitude] = xAltitude.xpath('./altunit').text
124
124
 
125
125
  end
126
126
 
@@ -0,0 +1,49 @@
1
+ require_relative 'module_scope'
2
+ require_relative 'module_citation'
3
+
4
+ module ADIWG
5
+ module Mdtranslator
6
+ module Readers
7
+ module MdJson
8
+
9
+ module ConformanceResult
10
+
11
+ def self.unpack(hConformanceResult, responseObj, inContext = nil)
12
+
13
+ intMetadataClass = InternalMetadata.new
14
+ intConformanceResult = intMetadataClass.newConformanceResult
15
+
16
+ # dateTime
17
+ if hConformanceResult.has_key?('dateTime')
18
+ intConformanceResult[:dateTime] = hConformanceResult['dateTime']
19
+ end
20
+
21
+ # scope
22
+ if hConformanceResult.has_key?('scope')
23
+ intConformanceResult[:scope] = Scope.unpack(hConformanceResult['scope'], responseObj)
24
+ end
25
+
26
+ #specification
27
+ if hConformanceResult.has_key?('specification')
28
+ intConformanceResult[:specification] = Citation.unpack(hConformanceResult['specification'], responseObj)
29
+ end
30
+
31
+ # explanation
32
+ if hConformanceResult.has_key?('explanation')
33
+ intConformanceResult[:explanation] = hConformanceResult['explanation']
34
+ end
35
+
36
+ # pass
37
+ if hConformanceResult.has_key?('pass')
38
+ intConformanceResult[:pass] = hConformanceResult['pass']
39
+ end
40
+
41
+ return intConformanceResult
42
+ end
43
+
44
+ end
45
+
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,66 @@
1
+ require_relative 'module_scope'
2
+ require_relative 'module_spatialRepresentation'
3
+
4
+ module ADIWG
5
+ module Mdtranslator
6
+ module Readers
7
+ module MdJson
8
+
9
+ module CoverageResult
10
+ def self.unpack(hResult, responseObj, inContext)
11
+
12
+ intMetadataClass = InternalMetadata.new
13
+ intResult = intMetadataClass.newCoverageResult
14
+
15
+ # dateTime
16
+ if hResult.has_key?('dateTime')
17
+ intResult[:dateTime] = hResult['dateTime']
18
+ end
19
+
20
+
21
+ # scope
22
+ if hResult.has_key?('scope')
23
+ intResult[:scope] = Scope.unpack(hResult['scope'], responseObj)
24
+ end
25
+
26
+
27
+ # spatialRepresentationType
28
+ # https://github.com/ISO-TC211/XML/blob/master/standards.iso.org/iso/19115/resources/Codelists/gml/MD_SpatialRepresentationTypeCode.xml
29
+ if hResult.has_key?('spatialRepresentationType')
30
+ intResult[:spatialRepresentationType] = hResult['spatialRepresentationType']
31
+ end
32
+
33
+
34
+ # spatialRepresentation
35
+ if hResult.has_key?('spatialRepresentation')
36
+ intResult[:spatialRepresentation] = SpatialRepresentation.unpack(hResult['spatialRepresentation'], responseObj)
37
+ end
38
+
39
+
40
+ # resultContent
41
+ if hResult.has_key?('resultContent')
42
+ intResult[:resultContent] = hResult['resultContent']
43
+ end
44
+
45
+
46
+ # resourceFormat
47
+ if hResult.has_key?('resourceFormat')
48
+ intResult[:resourceFormat] = hResult['resourceFormat']
49
+ end
50
+
51
+
52
+ # resultFile
53
+ resultFile
54
+ if hResult.has_key?('resultFile')
55
+ intResult[:resultFile] = hResult['resultFile']
56
+ end
57
+
58
+ return intResult
59
+
60
+ end
61
+ end
62
+
63
+ end
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,69 @@
1
+ # unpack dataQuality
2
+ # Reader - ADIwg JSON to internal data structure
3
+
4
+ require_relative 'module_scope'
5
+ require_relative 'module_dataQualityReport'
6
+ require_relative 'module_citation'
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Readers
11
+ module MdJson
12
+
13
+ module DataQuality
14
+
15
+ def self.unpack(hDataQuality, responseObj, inContext = nil)
16
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
17
+
18
+ if hDataQuality.empty?
19
+ @MessagePath.issueWarning(300, responseObj)
20
+ return nil
21
+ end
22
+
23
+ intMetadataClass = InternalMetadata.new
24
+ intDataQuality = intMetadataClass.newDataQuality
25
+
26
+ outContext = 'dataQuality'
27
+
28
+ if hDataQuality.has_key?('scope')
29
+ hObject = hDataQuality['scope']
30
+ unless hObject.empty?
31
+ hReturn = Scope.unpack(hObject, responseObj)
32
+ unless hReturn.nil?
33
+ intDataQuality[:scope] = hReturn
34
+ end
35
+ end
36
+ end
37
+
38
+ if hDataQuality.has_key?('standaloneQualityReport')
39
+ hObject = hDataQuality['standaloneQualityReport']
40
+ unless hObject.empty?
41
+ intDataQuality[:standaloneQualityReport] = {}
42
+ intDataQuality[:standaloneQualityReport][:abstract] = hObject["abstract"]
43
+
44
+ unless hObject["reportRefereence"].nil? || hObject["reportReference"].empty?
45
+ intDataQuality[:standaloneQualityReport][:reportReference] = Citation.unpack(hObject["reportReference"], responseObj, inContext)
46
+ end
47
+ end
48
+ end
49
+
50
+ if hDataQuality.has_key?('report')
51
+ hDataQuality['report'].each do |item|
52
+ report = DataQualityReport.unpack(item, responseObj, inContext)
53
+
54
+ unless report.nil?
55
+ intDataQuality[:report] << report
56
+ end
57
+ end
58
+ end
59
+
60
+ return intDataQuality
61
+
62
+ end
63
+
64
+ end
65
+
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,109 @@
1
+ require_relative 'module_scope'
2
+ require_relative 'module_conformanceResult'
3
+ require_relative 'module_coverageResult'
4
+ require_relative 'module_descriptiveResult'
5
+ require_relative 'module_quantitativeResult'
6
+ require_relative 'module_evaluationMethod'
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Readers
11
+ module MdJson
12
+
13
+ module DataQualityReport
14
+
15
+ def self.unpack(hReport, responseObj, inContext = nil)
16
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
17
+
18
+ outContext = 'Data Quality Report'
19
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
20
+
21
+ if hReport.empty?
22
+ @MessagePath.issueWarning(730, responseObj, inContext)
23
+ return nil
24
+ end
25
+
26
+ intMetadataClass = InternalMetadata.new
27
+ intReport = intMetadataClass.newDataQualityReport
28
+
29
+ intReport[:type] = hReport["type"]
30
+
31
+ if hReport.has_key?('conformanceResult')
32
+ hReport['conformanceResult'].each do |item|
33
+ hReturn = ConformanceResult.unpack(item, responseObj)
34
+
35
+ unless hReturn.nil?
36
+ intReport[:conformanceResult] << hReturn
37
+ end
38
+ end
39
+ end
40
+
41
+ if hReport.has_key?('coverageResult')
42
+ hReport['coverageResult'].each do |item|
43
+ hReturn = CoverageResult.unpack(item, responseObj)
44
+
45
+ unless hReturn.nil?
46
+ intReport[:coverageResult] << hReturn
47
+ end
48
+ end
49
+ end
50
+
51
+ if hReport.has_key?('descriptiveResult')
52
+ hReport['descriptiveResult'].each do |item|
53
+ hReturn = DescriptiveResult.unpack(item, responseObj)
54
+
55
+ unless hReturn.nil?
56
+ intReport[:descriptiveResult] << hReturn
57
+
58
+ end
59
+ end
60
+ end
61
+
62
+ if hReport.has_key?('evaluationMethod')
63
+ hReturn = EvaluationMethod.unpack(hReport['evaluationMethod'], responseObj)
64
+
65
+ unless hReturn.nil?
66
+ intReport[:evaluationMethod] = hReturn
67
+ end
68
+ end
69
+
70
+ if hReport.has_key?('qualityMeasure')
71
+ qualityMeasure = hReport['qualityMeasure']
72
+ identifier = qualityMeasure['identifier']
73
+
74
+ intReport[:qualityMeasure] = {}
75
+
76
+ if identifier
77
+ intReport[:qualityMeasure][:identifier] = {
78
+ identifier: identifier['identifier'],
79
+ namespace: identifier['namespace'],
80
+ version: identifier['version'],
81
+ description: identifier['description']
82
+ }
83
+ end
84
+
85
+ if qualityMeasure
86
+ intReport[:qualityMeasure][:name] = qualityMeasure['name']
87
+ intReport[:qualityMeasure][:description] = qualityMeasure['description']
88
+ end
89
+ end
90
+
91
+ if hReport.has_key?('quantitativeResult')
92
+ hReport['quantitativeResult'].each do |item|
93
+ hReturn = QuantitativeResult.unpack(item, responseObj)
94
+
95
+ unless hReturn.nil?
96
+ intReport[:quantitativeResult] << hReturn
97
+ end
98
+ end
99
+ end
100
+
101
+
102
+ return intReport
103
+ end
104
+ end
105
+
106
+ end
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,40 @@
1
+ require_relative 'module_scope'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Readers
6
+ module MdJson
7
+
8
+ module DescriptiveResult
9
+ def self.unpack(hResult, responseObj, inContext = nil)
10
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
11
+
12
+ if hResult.empty?
13
+ @MessagePath.issueWarning(80, responseObj, inContext)
14
+ return nil
15
+ end
16
+
17
+ intMetadataClass = InternalMetadata.new
18
+ intResult = intMetadataClass.newDescriptiveResult
19
+
20
+ if hResult.has_key?('dateTime')
21
+ intResult[:dateTime] = hResult['dateTime']
22
+ end
23
+
24
+ if hResult.has_key?('scope')
25
+ intResult[:scope] = Scope.unpack(hResult['scope'], responseObj)
26
+ end
27
+
28
+ if hResult.has_key?('statement')
29
+ intResult[:statement] = hResult['statement']
30
+ end
31
+
32
+ return intResult
33
+ end
34
+ end
35
+
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -47,14 +47,6 @@ module ADIWG
47
47
  end
48
48
  end
49
49
 
50
- # there is a typo in mdEditor for liabilityStatement, handle this edge case
51
- # https://github.com/adiwg/mdEditor/blob/f94770686df07ef76aa111f8f9734b32bbad7f21/app/pods/components/object/md-distribution/template.hbs#L22
52
- if (intDistribution[:liabilityStatement].nil? || intDistribution.empty?) && hDistribution.has_key?('liablityStatement')
53
- unless hDistribution['liablityStatement'] == ''
54
- intDistribution[:liabilityStatement] = hDistribution['liablityStatement']
55
- end
56
- end
57
-
58
50
  # distribution - distributor [distributor]
59
51
  if hDistribution.has_key?('distributor')
60
52
  aItems = hDistribution['distributor']