adiwg-mdtranslator 2.20.0.pre.beta.3 → 2.21.0.pre.beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/Gemfile.lock +12 -10
  4. data/README.md +0 -21
  5. data/Rakefile +0 -1
  6. data/adiwg-mdtranslator.gemspec +2 -2
  7. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +45 -7
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +103 -59
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_acquisition.rb +133 -0
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +5 -0
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +4 -0
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +7 -0
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_descriptiveResult.rb +4 -0
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_environment.rb +47 -0
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_event.rb +88 -0
  16. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrument.rb +73 -0
  17. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEvent.rb +77 -0
  18. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEventList.rb +62 -0
  19. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +11 -0
  20. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_objective.rb +104 -0
  21. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_operation.rb +119 -0
  22. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_pass.rb +53 -0
  23. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_plan.rb +80 -0
  24. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_platform.rb +87 -0
  25. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_quantitativeResult.rb +4 -0
  26. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requestedDate.rb +51 -0
  27. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requirement.rb +98 -0
  28. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_revision.rb +50 -0
  29. data/lib/adiwg/mdtranslator/version.rb +1 -1
  30. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataQuality.rb +101 -31
  31. data/lib/adiwg/mdtranslator/writers/html/sections/html_acquisition.rb +199 -0
  32. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +19 -0
  33. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQuality.rb +17 -1
  34. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQualityReport.rb +28 -0
  35. data/lib/adiwg/mdtranslator/writers/html/sections/html_environment.rb +58 -0
  36. data/lib/adiwg/mdtranslator/writers/html/sections/html_event.rb +121 -0
  37. data/lib/adiwg/mdtranslator/writers/html/sections/html_instrument.rb +98 -0
  38. data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEvent.rb +84 -0
  39. data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEventList.rb +90 -0
  40. data/lib/adiwg/mdtranslator/writers/html/sections/html_objective.rb +155 -0
  41. data/lib/adiwg/mdtranslator/writers/html/sections/html_operation.rb +178 -0
  42. data/lib/adiwg/mdtranslator/writers/html/sections/html_pass.rb +72 -0
  43. data/lib/adiwg/mdtranslator/writers/html/sections/html_plan.rb +93 -0
  44. data/lib/adiwg/mdtranslator/writers/html/sections/html_platform.rb +117 -0
  45. data/lib/adiwg/mdtranslator/writers/html/sections/html_requestedDate.rb +33 -0
  46. data/lib/adiwg/mdtranslator/writers/html/sections/html_requirement.rb +139 -0
  47. data/lib/adiwg/mdtranslator/writers/html/sections/html_revision.rb +55 -0
  48. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataIdentification.rb +29 -0
  49. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataQualityReport.rb +1 -1
  50. data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_gcoDateTime.rb +10 -1
  51. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_acquisition.rb +42 -0
  52. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb +6 -5
  53. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb +1 -0
  54. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +1 -0
  55. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_environment.rb +28 -0
  56. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_event.rb +37 -0
  57. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrument.rb +35 -0
  58. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEvent.rb +30 -0
  59. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEventList.rb +32 -0
  60. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +2 -0
  61. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_objective.rb +37 -0
  62. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_onlineResource.rb +1 -1
  63. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_operation.rb +34 -0
  64. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_pass.rb +30 -0
  65. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_plan.rb +32 -0
  66. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_platform.rb +35 -0
  67. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_quantitativeResult.rb +6 -5
  68. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requestedDate.rb +26 -0
  69. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requirement.rb +36 -0
  70. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +1 -1
  71. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_revision.rb +28 -0
  72. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +9 -26
  73. data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQuality.rb +1 -1
  74. data/lib/adiwg/mdtranslator_cli.rb +1 -1
  75. metadata +48 -39
  76. data/DCAT-US.md +0 -67
  77. data/lib/adiwg/mdtranslator/writers/dcat_us/dcat_us_writer.rb +0 -98
  78. data/lib/adiwg/mdtranslator/writers/dcat_us/readme.md +0 -10
  79. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_level.rb +0 -55
  80. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_url.rb +0 -17
  81. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_accrualPeriodicity.rb +0 -45
  82. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_bureau_code.rb +0 -33
  83. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_contact_point.rb +0 -29
  84. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_dcat_us.rb +0 -104
  85. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by.rb +0 -29
  86. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by_type.rb +0 -33
  87. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_description.rb +0 -19
  88. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_distribution.rb +0 -59
  89. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_download_url.rb +0 -17
  90. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_identifier.rb +0 -29
  91. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_is_part_of.rb +0 -27
  92. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_issued.rb +0 -19
  93. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_keyword.rb +0 -19
  94. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_landing_page.rb +0 -27
  95. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_language.rb +0 -23
  96. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_license.rb +0 -18
  97. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_media_type.rb +0 -17
  98. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_modified.rb +0 -29
  99. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_primaryITInvestmentUII.rb +0 -19
  100. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_program_code.rb +0 -33
  101. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_publisher.rb +0 -74
  102. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_references.rb +0 -50
  103. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_rights.rb +0 -32
  104. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_spatial.rb +0 -32
  105. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_system_of_records.rb +0 -28
  106. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_temporal.rb +0 -40
  107. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_theme.rb +0 -28
  108. data/lib/adiwg/mdtranslator/writers/dcat_us/version.rb +0 -14
