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,47 @@
1
+ module ADIWG
2
+ module Mdtranslator
3
+ module Readers
4
+ module MdJson
5
+
6
+ module Environment
7
+ def self.unpack(hEnvironment, responseObj, inContext = nil)
8
+
9
+ intMetadataClass = InternalMetadata.new
10
+ intEnvironment = intMetadataClass.newEnvironment
11
+
12
+ outContext = 'environment'
13
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
14
+
15
+ if hEnvironment.has_key?('averageAirTemperature')
16
+ intEnvironment[:averageAirTemperature] = hEnvironment['averageAirTemperature']
17
+ end
18
+
19
+ if hEnvironment.has_key?('maxRelativeHumidity')
20
+ intEnvironment[:maxRelativeHumidity] = hEnvironment['maxRelativeHumidity']
21
+ end
22
+
23
+ if hEnvironment.has_key?('maxAltitude')
24
+ intEnvironment[:maxAltitude] = hEnvironment['maxAltitude']
25
+ end
26
+
27
+ if hEnvironment.has_key?('meteorologicalConditions')
28
+ intEnvironment[:meteorologicalConditions] = hEnvironment['meteorologicalConditions']
29
+ end
30
+
31
+ if hEnvironment.has_key?('solarAzimuth')
32
+ intEnvironment[:solarAzimuth] = hEnvironment['solarAzimuth']
33
+ end
34
+
35
+ if hEnvironment.has_key?('solarElevation')
36
+ intEnvironment[:solarElevation] = hEnvironment['solarElevation']
37
+ end
38
+
39
+ intEnvironment
40
+
41
+ end
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,88 @@
1
+ require_relative 'module_identifier'
2
+ require_relative 'module_dateTime'
3
+ require_relative 'module_objective'
4
+ require_relative 'module_pass'
5
+ require_relative 'module_instrument'
6
+
7
+ module ADIWG
8
+ module Mdtranslator
9
+ module Readers
10
+ module MdJson
11
+
12
+ module Event
13
+ def self.unpack(hEvent, responseObj, inContext = nil)
14
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
15
+
16
+ intMetadataClass = InternalMetadata.new
17
+ intEvent = intMetadataClass.newEvent
18
+
19
+ outContext = 'Event'
20
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
21
+
22
+ if hEvent.has_key?('eventId')
23
+ intEvent[:eventId] = hEvent['eventId']
24
+ else
25
+ @MessagePath.issueWarning(40, responseObj, outContext)
26
+ end
27
+
28
+ if hEvent.has_key?('identifier')
29
+ intEvent[:identifier] = Identifier.unpack(hEvent['identifier'], responseObj, outContext)
30
+ else
31
+ @MessagePath.issueWarning(40, responseObj, outContext)
32
+ end
33
+
34
+ if hEvent.has_key?('trigger')
35
+ intEvent[:trigger] = hEvent['trigger']
36
+ else
37
+ @MessagePath.issueWarning(40, responseObj, outContext)
38
+ end
39
+
40
+ if hEvent.has_key?('context')
41
+ intEvent[:context] = hEvent['context']
42
+ else
43
+ @MessagePath.issueWarning(40, responseObj, outContext)
44
+ end
45
+
46
+ if hEvent.has_key?('sequence')
47
+ intEvent[:sequence] = hEvent['sequence']
48
+ else
49
+ @MessagePath.issueWarning(40, responseObj, outContext,)
50
+ end
51
+
52
+ if hEvent.has_key?('time')
53
+ intEvent[:time] = DateTime.unpack(hEvent['time'], responseObj, outContext)
54
+ else
55
+ @MessagePath.issueWarning(40, responseObj, outContext)
56
+ end
57
+
58
+ if hEvent.has_key?('expectedObjective')
59
+ hEvent['expectedObjective'].each do |item|
60
+ hReturn = Objective.unpack(item, responseObj, outContext)
61
+ unless hReturn.nil?
62
+ intEvent[:expectedObjectives] << hReturn
63
+ end
64
+ end
65
+ end
66
+
67
+ if hEvent.has_key?('relatedPass')
68
+ intEvent[:relatedPass] = Pass.unpack(hEvent['relatedPass'], responseObj, outContext)
69
+ end
70
+
71
+ if hEvent.has_key?('relatedSensor')
72
+ hEvent['relatedSensor'].each do |item|
73
+ hReturn = Instrument.unpack(item, responseObj, outContext)
74
+ unless hReturn.nil?
75
+ intEvent[:relatedSensors] << hReturn
76
+ end
77
+ end
78
+ end
79
+
80
+ intEvent
81
+
82
+ end
83
+ end
84
+
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,73 @@
1
+ require_relative 'module_citation'
2
+ require_relative 'module_platform'
3
+ require_relative 'module_instrumentationEventList'
4
+ require_relative 'module_identifier'
5
+
6
+ module ADIWG
7
+ module Mdtranslator
8
+ module Readers
9
+ module MdJson
10
+
11
+ module Instrument
12
+ def self.unpack(hInstrument, responseObj, inContext = nil)
13
+
14
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
15
+
16
+ intMetadataClass = InternalMetadata.new
17
+ intInstrument = intMetadataClass.newInstrument
18
+
19
+ outContext = 'instrument'
20
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
21
+
22
+ if hInstrument.has_key?('instrumentId')
23
+ intInstrument[:instrumentId] = hInstrument['instrumentId']
24
+ else
25
+ @MessagePath.issueWarning(40, responseObj, outContext)
26
+ end
27
+
28
+ if hInstrument.has_key?('citation')
29
+ intInstrument[:citation] = Citation.unpack(hInstrument['citation'], responseObj, outContext)
30
+ end
31
+
32
+ if hInstrument.has_key?('identifier')
33
+ intInstrument[:identifier] = Identifier.unpack(hInstrument['identifier'], responseObj, outContext)
34
+ else
35
+ @MessagePath.issueWarning(40, responseObj, outContext)
36
+ end
37
+
38
+ if hInstrument.has_key?('instrumentType')
39
+ intInstrument[:instrumentType] = hInstrument['instrumentType']
40
+ else
41
+ @MessagePath.issueWarning(40, responseObj, outContext)
42
+ end
43
+
44
+ if hInstrument.has_key?('description')
45
+ intInstrument[:description] = hInstrument['description']
46
+ end
47
+
48
+ if hInstrument.has_key?('mountedOn')
49
+ intInstrument[:mountedOn] = Platform.unpack(hInstrument['mountedOn'], responseObj, outContext)
50
+ end
51
+
52
+ if hInstrument.has_key?('history')
53
+ hInstrument['history'].each do |item|
54
+ hReturn = InstrumentationEventList.unpack(item, responseObj, outContext)
55
+ unless hReturn.nil?
56
+ intInstrument[:histories] << hReturn
57
+ end
58
+ end
59
+ end
60
+
61
+ if hInstrument.has_key?('hostId')
62
+ intInstrument[:hostId] = Identifier.unpack(hInstrument['hostId'], responseObj, outContext)
63
+ end
64
+
65
+ intInstrument
66
+
67
+ end
68
+ end
69
+
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,77 @@
1
+ require_relative 'module_citation'
2
+ require_relative 'module_extent'
3
+ require_relative 'module_revision'
4
+
5
+ module ADIWG
6
+ module Mdtranslator
7
+ module Readers
8
+ module MdJson
9
+
10
+ module InstrumentationEvent
11
+ def self.unpack(hInstrumentationEvent, responseObj, inContext = nil)
12
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
13
+
14
+ intMetadataClass = InternalMetadata.new
15
+ intInstrumentationEvent = intMetadataClass.newInstrumentationEvent
16
+
17
+ outContext = 'instrumentation event'
18
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
19
+
20
+ eventTypeArray = [
21
+ "announcement",
22
+ "calibration",
23
+ "calibrationCoefficientUpdate",
24
+ "dataLoss",
25
+ "fatal",
26
+ "manoeuvre",
27
+ "missingData",
28
+ "notice",
29
+ "prelaunch",
30
+ "severe",
31
+ "switchOff",
32
+ "switchOn",
33
+ "clean"
34
+ ]
35
+
36
+ if hInstrumentationEvent.has_key?('citation')
37
+ hInstrumentationEvent['citation'].each do |citation|
38
+ hReturn = Citation.unpack(citation, responseObj, outContext)
39
+ unless hReturn.nil?
40
+ intInstrumentationEvent[:citations] << hReturn
41
+ end
42
+ end
43
+ end
44
+
45
+ if hInstrumentationEvent.has_key?('description')
46
+ intInstrumentationEvent[:description] = hInstrumentationEvent['description']
47
+ else
48
+ @MessagePath.issueWarning(40, responseObj, outContext)
49
+ end
50
+
51
+ if hInstrumentationEvent.has_key?('extent')
52
+ intInstrumentationEvent[:extent] = Extent.unpack(hInstrumentationEvent['extent'], responseObj, outContext)
53
+ end
54
+
55
+ if hInstrumentationEvent.has_key?('eventType') && eventTypeArray.include?(hInstrumentationEvent['eventType'])
56
+ intInstrumentationEvent[:eventType] = hInstrumentationEvent['eventType']
57
+ else
58
+ @MessagePath.issueWarning(41, responseObj, outContext)
59
+ end
60
+
61
+ if hInstrumentationEvent.has_key?('revisionHistory')
62
+ hInstrumentationEvent['revisionHistory'].each do |item|
63
+ hReturn = Revision.unpack(item, responseObj, outContext)
64
+ unless hReturn.nil?
65
+ intInstrumentationEvent[:revisionHistories] << hReturn
66
+ end
67
+ end
68
+ end
69
+
70
+ intInstrumentationEvent
71
+ end
72
+ end
73
+
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,62 @@
1
+ require_relative 'module_citation'
2
+ require_relative 'module_locale'
3
+ require_relative 'module_constraint'
4
+ require_relative 'module_instrumentationEvent'
5
+
6
+ module ADIWG
7
+ module Mdtranslator
8
+ module Readers
9
+ module MdJson
10
+
11
+ module InstrumentationEventList
12
+ def self.unpack(hInstrumentationEventList, responseObj, inContext = nil)
13
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
14
+
15
+ intMetadataClass = InternalMetadata.new
16
+ intInstrumentationEventList = intMetadataClass.newInstrumentationEventList
17
+
18
+ outContext = 'instrumentation event list'
19
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
20
+
21
+ if hInstrumentationEventList.has_key?('citation')
22
+ intInstrumentationEventList[:citation] = Citation.unpack(hInstrumentationEventList['citation'], responseObj, outContext)
23
+ end
24
+
25
+ if hInstrumentationEventList.has_key?('description')
26
+ intInstrumentationEventList[:description] = hInstrumentationEventList['description']
27
+ else
28
+ @MessagePath.issueWarning(40, responseObj, outContext, 'instrumentation event description')
29
+ end
30
+
31
+ if hInstrumentationEventList.has_key?('locale')
32
+ hReturn = Locale.unpack(hInstrumentationEventList['locale'], responseObj, outContext)
33
+
34
+ end
35
+
36
+ if hInstrumentationEventList.has_key?('constraint')
37
+ constraints = hInstrumentationEventList['constraint']
38
+ constraints.each do |constraint|
39
+ hReturn = Constraint.unpack(hInstrumentationEventList['constraint'], responseObj, outContext)
40
+ unless hReturn.nil?
41
+ intInstrumentationEventList[:constraints] << hReturn
42
+ end
43
+ end
44
+ end
45
+
46
+ if hInstrumentationEventList.has_key?('instrumentationEvent')
47
+ hInstrumentationEventList['instrumentationEvent'].each do |item|
48
+ hReturn = InstrumentationEvent.unpack(item, responseObj, outContext)
49
+ unless hReturn.nil?
50
+ intInstrumentationEventList[:instrumentationEvents] << hReturn
51
+ end
52
+ end
53
+ end
54
+
55
+ intInstrumentationEventList
56
+ end
57
+ end
58
+
59
+ end
60
+ end
61
+ end
62
+ end
@@ -13,6 +13,7 @@ require_relative 'module_associatedResource'
13
13
  require_relative 'module_additionalDocumentation'
