adiwg-mdtranslator 2.19.0.pre.beta.25 → 2.20.0.pre.beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/DCAT-US.md +67 -0
  4. data/Gemfile.lock +41 -31
  5. data/README.md +21 -0
  6. data/Rakefile +1 -0
  7. data/adiwg-mdtranslator.gemspec +2 -2
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +59 -103
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +0 -5
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +0 -4
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +0 -7
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_descriptiveResult.rb +0 -4
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_quantitativeResult.rb +0 -4
  14. data/lib/adiwg/mdtranslator/version.rb +1 -1
  15. data/lib/adiwg/mdtranslator/writers/dcat_us/dcat_us_writer.rb +98 -0
  16. data/lib/adiwg/mdtranslator/writers/dcat_us/readme.md +10 -0
  17. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_level.rb +55 -0
  18. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_url.rb +17 -0
  19. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_accrualPeriodicity.rb +45 -0
  20. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_bureau_code.rb +33 -0
  21. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_contact_point.rb +29 -0
  22. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_dcat_us.rb +104 -0
  23. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by.rb +29 -0
  24. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by_type.rb +33 -0
  25. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_description.rb +19 -0
  26. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_distribution.rb +59 -0
  27. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_download_url.rb +17 -0
  28. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_identifier.rb +29 -0
  29. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_is_part_of.rb +27 -0
  30. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_issued.rb +19 -0
  31. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_keyword.rb +19 -0
  32. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_landing_page.rb +27 -0
  33. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_language.rb +23 -0
  34. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_license.rb +18 -0
  35. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_media_type.rb +17 -0
  36. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_modified.rb +29 -0
  37. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_primaryITInvestmentUII.rb +19 -0
  38. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_program_code.rb +33 -0
  39. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_publisher.rb +74 -0
  40. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_references.rb +50 -0
  41. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_rights.rb +32 -0
  42. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_spatial.rb +32 -0
  43. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_system_of_records.rb +28 -0
  44. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_temporal.rb +40 -0
  45. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_theme.rb +28 -0
  46. data/lib/adiwg/mdtranslator/writers/dcat_us/version.rb +14 -0
  47. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataQuality.rb +31 -101
  48. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQuality.rb +1 -17
  49. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQualityReport.rb +0 -28
  50. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataIdentification.rb +0 -29
  51. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataQualityReport.rb +1 -1
  52. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_gcoDateTime.rb +1 -10
  53. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb +5 -6
  54. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb +0 -1
  55. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +0 -1
  56. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_onlineResource.rb +1 -1
  57. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_quantitativeResult.rb +5 -6
  58. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +1 -1
  59. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +26 -9
  60. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQuality.rb +1 -1
  61. data/lib/adiwg/mdtranslator_cli.rb +1 -1
  62. metadata +39 -6