@@ -0,0 +1,117 @@
1
+ require_relative 'html_identifier'
2
+ require_relative 'html_citation'
3
+ require_relative 'html_responsibility'
4
+ require_relative 'html_instrument'
5
+ require_relative 'html_instrumentationEventList'
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module Html
11
+ class Html_Platform
12
+ def initialize(html)
13
+ @html = html
14
+ end
15
+
16
+ def writeHtml(hPlatform)
17
+ identifierClass = Html_Identifier.new(@html)
18
+ citationClass = Html_Citation.new(@html)
19
+ responsibilityClass = Html_Responsibility.new(@html)
20
+ instrumentClass = Html_Instrument.new(@html)
21
+ instrumentationEventListClass = Html_InstrumentationEventList.new(@html)
22
+
23
+ # platformId
24
+ unless hPlatform[:platformId].nil?
25
+ @html.em('Platform ID: ')
26
+ @html.text!(hPlatform[:platformId])
27
+ @html.br
28
+ end
29
+
30
+ # citation
31
+ unless hPlatform[:citation].empty?
32
+ @html.section(:class => 'block') do
33
+ @html.details do
34
+ @html.summary('Citation', {'class' => 'h4'})
35
+ @html.section(:class => 'block') do
36
+ citationClass.writeHtml(hPlatform[:citation])
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ # identifier
43
+ unless hPlatform[:identifier].empty?
44
+ @html.section(:class => 'block') do
45
+ @html.details do
46
+ @html.summary('Identifier', {'class' => 'h4'})
47
+ @html.section(:class => 'block') do
48
+ identifierClass.writeHtml(hPlatform[:identifier])
49
+ end
50
+ end
51
+ end
52
+ end
53
+
54
+ # description
55
+ unless hPlatform[:description].nil?
56
+ @html.em('Description: ')
57
+ @html.text!(hPlatform[:description])
58
+ @html.br
59
+ end
60
+
61
+ # sponsor
62
+ unless hPlatform[:sponsors].empty?
63
+ @html.section(:class => 'block') do
64
+ @html.details do
65
+ @html.summary('Sponsors', {'class' => 'h4'})
66
+ hPlatform[:sponsors].each do |responsibility|
67
+ @html.section(:class => 'block') do
68
+ @html.details do
69
+ @html.summary('Responsibility', {'class' => 'h5'})
70
+ responsibilityClass.writeHtml(responsibility)
71
+ end
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
77
+
78
+ # instrument
79
+ unless hPlatform[:instruments].empty?
80
+ @html.section(:class => 'block') do
81
+ @html.details do
82
+ @html.summary('Instruments', {'class' => 'h4'})
83
+ hPlatform[:instruments].each do |instrument|
84
+ @html.section(:class => 'block') do
85
+ @html.details do
86
+ @html.summary('Instrument', {'class' => 'h5'})
87
+ instrumentClass.writeHtml(instrument)
88
+ end
89
+ end
90
+ end
91
+ end
92
+ end
93
+ end
94
+
95
+ # history
96
+ unless hPlatform[:history].empty?
97
+ @html.section(:class => 'block') do
98
+ @html.details do
99
+ @html.summary('History', {'class' => 'h4'})
100
+ hPlatform[:history].each do |instrumentationEventList|
101
+ @html.section(:class => 'block') do
102
+ @html.details do
103
+ @html.summary('Instrumentation Event List', {'class' => 'h5'})
104
+ instrumentationEventListClass.writeHtml(instrumentationEventList)
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
110
+ end
111
+
112
+ end
113
+ end
114
+ end
115
+ end
116
+ end
117
+ end
@@ -0,0 +1,33 @@
1
+ require_relative 'html_datetime'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Writers
6
+ module Html
7
+ class Html_RequestedDate
8
+ def initialize(html)
9
+ @html = html
10
+ end
11
+
12
+ def writeHtml(hRequestedDate)
13
+ datetimeClass = Html_Datetime.new(@html)
14
+
15
+ # requestedDateOfCollection
16
+ unless hRequestedDate[:requestedDateOfCollection].empty?
17
+ @html.em('Requested Date of Collection: ')
18
+ @html.text!(hRequestedDate[:requestedDateOfCollection][:dateTime].to_s)
19
+ @html.br
20
+ end
21
+
22
+ # latestAcceptableDate
23
+ unless hRequestedDate[:latestAcceptableDate].empty?
24
+ @html.em('Latest Acceptable Date: ')
25
+ @html.text!(hRequestedDate[:latestAcceptableDate][:dateTime].to_s)
26
+ end
27
+
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,139 @@
1
+ require_relative 'html_citation'
2
+ require_relative 'html_identifier'
3
+ require_relative 'html_responsibility'
4
+ require_relative 'html_requestedDate'
5
+ require_relative 'html_date'
6
+ require_relative 'html_plan'
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Writers
11
+ module Html
12
+ class Html_Requirement
13
+ def initialize(html)
14
+ @html = html
15
+ end
16
+
17
+ def writeHtml(hRequirement)
18
+ citationClass = Html_Citation.new(@html)
19
+ identifierClass = Html_Identifier.new(@html)
20
+ responsibilityClass = Html_Responsibility.new(@html)
21
+ requestedDateClass = Html_RequestedDate.new(@html)
22
+ dateClass = Html_Date.new(@html)
23
+ planClass = Html_Plan.new(@html)
24
+
25
+ # requirementId
26
+ unless hRequirement[:requirementId].nil?
27
+ @html.em('Requirement ID: ')
28
+ @html.text!(hRequirement[:requirementId])
29
+ @html.br
30
+ end
31
+
32
+ # citation
33
+ unless hRequirement[:citation].empty?
34
+ @html.section(:class => 'block') do
35
+ @html.details do
36
+ @html.summary('Citation', {'class' => 'h4'})
37
+ @html.section(:class => 'block') do
38
+ citationClass.writeHtml(hRequirement[:citation])
39
+ end
40
+ end
41
+ end
42
+ end
43
+
44
+ # identifier
45
+ unless hRequirement[:identifier].empty?
46
+ @html.section(:class => 'block') do
47
+ @html.details do
48
+ @html.summary('Identifier ', {'class' => 'h4'})
49
+ @html.section(:class => 'block') do
50
+ identifierClass.writeHtml(hRequirement[:identifier])
51
+ end
52
+ end
53
+ end
54
+ end
55
+
56
+ # requestor
57
+ unless hRequirement[:requestors].empty?
58
+ @html.section(:class => 'block') do
59
+ @html.details do
60
+ @html.summary('Requestors', {'class' => 'h4'})
61
+ hRequirement[:requestors].each do |requestor|
62
+ @html.section(:class => 'block') do
63
+ @html.details do
64
+ @html.summary('Requestor', {'class' => 'h5'})
65
+ operationClass.writeHtml(requestor)
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+
73
+ # recipient
74
+ unless hRequirement[:recipients].empty?
75
+ @html.section(:class => 'block') do
76
+ @html.details do
77
+ @html.summary('Recipients', {'class' => 'h4'})
78
+ hRequirement[:recipients].each do |recipient|
79
+ @html.section(:class => 'block') do
80
+ @html.details do
81
+ @html.summary('Recipient', {'class' => 'h5'})
82
+ operationClass.writeHtml(recipient)
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ end
89
+
90
+ # priority
91
+ unless hRequirement[:priority].nil?
92
+ @html.em('Priority: ')
93
+ @html.text!(hRequirement[:priority])
94
+ @html.br
95
+ end
96
+
97
+ # requested date
98
+ unless hRequirement[:requestedDate].empty?
99
+ @html.section(:class => 'block') do
100
+ @html.details do
101
+ @html.summary('Requested Date ', {'class' => 'h4'})
102
+ @html.section(:class => 'block') do
103
+ requestedDateClass.writeHtml(hRequirement[:requestedDate])
104
+ end
105
+ end
106
+ end
107
+ end
108
+
109
+ # expiry date
110
+ unless hRequirement[:expiryDate].nil?
111
+ @html.em('Expiry Date: ')
112
+ @html.text!(hRequirement[:expiryDate])
113
+ @html.br
114
+ end
115
+
116
+ # satisfied plan
117
+ unless hRequirement[:satisfiedPlans].empty?
118
+ @html.section(:class => 'block') do
119
+ @html.details do
120
+ @html.summary('Satisfied Plans', {'class' => 'h4'})
121
+ hRequirement[:satisfiedPlans].each do |plan|
122
+ @html.section(:class => 'block') do
123
+ @html.details do
124
+ @html.summary('Plan', {'class' => 'h5'})
125
+ planClass.writeHtml(plan)
126
+ end
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
132
+
133
+ end # writeHtml
134
+ end # Html_Requirement
135
+
136
+ end
137
+ end
138
+ end
139
+ end
@@ -0,0 +1,55 @@
1
+ require_relative 'html_responsibility'
2
+ require_relative 'html_date'
3
+
4
+ module ADIWG
5
+ module Mdtranslator
6
+ module Writers
7
+ module Html
8
+ class Html_Revision
9
+ def initialize(html)
10
+ @html = html
11
+ end
12
+
13
+ def writeHtml(hRevision)
14
+ responsibilityClass = Html_Responsibility.new(@html)
15
+ dateClass = Html_Date.new(@html)
16
+
17
+ # description
18
+ unless hRevision[:description].nil?
19
+ @html.em('Description: ')
20
+ @html.text!(hRevision[:description])
21
+ @html.br
22
+ end
23
+
24
+ # responsibleParty
25
+ unless hRevision[:responsibleParty].empty?
26
+ @html.section(:class => 'block') do
27
+ @html.details do
28
+ @html.summary('Responsible Party', {'class' => 'h4'})
29
+ @html.section(:class => 'block') do
30
+ responsibilityClass.writeHtml(hRevision[:responsibleParty])
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ # dateInfo
37
+ unless hRevision[:dateInfo].empty?
38
+ @html.section(:class => 'block') do
39
+ @html.details do
40
+ @html.summary('Date Info', {'class' => 'h4'})
41
+ hRevision[:dateInfo].each do |date|
42
+ @html.em('Datetime: ')
43
+ @html.text!(date[:dateTime].to_s)
44
+ @html.br
45
+ end
46
+ end
47
+ end
48
+ end
49
+
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -277,6 +277,33 @@ module ADIWG
277
277
 