14
14
  require_relative 'module_funding'
15
15
  require_relative 'module_dataQuality'
16
+ require_relative 'module_acquisition'
16
17
 
17
18
  module ADIWG
18
19
  module Mdtranslator
@@ -128,6 +129,16 @@ module ADIWG
128
129
  end
129
130
  end
130
131
 
132
+ if hMetadata.has_key?('acquisition')
133
+ aItems = hMetadata['acquisition']
134
+ aItems.each do |item|
135
+ hReturn = Acquisition.unpack(item, responseObj)
136
+ unless hReturn.nil?
137
+ intMetadata[:acquisitions] << hReturn
138
+ end
139
+ end
140
+ end
141
+
131
142
  return intMetadata
132
143
 
133
144
  end
@@ -0,0 +1,104 @@
1
+ require 'adiwg/mdtranslator/internal/module_codelistFun'
2
+ require_relative 'module_identifier'
3
+ require_relative 'module_extent'
4
+ require_relative 'module_event'
5
+ require_relative 'module_pass'
6
+ require_relative 'module_instrument'
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Readers
11
+ module MdJson
12
+
13
+ module Objective
14
+ def self.unpack(hObjective, responseObj, inContext = nil)
15
+
16
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
17
+
18
+ intMetadataClass = InternalMetadata.new
19
+ intObjective = intMetadataClass.newObjective
20
+
21
+ outContext = 'objective'
22
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
23
+
24
+ if hObjective.has_key?('objectiveId')
25
+ intObjective[:objectiveId] = hObjective['objectiveId']
26
+ else
27
+ @MessagePath.issueError(200, responseObj, outContext)
28
+ end
29
+
30
+ if hObjective.has_key?('identifier')
31
+ aItems = hObjective['identifier']
32
+ aItems.each do |item|
33
+ hReturn = Identifier.unpack(item, responseObj, outContext)
34
+ unless hReturn.nil?
35
+ intObjective[:identifiers] << hReturn
36
+ end
37
+ end
38
+ else
39
+ @MessagePath.issueError(201, responseObj, outContext)
40
+ end
41
+
42
+ if hObjective.has_key?('priority')
43
+ intObjective[:priority] = hObjective['priority']
44
+ end
45
+
46
+ if hObjective.has_key?('objectiveType')
47
+ aItems = hObjective['objectiveType']
48
+ aItems.each do |item|
49
+ if CodelistFun.validateItem('iso_objectiveTypeCode', item)
50
+ intObjective[:objectiveTypes] << item
51
+ end
52
+ end
53
+ end
54
+
55
+ if hObjective.has_key?('function')
56
+ hObjective['function'].each do |item|
57
+ intObjective[:functions] << item
58
+ end
59
+ end
60
+
61
+ if hObjective.has_key?('extent')
62
+ hObjective['extent'].each do |item|
63
+ hReturn = Extent.unpack(item, responseObj, outContext)
64
+ unless hReturn.nil?
65
+ intObjective[:extents] << hReturn
66
+ end
67
+ end
68
+ end
69
+
70
+ if hObjective.has_key?('objectiveOccurrence')
71
+ hObjective['objectiveOccurrence'].each do |item|
72
+ hReturn = Event.unpack(item, responseObj, outContext)
73
+ unless hReturn.nil?
74
+ intObjective[:occurrences] << hReturn
75
+ end
76
+ end
77
+ end
78
+
79
+ if hObjective.has_key?('pass')
80
+ hObjective['pass'].each do |item|
81
+ hReturn = Pass.unpack(item, responseObj, outContext)
82
+ unless hReturn.nil?
83
+ intObjective[:passes] << hReturn
84
+ end
85
+ end
86
+ end
87
+
88
+ if hObjective.has_key?('sensingInstrument')
89
+ hObjective['sensingInstrument'].each do |item|
90
+ hReturn = Instrument.unpack(item, responseObj, outContext)
91
+ unless hReturn.nil?
92
+ intObjective[:sensingInstruments] << hReturn
93
+ end
94
+ end
95
+ end
96
+
97
+ intObjective
98
+ end
99
+ end
100
+
101
+ end
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,119 @@
1
+ require 'adiwg/mdtranslator/internal/module_codelistFun'
2
+ require_relative 'module_citation'
3
+ require_relative 'module_identifier'
4
+ require_relative 'module_objective'
5
+ require_relative 'module_platform'
6
+ require_relative 'module_event'
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Readers
11
+ module MdJson
12
+
13
+ module Operation
14
+ def self.unpack(hOperation, responseObj, inContext = nil)
15
+
16
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
17
+
18
+ intMetadataClass = InternalMetadata.new
19
+ intOperation = intMetadataClass.newOperation
20
+
21
+ outContext = 'operation'
22
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
23
+
24
+ if hOperation.has_key?('operationId')
25
+ intOperation[:operationId] = hOperation['operationId']
26
+
27
+ else
28
+ @MessagePath.issueError(42, responseObj, outContext)
29
+ end
30
+
31
+ if hOperation.has_key?('description')
32
+ intOperation[:description] = hOperation['description']
33
+ end
34
+
35
+ if hOperation.has_key?('citation')
36
+ hReturn = Citation.unpack(hOperation['citation'], responseObj, outContext)
37
+ unless hReturn.nil?
38
+ intOperation[:citation] = hReturn
39
+ end
40
+ end
41
+
42
+ if hOperation.has_key?('identifier')
43
+ hReturn = Identifier.unpack(hOperation['identifier'], responseObj, outContext)
44
+ unless hReturn.nil?
45
+ intOperation[:identifier] = hReturn
46
+ end
47
+ else
48
+ @MessagePath.issueError(44, responseObj, outContext)
49
+ end
50
+
51
+ if hOperation.has_key?('status') && CodelistFun.validateItem('iso_progress', hOperation['status'])
52
+ intOperation[:status] = hOperation['status']
53
+ end
54
+
55
+ if hOperation.has_key?('operationType') && CodelistFun.validateItem('iso_operationTypeCode', hOperation['operationType'])
56
+ intOperation[:operationType] = hOperation['operationType']
57
+ end
58
+
59
+ if hOperation.has_key?('objective')
60
+ hOperation['objective'].each do |item|
61
+ hReturn = Objective.unpack(item, responseObj, outContext)
62
+ unless hReturn.nil?
63
+ intOperation[:objectives] << hReturn
64
+ end
65
+ end
66
+ end
67
+
68
+ if hOperation.has_key?('parentOperation')
69
+ hReturn = Operation.unpack(hOperation['parentOperation'], responseObj, outContext)
70
+ unless hReturn.nil?
71
+ intOperation[:parentOperation] = hReturn
72
+ end
73
+ else
74
+ @MessagePath.issueError(44, responseObj, outContext)
75
+ end
76
+
77
+ if hOperation.has_key?('childOperation')
78
+ hOperation['childOperation'].each do |item|
79
+ hReturn = Operation.unpack(item, responseObj, outContext)
80
+ unless hReturn.nil?
81
+ intOperation[:childOperations] << hReturn
82
+ end
83
+ end
84
+ end
85
+
86
+ if hOperation.has_key?('plan')
87
+ hReturn = Plan.unpack(hOperation['plan'], responseObj, outContext)
88
+ unless hReturn.nil?
89
+ intOperation[:plan] = hReturn
90
+ end
91
+ end
92
+
93
+ if hOperation.has_key?('platform')
94
+ hOperation['platform'].each do |item|
95
+ hReturn = Platform.unpack(item, responseObj, outContext)
96
+ unless hReturn.nil?
97
+ intOperation[:platforms] << hReturn
98
+ end
99
+ end
100
+ end
101
+
102
+ if hOperation.has_key?('significantEvent')
103
+ hOperation['significantEvent'].each do |item|
104
+ hReturn = Event.unpack(item, responseObj, outContext)
105
+ unless hReturn.nil?
106
+ intOperation[:significantEvents] << hReturn
107
+ end
108
+ end
109
+ end
110
+
111
+ intOperation
112
+
113
+ end
114
+ end
115
+
116
+ end
117
+ end
118
+ end
119
+ end
@@ -0,0 +1,53 @@
1
+ require_relative 'module_identifier'
2
+ require_relative 'module_extent'
3
+ require_relative 'module_event'
4
+
5
+ module ADIWG
6
+ module Mdtranslator
7
+ module Readers
8
+ module MdJson
9
+
10
+ module Pass
11
+ def self.unpack(hPass, responseObj, inContext = nil)
12
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
13
+
14
+ intMetadataClass = InternalMetadata.new
15
+ intPass = intMetadataClass.newPass
16
+
17
+ outContext = 'pass'
18
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
19
+
20
+ if hPass.has_key?('passId')
21
+ intPass[:passId] = hPass['passId']
22
+ else
23
+ @MessagePath.issueWarning(40, responseObj, outContext)
24
+ end
25
+
26
+ if hPass.has_key?('identifier')
27
+ intPass[:identifier] = Identifier.unpack(hPass['identifier'], responseObj, outContext)
28
+ else
29
+ @MessagePath.issueWarning(40, responseObj, outContext)
30
+ end
31
+
32
+ if hPass.has_key?('extent')
33
+ intPass[:extent] = Extent.unpack(hPass['extent'], responseObj, outContext)
34
+ end
35
+
36
+ if hPass.has_key?('relatedEvent')
37
+ hPass['relatedEvent'].each do |item|
38
+ hReturn = Event.unpack(item, responseObj, outContext)
39
+ unless hReturn.nil?
40
+ intPass[:relatedEvents] << hReturn
41
+ end
42
+ end
43
+ end
44
+
45
+ intPass
46
+
47
+ end
48
+ end
49
+
50
+ end
51
+ end
52
+ end
53
+ end