@@ -0,0 +1,29 @@
1
+ module ADIWG
2
+ module Mdtranslator
3
+ module Writers
4
+ module Dcat_us
5
+ module Modified
6
+
7
+ def self.build(intObj)
8
+ resourceInfo = intObj[:metadata][:resourceInfo]
9
+ citation = resourceInfo[:citation]
10
+ dates = citation[:dates]
11
+
12
+ mostRecentDate = nil
13
+
14
+ dates.each do |date|
15
+ if date[:dateType] == "lastUpdated" || date[:dateType] == "lastRevised" || date[:dateType] == "revision"
16
+ if mostRecentDate.nil? || date[:date] > mostRecentDate
17
+ mostRecentDate = date[:date]
18
+ end
19
+ end
20
+ end
21
+
22
+ return mostRecentDate
23
+ end
24
+
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ require 'jbuilder'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Writers
6
+ module Dcat_us
7
+ module PrimaryITInvestmentUII
8
+
9
+ def self.build(intObj)
10
+ primaryITInvestmentUII = intObj[:metadata][:metadataInfo][:metadataIdentifier][:identifier]
11
+
12
+ primaryITInvestmentUII ? primaryITInvestmentUII : nil
13
+ end
14
+
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,33 @@
1
+ require 'jbuilder'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Writers
6
+ module Dcat_us
7
+ module ProgramCode
8
+
9
+ def self.build(intObj)
10
+
11
+ responsibleParties = intObj[:metadata][:resourceInfo][:citation][:responsibleParties]
12
+ contacts = []
13
+ responsibleParties.each do |party|
14
+ contactId = party[:parties][0][:contactId]
15
+ contacts << Dcat_us.get_contact_by_id(contactId)
16
+ end
17
+
18
+ programContacts = contacts&.select { |contact| contact[:externalIdentifier].any? { |id| id[:namespace] == 'programCode'} }
19
+
20
+ programsCodes = []
21
+ programContacts.each do |contact|
22
+ programCode = contact[:externalIdentifier].find { |id| id[:namespace] == 'programCode' }
23
+ programsCodes << programCode[:identifier]
24
+ end
25
+
26
+ return programsCodes
27
+ end
28
+
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,74 @@
1
+ module ADIWG
2
+ module Mdtranslator
3
+ module Writers
4
+ module Dcat_us
5
+ module Publisher
6
+ def self.build(intObj)
7
+ contacts = intObj.dig(:contacts)
8
+ metadata = intObj.dig(:metadata)
9
+ responsible_parties = metadata&.dig(:resourceInfo, :citation, :responsibleParties)
10
+ resource_distributions = metadata&.dig(:distributorInfo)
11
+
12
+ publisher = find_publisher(responsible_parties) || find_distributions_publisher(intObj)
13
+
14
+ return if publisher.nil?
15
+
16
+ name, org_name = extract_names(publisher, contacts)
17
+
18
+ return if name.nil?
19
+
20
+ build_json(name, org_name)
21
+ end
22
+
23
+ private
24
+
25
+ def self.find_publisher(responsible_parties)
26
+ responsible_parties&.detect do |party|
27
+ party[:roleName] == 'publisher' && party.dig(:parties)&.first&.dig(:contactType) == 'organization'
28
+ end
29
+ end
30
+
31
+ def self.find_distributions_publisher(intObj)
32
+ distributor_info = intObj.dig(:metadata, :distributorInfo) || []
33
+ distributor_info.each do |distribution|
34
+ distributors = distribution[:distributor] || []
35
+ distributors.each do |dist|
36
+ contact_type = dist.dig(:contact, :parties, 0, :contactType)
37
+ return dist[:contact] if contact_type == 'organization'
38
+ end
39
+ end
40
+ nil
41
+ end
42
+
43
+ def self.extract_names(publisher, contacts)
44
+ contact_id = publisher.dig(:parties)&.first&.dig(:contactId) || publisher[:contactId]
45
+ related_contact = contacts&.detect { |contact| contact[:contactId] == contact_id }
46
+ org_name = nil
47
+ if related_contact
48
+ member_of_org_ids = related_contact[:memberOfOrgs]
49
+ member_of_orgs = contacts.select { |contact| member_of_org_ids&.include?(contact[:contactId]) && contact[:isOrganization] }
50
+ org_name = member_of_orgs.first&.dig(:name)
51
+ end
52
+ name = publisher.dig(:parties)&.first&.dig(:contactName) || publisher[:contactName]
53
+ [name, org_name]
54
+ end
55
+
56
+ def self.build_json(name, org_name)
57
+ Jbuilder.new do |json|
58
+ json.set!('@type', 'org:Organization')
59
+ json.set!('name', name)
60
+
61
+ if org_name
62
+ json.subOrganizationOf do |json_sub|
63
+ json_sub.set!('@type', 'org:Organization')
64
+ json_sub.set!('name', org_name)
65
+ end
66
+ end
67
+ end
68
+ end
69
+
70
+ end
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,50 @@
1
+ require 'jbuilder'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Writers
6
+ module Dcat_us
7
+ module References
8
+
9
+ def self.build(intObj)
10
+ metadata = intObj.dig(:metadata)
11
+ associated_resources = metadata&.dig(:associatedResources)
12
+ additional_documents = metadata&.dig(:additionalDocuments)
13
+ uris = []
14
+
15
+ if associated_resources
16
+ associated_resources.each do |associated|
17
+ citation = associated.dig(:resourceCitation)
18
+ online_resources = citation&.dig(:onlineResources)
19
+ next unless online_resources
20
+
21
+ online_resources.each do |online|
22
+ uri = online.dig(:olResURI)
23
+ uris << uri if uri
24
+ end
25
+ end
26
+ end
27
+
28
+ if additional_documents
29
+ additional_documents.each do |additional|
30
+ citations = additional&.dig(:citation) || []
31
+ citations.each do |citation|
32
+ online_resources = citation&.dig(:onlineResources)
33
+ next unless online_resources
34
+
35
+ online_resources.each do |online|
36
+ uri = online.dig(:olResURI)
37
+ uris << uri if uri
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ uris.join(',')
44
+ end
45
+
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,32 @@
1
+ module ADIWG
2
+ module Mdtranslator
3
+ module Writers
4
+ module Dcat_us
5
+ module Rights
6
+
7
+ def self.build(intObj, accessLevel)
8
+ resourceInfo = intObj.dig(:metadata, :resourceInfo)
9
+ constraints = resourceInfo&.dig(:constraints)
10
+
11
+ if accessLevel && ["restricted public", "non-public"].include?(accessLevel)
12
+ constraints&.each do |constraint|
13
+ if constraint[:type] == "use"
14
+ statement = constraint.dig(:releasability, :statement)
15
+ disseminationConstraints = constraint.dig(:releasability, :disseminationConstraint)
16
+
17
+ if statement && disseminationConstraints
18
+ combinedConstraints = disseminationConstraints.join(" ")
19
+ return "#{statement} #{combinedConstraints}".strip
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ nil
26
+ end
27
+
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ module ADIWG
2
+ module Mdtranslator
3
+ module Writers
4
+ module Dcat_us
5
+ module Spatial
6
+
7
+ def self.build(intObj)
8
+ resourceInfo = intObj.dig(:metadata, :resourceInfo)
9
+ extent = resourceInfo&.dig(:extents, 0)
10
+ geographicExtent = extent&.dig(:geographicExtents, 0)
11
+ boundingBox = geographicExtent&.dig(:boundingBox)
12
+
13
+ if boundingBox
14
+ return [
15
+ boundingBox[:eastLongitude],
16
+ boundingBox[:southLatitude],
17
+ boundingBox[:westLongitude],
18
+ boundingBox[:northLatitude]
19
+ ].join(',')
20
+ elsif geographicExtent&.dig(:geographicElement, 0, :type) == 'point'
21
+ point = geographicExtent.dig(:geographicElement, 0, :coordinate)
22
+ return "#{point[1]},#{point[0]}" if point&.length == 2
23
+ end
24
+
25
+ nil
26
+ end
27
+
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,28 @@
1
+ require 'jbuilder'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Writers
6
+ module Dcat_us
7
+ module SystemOfRecords
8
+
9
+ def self.build(intObj)
10
+ associatedResources = intObj.dig(:metadata, :associatedResources)
11
+
12
+ return nil if associatedResources.nil?
13
+
14
+ associatedResources.each do |resource|
15
+ if resource[:initiativeType] == 'sorn'
16
+ onlineResources = resource.dig(:resourceCitation, :onlineResources)
17
+ return onlineResources.first[:olResURI] if onlineResources&.first&.has_key?(:olResURI)
18
+ end
19
+ end
20
+
21
+ return nil
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,40 @@
1
+ module ADIWG
2
+ module Mdtranslator
3
+ module Writers
4
+ module Dcat_us
5
+ module Temporal
6
+
7
+ def self.build(intObj)
8
+ resourceInfo = intObj.dig(:metadata, :resourceInfo)
9
+ extent = resourceInfo&.dig(:extents, 0)
10
+ temporalExtents = extent&.dig(:temporalExtents)
11
+
12
+ if temporalExtents
13
+ temporalExtents.each do |temporalExtent|
14
+ timePeriod = temporalExtent&.dig(:timePeriod)
15
+ next unless timePeriod
16
+
17
+ startDateHash = timePeriod[:startDateTime]
18
+ endDateHash = timePeriod[:endDateTime]
19
+
20
+ startDate = startDateHash&.dig(:dateTime)
21
+ endDate = endDateHash&.dig(:dateTime)
22
+
23
+ if startDate && endDate
24
+ return "#{startDate}/#{endDate}"
25
+ elsif startDate
26
+ return startDate
27
+ elsif endDate
28
+ return endDate
29
+ end
30
+ end
31
+ end
32
+
33
+ nil
34
+ end
35
+
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,28 @@
1
+ require 'jbuilder'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Writers
6
+ module Dcat_us
7
+ module Theme
8
+
9
+ def self.build(intObj)
10
+ resourceInfo = intObj[:metadata][:resourceInfo]
11
+ keywords_str = []
12
+
13
+ resourceInfo[:keywords].each do |keyword_group|
14
+ if keyword_group[:thesaurus][:title] == "ISO Topic Categories"
15
+ keyword_group[:keywords].each do |keyword_obj|
16
+ keywords_str << keyword_obj[:keyword]
17
+ end
18
+ end
19
+ end
20
+
21
+ return keywords_str.join(" ")
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,14 @@
1
+ # dcat_us version history
2
+ # Johnathan Aspinwall 2023-06-22 created for mdJson/mdTranslator 2.0
3
+
4
+ module ADIWG
5
+ module Mdtranslator
6
+ module Writers
7
+ module Dcat_us
8
+
9
+ VERSION = '1.0.0'
10
+
11
+ end
12
+ end
13
+ end
14
+ end
@@ -28,147 +28,77 @@ module ADIWG
28
28
  hDataQuality = intObj.dig(:metadata, :dataQuality, 0)