278
278
  # data identification - resource constraints [] {MD_Constraints}
279
279
  aConstraint = hResource[:constraints]
280
+ legalConstraint = aConstraint.find { |hCon| hCon[:type] == 'legal' }
281
+ # handle distribution liability statements - add to legal constraint -> other constraints
282
+ aDistInfo = hMetadata[:distributorInfo]
283
+ liabilityStatements = []
284
+ aDistInfo.each do |hDistribution|
285
+ unless hDistribution.empty?
286
+ unless hDistribution[:liabilityStatement].nil?
287
+ liabilityStatements << hDistribution[:liabilityStatement]
288
+ end
289
+ end
290
+ end
291
+ if liabilityStatements.any?
292
+ # Create a new legal constraint if it doesn't exist
293
+ unless legalConstraint
294
+ legalConstraint = {
295
+ type: 'legal',
296
+ legalConstraint: {
297
+ otherCons: []
298
+ }
299
+ }
300
+ aConstraint << legalConstraint
301
+ end
302
+ liabilityStatements.each do |liabilityStatement|
303
+ legalConstraint[:legalConstraint][:otherCons] << liabilityStatement
304
+ end
305
+ end
306
+
280
307
  aConstraint.each do |hCon|
281
308
  @xml.tag!('mri:resourceConstraints') do
282
309
  constraintClass.writeXML(hCon, 'resource information')
@@ -286,6 +313,8 @@ module ADIWG
286
313
  @xml.tag!('mri:resourceConstraints')
287
314
  end
288
315
 
316
+ # data identification - resource constraints {} from distribution liability statement
317
+
289
318
  # data identification - associated resource [] {MD_AssociatedResource}
290
319
  aAssocRes.each do |hAssocRes|
291
320
  @xml.tag!('mri:associatedResource') do
@@ -34,7 +34,7 @@ module ADIWG
34
34
  citationClass = CI_Citation.new(@xml, @hResponseObj)
35
35
 
36
36
  @xml.tag!('mdq:report') do
37
- @xml.tag!("mdq:DQ_#{hReport[:type]}") do
37
+ @xml.tag!("mdq:#{hReport[:type]}") do
38
38
 
39
39
  # standaloneQualityReportDetails
40
40
  unless hReport[:standaloneQualityReportDetails].nil?
@@ -24,7 +24,16 @@ module ADIWG
24
24
  # date - date (required)
25
25
  unless date.nil?
26
26
  case dateRes
27
- when 'Y', 'YM', 'YMD', 'YMDh', 'YMDhm', 'YMDhms'
27
+ when 'Y'
28
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, 'Y')
29
+ @xml.tag!('gco:Date', dateStr)
30
+ when 'YM'
31
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, 'YM')
32
+ @xml.tag!('gco:Date', dateStr)
33
+ when 'YMD'
34
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(date, 'YMD')
35
+ @xml.tag!('gco:Date', dateStr)
36
+ when 'YMDh', 'YMDhm', 'YMDhms'
28
37
  dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(date, 'YMDhms')