29
29
 
30
30
  if hDataQuality && hDataQuality[:report]
31
- # data quality 2.1 (attracc) - Attribute Accuracy
32
- attribute_accuracy_report = hDataQuality[:report].find do |report|
33
- report[:type] == 'DQ_NonQuantitativeAttributeCorrectness' &&
31
+ # data quality 2.1 (attracc) - attribute accuracy (not implemented)
32
+ attribute_completeness_report = hDataQuality[:report].find do |report|
33
+ report[:type] == 'NonQuantitativeAttributeCorrectness' &&
34
34
  !report.dig(:descriptiveResult, 0, :statement).nil?
35
35
  end
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
36
+
37
+ if attribute_completeness_report
46
38
  @xml.tag!('attracc') do
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
39
+ @xml.tag!('attraccr', attribute_completeness_report[:descriptiveResult][0][:statement])
64
40
  end
65
41
  elsif @hResponseObj[:writerShowTags]
66
42
  @xml.tag!('attracc', 'Not Reported')
67
43
  end
68
44
 
69
- # data quality 2.2 (logic) - logical consistency (required)
45
+ # data quality 2.2 (logic) - logical consistency (not implemented) (required)
70
46
  logic_report = hDataQuality[:report].find do |report|
71
- report[:type] == 'DQ_ConceptualConsistency' &&
72
- !report.dig(:descriptiveResult, 0, :statement).nil?
47
+ report[:type] == 'ConceptualConsistency' &&
48
+ !report.dig(:qualityMeasure, :description).nil?
73
49
  end