29
38
  @xml.tag!('gco:DateTime', dateStr)
30
39
  when 'YMDhZ', 'YMDhmZ', 'YMDhmsZ'
@@ -0,0 +1,42 @@
1
+ require 'jbuilder'
2
+ require_relative 'mdJson_scope'
3
+ require_relative 'mdJson_plan'
4
+ require_relative 'mdJson_requirement'
5
+ require_relative 'mdJson_objective'
6
+ require_relative 'mdJson_platform'
7
+ require_relative 'mdJson_instrument'
8
+ require_relative 'mdJson_operation'
9
+ require_relative 'mdJson_event'
10
+ require_relative 'mdJson_pass'
11
+ require_relative 'mdJson_environment'
12
+
13
+ module ADIWG
14
+ module Mdtranslator
15
+ module Writers
16
+ module MdJson
17
+
18
+ module Acquisition
19
+
20
+ @Namespace = ADIWG::Mdtranslator::Writers::MdJson
21
+
22
+ def self.build(hAcquisition)
23
+
24
+ Jbuilder.new do |json|
25
+ json.scope Scope.build(hAcquisition[:scope])
26
+ json.plan @Namespace.json_map(hAcquisition[:plans], Plan)
27
+ json.requirement @Namespace.json_map(hAcquisition[:requirements], Requirement)
28
+ json.objective @Namespace.json_map(hAcquisition[:objectives], Objective)
29
+ json.platform @Namespace.json_map(hAcquisition[:platforms], Platform)
30
+ json.instrument @Namespace.json_map(hAcquisition[:instruments], Instrument)
31
+ json.operation @Namespace.json_map(hAcquisition[:operations], Operation)
32
+ json.event @Namespace.json_map(hAcquisition[:events], Event)
33
+ json.pass @Namespace.json_map(hAcquisition[:passes], Pass)
34
+ json.environment Environment.build(hAcquisition[:environment])
35
+ end
36
+
37
+ end
38
+ end # Acquisition
39
+ end # Event
40
+ end
41
+ end
42
+ end
@@ -10,11 +10,12 @@ module ADIWG
10
10
  module ConformanceResult
11
11
  def self.build(hConformanceResult)
12
12
  Jbuilder.new do |json|
13
- json.dateTime hConformanceResult[:dateTime]
14
- json.scope Scope.build(hConformanceResult[:scope])
15
- json.specification Citation.build(hConformanceResult[:specification])
16
- json.explanation hConformanceResult[:explanation]
17
- json.pass hConformanceResult[:pass]
13
+ json.dateTime hConformanceResult[:dateTime] unless hConformanceResult[:dateTime].nil?
14
+ json.scope Scope.build(hConformanceResult[:scope]) unless hConformanceResult[:scope].empty?
15
+ json.name hConformanceResult[:name] unless hConformanceResult[:name].nil?
16
+ json.specification Citation.build(hConformanceResult[:specification]) unless hConformanceResult[:specification].empty?
17
+ json.explanation hConformanceResult[:explanation] unless hConformanceResult[:explanation].nil?
18
+ json.pass hConformanceResult[:pass] unless hConformanceResult[:pass].nil?
18
19
  end
19
20
  end
20
21
  end
@@ -15,6 +15,7 @@ module ADIWG
15
15
  Jbuilder.new do |json|
16
16
  json.dateTime hCoverageResult[:dateTime]
17
17
  json.scope Scope.build(hCoverageResult[:scope]) unless hCoverageResult[:scope].empty?
18
+ json.name hCoverageResult[:name] unless hCoverageResult[:name].nil?
18
19
  json.spatialRepresentationType hCoverageResult[:spatialRepresentationType]
19
20
  json.spatialRepresentation SpatialRepresentation.build(hCoverageResult[:spatialRepresentation]) unless hCoverageResult[:spatialRepresentation].empty?
20
21
  json.resultContentDescription CoverageDescription.build(hCoverageResult[:resultContentDescription]) unless hCoverageResult[:resultContentDescription].empty?
@@ -11,6 +11,7 @@ module ADIWG
11
11
  Jbuilder.new do |json|
12
12
  json.dateTime hResult[:dateTime] unless hResult[:dateTime].nil?
13
13
  json.scope Scope.build(hResult[:scope]) unless hResult[:scope].empty?
14
+ json.name hResult[:name] unless hResult[:name].nil?
14
15
  json.statement hResult[:statement] unless hResult[:statement].nil?
15
16
  end
16
17
  end