74
- if logic = logic_report&.dig(:descriptiveResult, 0, :statement)
50
+
51
+ if logic = logic_report&.dig(:qualityMeasure, :description)
75
52
  @xml.tag!('logic', logic)
76
53
  else
77
54
  @xml.tag!('logic', 'Not Reported')
78
55
  end
79
56
 
80
- # data quality 2.3 (complete) - completion report (required)
81
- omission_report = hDataQuality[:report].find do |report|
82
- report[:type] == 'DQ_CompletenessOmission' &&
83
- !report.dig(:descriptiveResult, 0, :statement).nil?
84
- end
85
- omission = omission_report&.dig(:descriptiveResult, 0, :statement)
86
- commission_report = hDataQuality[:report].find do |report|
87
- report[:type] == 'DQ_CompletenessCommission' &&
57
+ # data quality 2.3 (complete) - completion report (not implemented) (required)
58
+ completeness_report = hDataQuality[:report].find do |report|
59
+ report[:type] == 'Omission' &&
88
60
  !report.dig(:descriptiveResult, 0, :statement).nil?
89
61
  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 != ''
62
+
63
+ if complete = completeness_report&.dig(:descriptiveResult, 0, :statement)
103
64
  @xml.tag!('complete', complete)
104
65
  else
105
66
  @xml.tag!('complete', 'Not Reported')
106
67
  end
107
68
 
108
- # data quality 2.4 (position) - Positional Accuracy
69
+ # data quality 2.4 (position) - positional accuracy
70
+
109
71
 
110
- # data quality 2.4.1 (horizpa) - Horizontal Positional Accuracy
111
72
  horizontal_positional_accuracy_report = hDataQuality[:report].find do |report|