@@ -0,0 +1,28 @@
1
+ require 'jbuilder'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Writers
6
+ module MdJson
7
+
8
+ module Environment
9
+
10
+ @Namespace = ADIWG::Mdtranslator::Writers::MdJson
11
+
12
+ def self.build(hEnvironment)
13
+
14
+ Jbuilder.new do |json|
15
+ json.averageAirTemperature hEnvironment[:averageAirTemperature] unless hEnvironment[:averageAirTemperature].nil?
16
+ json.maxRelativeHumidity hEnvironment[:maxRelativeHumidity] unless hEnvironment[:maxRelativeHumidity].nil?
17
+ json.maxAltitude hEnvironment[:maxAltitude] unless hEnvironment[:maxAltitude].nil?
18
+ json.meteorologicalConditions hEnvironment[:meteorologicalConditions] unless hEnvironment[:meteorologicalConditions].nil?
19
+ json.solarAzimuth hEnvironment[:solarAzimuth] unless hEnvironment[:solarAzimuth].nil?
20
+ json.solarElevation hEnvironment[:solarElevation] unless hEnvironment[:solarElevation].nil?
21
+ end
22
+
23
+ end
24
+ end # Environment
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,37 @@
1
+ require 'jbuilder'
2
+ require_relative 'mdJson_identifier'
3
+ require_relative 'mdJson_dateTime'
4
+ require_relative 'mdJson_objective'
5
+ require_relative 'mdJson_pass'
6
+ require_relative 'mdJson_instrument'
7
+
8
+
9
+ module ADIWG
10
+ module Mdtranslator
11
+ module Writers
12
+ module MdJson
13
+
14
+ module Event
15
+
16
+ @Namespace = ADIWG::Mdtranslator::Writers::MdJson
17
+
18
+ def self.build(hEvent)
19
+
20
+ Jbuilder.new do |json|
21
+ json.eventId hEvent[:eventId]
22
+ json.identifier Identifier.build(hEvent[:identifier])
23
+ json.trigger hEvent[:trigger]
24
+ json.context hEvent[:context]
25
+ json.sequence hEvent[:sequence]
26
+ json.time DateTime.build(hEvent[:time])
27
+ json.expectedObjective @Namespace.json_map(hEvent[:expectedObjectives], Objective)
28
+ json.relatedPass Pass.build(hEvent[:relatedPass])
29
+ json.relatedSensor @Namespace.json_map(hEvent[:relatedSensors], Instrument)
30
+ end
31
+
32
+ end
33
+ end # Event
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,35 @@
1
+ require 'jbuilder'
2
+ require_relative 'mdJson_citation'
3
+ require_relative 'mdJson_identifier'
4
+ require_relative 'mdJson_platform'
5
+ require_relative 'mdJson_instrumentationEventList'
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module MdJson
11
+
12
+ module Instrument
13
+
14
+ @Namespace = ADIWG::Mdtranslator::Writers::MdJson
15
+
16
+ def self.build(hInstrument)
17
+
18
+ Jbuilder.new do |json|
19
+ json.instrumentId hInstrument[:instrumentId]
20
+ json.citation Citation.build(hInstrument[:citation]) unless hInstrument[:citation].empty?
21
+ json.identifier Identifier.build(hInstrument[:identifier])
22
+ json.instrumentType hInstrument[:instrumentType]
23
+ json.description hInstrument[:description] unless hInstrument[:description].nil?
24
+ json.mountedOn Platform.build(hInstrument[:mountedOn]) unless hInstrument[:mountedOn].empty?
25
+ json.history @Namespace.json_map(hInstrument[:histories], InstrumentationEventList) unless hInstrument[:histories].empty?
26
+ json.hostId Identifier.build(hInstrument[:hostId]) unless hInstrument[:hostId].empty?
27
+ end
28
+
29
+ end
30
+ end # Instrument
31
+
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,30 @@
1
+ require 'jbuilder'
2
+ require_relative 'mdJson_citation'
3
+ require_relative 'mdJson_revision'
4
+
5
+ module ADIWG
6
+ module Mdtranslator
7
+ module Writers
8
+ module MdJson
9
+
10
+ module InstrumentationEvent
11
+
12
+ @Namespace = ADIWG::Mdtranslator::Writers::MdJson
13
+
14
+ def self.build(hInstrumentationEvent)
15
+ # "required": ["description","eventType"],
16
+ Jbuilder.new do |json|
17
+ json.citation @Namespace.json_map(hInstrumentationEvent[:citations], Citation) unless hInstrumentationEvent[:citations].empty?
18
+ json.description hInstrumentationEvent[:description]
19
+ json.extent hInstrumentationEvent[:extent] unless hInstrumentationEvent[:extent].empty?
20
+ json.eventType hInstrumentationEvent[:eventType]
21
+ json.revisionHistory @Namespace.json_map(hInstrumentationEvent[:revisionHistories], Revision) unless hInstrumentationEvent[:revisionHistories].empty?
22
+ end
23
+
24
+ end
25
+ end # InstrumentationEvent
26
+
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,32 @@
1
+ require 'jbuilder'
2
+ require_relative 'mdJson_citation'
3
+ require_relative 'mdJson_locale'
4
+ require_relative 'mdJson_constraint'
5
+ require_relative 'mdJson_instrumentationEvent'
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Writers
10
+ module MdJson
11
+
12
+ module InstrumentationEventList
13
+
14
+ @Namespace = ADIWG::Mdtranslator::Writers::MdJson
15
+
16
+ def self.build(hInstrumentationEventList)
17
+
18
+ Jbuilder.new do |json|
19
+ json.citation Citation.build(hInstrumentationEventList[:citation]) unless hInstrumentationEventList[:citation].empty?
20
+ json.description hInstrumentationEventList[:description]
21
+ json.locale Locale.build(hInstrumentationEventList[:locale]) unless hInstrumentationEventList[:locale].empty?
22
+ json.constraints @Namespace.json_map(hInstrumentationEventList[:constraints], Constraint) unless hInstrumentationEventList[:constraints].empty?
23
+ json.instrumentationEvent @Namespace.json_map(hInstrumentationEventList[:instrumentationEvents], InstrumentationEvent) unless hInstrumentationEventList[:instrumentationEvents].empty?
24
+ end
25
+
26
+ end
27
+ end # InstrumentationEventList
28
+
29
+ end
30
+ end
31
+ end
32
+ end