112
- report[:type] == 'DQ_AbsoluteExternalPositionalAccuracy' &&
113
- report.dig(:descriptiveResult, 0, :name) == 'Horizontal Positional Accuracy Report' &&
114
- !report.dig(:descriptiveResult, 0, :statement).nil?
73
+ report[:type] == 'AbsoluteExternalPositionalAccuracy' &&
74
+ report.dig(:qualityMeasure, :nameOfMeasure)&.any? { |name|
75
+ name == 'Horizontal Positional Accuracy Report'
76
+ }
115
77
  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)
119
78
 
120
- # data quality 2.4.2 (vertacc) - Vertical Positional Accuracy
79
+ horizpar = horizontal_positional_accuracy_report&.dig(:evaluationMethod, :methodDescription)
80
+
81
+
121
82
  vertical_positional_accuracy_report = hDataQuality[:report].find do |report|
122
- report[:type] == 'DQ_AbsoluteExternalPositionalAccuracy' &&
123
- report.dig(:descriptiveResult, 0, :name) == 'Vertical Positional Accuracy Report' &&
124
- !report.dig(:descriptiveResult, 0, :statement).nil?
83
+ report[:type] == 'AbsoluteExternalPositionalAccuracy' &&
84
+ report.dig(:qualityMeasure, :nameOfMeasure)&.any? { |name|
85
+ name == 'Vertical Positional Accuracy Report'
86
+ }
125
87
  end
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)
88
+
89
+ vertaccr = vertical_positional_accuracy_report&.dig(:evaluationMethod, :methodDescription)
129
90
 
130
91
  if horizpar || vertaccr
131
- # data quality 2.4 (posacc) - Positional Accuracy
132
92
  @xml.tag!('posacc') do
133
93
  if horizpar
134
- # data quality 2.4.1 (horizpa) - Horizontal Positional Accuracy
135
94
  @xml.tag!('horizpa') do
136
- # data quality 2.4.1.1 (horizpar) - Horizontal Positional Accuracy Report
137
95
  @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
151
96
  end
152
97
  end
153
98
 
154
99
  if vertaccr
155
- # data quality 2.4.2 (vertacc) - Vertical Positional Accuracy
156
100
  @xml.tag!('vertacc') do
157
- # data quality 2.4.2.1 (vertaccr) - Vertical Positional Accuracy Report
158
101
  @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
172
102
  end
173
103
  end
174
104
  end
@@ -16,22 +16,6 @@ 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
-
35
19
  # scope
36
20
  unless hDataQuality[:scope].empty?
37
21
  @html.section(:class => 'block') do
@@ -80,7 +64,7 @@ module ADIWG
80
64
  hDataQuality[:report].each do |report|
81
65
  @html.section(:class => 'block') do
82
66
  @html.details do
83
- @html.summary(report[:type], {'class' => 'h5'})
67
+ @html.summary('Report', {'class' => 'h5'})
84
68
  dataQualityReportClass.writeHtml(report)
85
69
  end
86
70
  end
@@ -185,13 +185,6 @@ module ADIWG
185
185
  end
186
186
  end
187
187
  end
188
-
189
- # Name
190
- unless result[:name].nil?
191
- @html.em('Name: ')
192
- @html.text!(result[:name])
193
- @html.br
194
- end
195
188
 
196
189
  # Specification (citation)
197
190
  unless result[:specification].empty?
@@ -249,13 +242,6 @@ module ADIWG
249
242
  end
250
243
  end
251
244
 
252
- # Name
253
- unless result[:name].nil?
254
- @html.em('Name: ')
255
- @html.text!(result[:name])
256
- @html.br
257
- end
258
-
259
245
  # SpatialRepresentationType
260
246
  unless result[:spatialRepresentationType].nil?
261
247
  @html.em('Spatial Representation Type: ')
@@ -331,13 +317,6 @@ module ADIWG
331
317
  end
332
318
  end
333
319
  end
334
-
335
- # Name
336
- unless result[:name].nil?
337
- @html.em('Name: ')
338
- @html.text!(result[:name])
339
- @html.br
340
- end
341
320
 
342
321
  # Statement
343
322
  unless result[:statement].nil?
@@ -373,13 +352,6 @@ module ADIWG
373
352
  end
374
353
  end
375
354
  end
376
-
377
- # Name
378
- unless result[:name].nil?
379
- @html.em('Name: ')
380
- @html.text!(result[:name])
381
- @html.br
382
- end
383
355
 
384
356
  # Value
385
357
  unless result[:values].empty?