adiwg-mdtranslator 2.20.0.pre.beta.5 → 2.21.0.pre.beta.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/Gemfile.lock +3 -3
- data/README.md +0 -21
- data/Rakefile +0 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +45 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_acquisition.rb +133 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_environment.rb +47 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_event.rb +88 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrument.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEvent.rb +77 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEventList.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +11 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_objective.rb +104 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_operation.rb +119 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_pass.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_plan.rb +80 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_platform.rb +87 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requestedDate.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requirement.rb +98 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_revision.rb +50 -0
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_acquisition.rb +199 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_environment.rb +58 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_event.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrument.rb +98 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEvent.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEventList.rb +90 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_objective.rb +155 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_operation.rb +178 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_pass.rb +72 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_plan.rb +93 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_platform.rb +117 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_requestedDate.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_requirement.rb +139 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_revision.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_acquisition.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_environment.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_event.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrument.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEvent.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEventList.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +2 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_objective.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_operation.rb +34 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_pass.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_plan.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_platform.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requestedDate.rb +26 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requirement.rb +36 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_revision.rb +28 -0
- data/lib/adiwg/mdtranslator_cli.rb +1 -1
- metadata +45 -36
- data/DCAT-US.md +0 -67
- data/lib/adiwg/mdtranslator/writers/dcat_us/dcat_us_writer.rb +0 -98
- data/lib/adiwg/mdtranslator/writers/dcat_us/readme.md +0 -10
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_level.rb +0 -55
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_url.rb +0 -17
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_accrualPeriodicity.rb +0 -45
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_bureau_code.rb +0 -33
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_contact_point.rb +0 -29
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_dcat_us.rb +0 -104
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by.rb +0 -29
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by_type.rb +0 -33
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_description.rb +0 -19
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_distribution.rb +0 -59
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_download_url.rb +0 -17
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_identifier.rb +0 -29
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_is_part_of.rb +0 -27
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_issued.rb +0 -19
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_keyword.rb +0 -19
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_landing_page.rb +0 -27
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_language.rb +0 -23
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_license.rb +0 -18
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_media_type.rb +0 -17
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_modified.rb +0 -29
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_primaryITInvestmentUII.rb +0 -19
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_program_code.rb +0 -33
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_publisher.rb +0 -74
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_references.rb +0 -50
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_rights.rb +0 -32
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_spatial.rb +0 -32
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_system_of_records.rb +0 -28
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_temporal.rb +0 -40
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_theme.rb +0 -28
- data/lib/adiwg/mdtranslator/writers/dcat_us/version.rb +0 -14
@@ -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
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'adiwg/mdtranslator/internal/module_codelistFun'
|
2
|
+
require_relative 'module_citation'
|
3
|
+
require_relative 'module_operation'
|
4
|
+
require_relative 'module_requirement'
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Readers
|
9
|
+
module MdJson
|
10
|
+
|
11
|
+
module Plan
|
12
|
+
def self.unpack(hPlan, responseObj, inContext = nil)
|
13
|
+
|
14
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
15
|
+
|
16
|
+
# return nil object if input is empty
|
17
|
+
if hPlan.empty?
|
18
|
+
@MessagePath.issueWarning(40, responseObj, inContext)
|
19
|
+
return nil
|
20
|
+
end
|
21
|
+
|
22
|
+
intMetadataClass = InternalMetadata.new
|
23
|
+
intPlan = intMetadataClass.newPlan
|
24
|
+
|
25
|
+
outContext = 'plan'
|
26
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
27
|
+
|
28
|
+
if hPlan.has_key?('planId')
|
29
|
+
intPlan[:planId] = hPlan['planId']
|
30
|
+
|
31
|
+
else
|
32
|
+
@MessagePath.issueError(42, responseObj, outContext)
|
33
|
+
end
|
34
|
+
|
35
|
+
if hPlan.has_key?('planType') && CodelistFun.validateItem('iso_geometryTypeCode', hPlan['planType'])
|
36
|
+
intPlan[:planType] = hPlan['planType']
|
37
|
+
end
|
38
|
+
|
39
|
+
if hPlan.has_key?('status') && CodelistFun.validateItem('iso_progress', hPlan['status'])
|
40
|
+
intPlan[:status] = hPlan['status']
|
41
|
+
else
|
42
|
+
@MessagePath.issueError(43, responseObj, outContext)
|
43
|
+
end
|
44
|
+
|
45
|
+
if hPlan.has_key?('citation')
|
46
|
+
hReturn = Citation.unpack(hPlan['citation'], responseObj, outContext)
|
47
|
+
unless hReturn.nil?
|
48
|
+
intPlan[:citation] = hReturn
|
49
|
+
end
|
50
|
+
else
|
51
|
+
@MessagePath.issueError(44, responseObj, outContext)
|
52
|
+
end
|
53
|
+
|
54
|
+
if hPlan.has_key?('planOperation')
|
55
|
+
hPlan['planOperation'].each do |item|
|
56
|
+
hReturn = Operation.unpack(item, responseObj, outContext)
|
57
|
+
unless hReturn.nil?
|
58
|
+
intPlan[:planOperations] << hReturn
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
if hPlan.has_key?('satisfiedRequirement')
|
64
|
+
hPlan['satisfiedRequirement'].each do |item|
|
65
|
+
hReturn = Requirement.unpack(item, responseObj, outContext)
|
66
|
+
unless hReturn.nil?
|
67
|
+
intPlan[:satisfiedRequirements] << hReturn
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
intPlan
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require_relative 'module_citation'
|
2
|
+
require_relative 'module_identifier'
|
3
|
+
require_relative 'module_responsibleParty'
|
4
|
+
require_relative 'module_instrument'
|
5
|
+
require_relative 'module_instrumentationEventList'
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Readers
|
10
|
+
module MdJson
|
11
|
+
|
12
|
+
module Platform
|
13
|
+
def self.unpack(hPlatform, responseObj, inContext = nil)
|
14
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
15
|
+
|
16
|
+
intMetadataClass = InternalMetadata.new
|
17
|
+
intPlatform = intMetadataClass.newPlatform
|
18
|
+
|
19
|
+
outContext = 'platform'
|
20
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
21
|
+
|
22
|
+
if hPlatform.has_key?('platformId')
|
23
|
+
intPlatform[:platformId] = hPlatform['platformId']
|
24
|
+
else
|
25
|
+
@MessagePath.issueError(460, responseObj, outContext)
|
26
|
+
end
|
27
|
+
|
28
|
+
if hPlatform.has_key?('citation')
|
29
|
+
hReturn = Citation.unpack(hPlatform['citation'], responseObj, outContext)
|
30
|
+
unless hReturn.nil?
|
31
|
+
intPlatform[:citation] = hReturn
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
if hPlatform.has_key?('identifier')
|
36
|
+
hReturn = Identifier.unpack(hPlatform['identifier'], responseObj, outContext)
|
37
|
+
unless hReturn.nil?
|
38
|
+
intPlatform[:identifier] = hReturn
|
39
|
+
else
|
40
|
+
@MessagePath.issueError(461, responseObj, outContext)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
if hPlatform.has_key?('description')
|
45
|
+
intPlatform[:description] = hPlatform['description']
|
46
|
+
else
|
47
|
+
@MessagePath.issueError(460, responseObj, outContext)
|
48
|
+
end
|
49
|
+
|
50
|
+
if hPlatform.has_key?('sponsor')
|
51
|
+
hPlatform['sponsor'].each do |sponsor|
|
52
|
+
hReturn = ResponsibleParty.unpack(sponsor, responseObj, outContext)
|
53
|
+
unless hReturn.nil?
|
54
|
+
intPlatform[:sponsors] << hReturn
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
if hPlatform.has_key?('instrument')
|
60
|
+
hPlatform['instrument'].each do |instrument|
|
61
|
+
hReturn = Instrument.unpack(instrument, responseObj, outContext)
|
62
|
+
unless hReturn.nil?
|
63
|
+
intPlatform[:instruments] << hReturn
|
64
|
+
else
|
65
|
+
@MessagePath.issueError(461, responseObj, outContext)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
if hPlatform.has_key?('history')
|
71
|
+
hPlatform['history'].each do |history|
|
72
|
+
hReturn = AcqInstrumentationEventList.unpack(history, responseObj, outContext)
|
73
|
+
unless hReturn.nil?
|
74
|
+
intPlatform[:history] = hReturn
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
intPlatform
|
80
|
+
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require_relative 'module_dateTime'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Readers
|
6
|
+
module MdJson
|
7
|
+
|
8
|
+
module RequestedDate
|
9
|
+
def self.unpack(hRequestedDate, responseObj, inContext = nil)
|
10
|
+
|
11
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
12
|
+
|
13
|
+
outContext = 'RequestedDate'
|
14
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
15
|
+
|
16
|
+
# return nil object if input is empty
|
17
|
+
if hRequestedDate.empty?
|
18
|
+
@MessagePath.issueWarning(41, responseObj, outContext)
|
19
|
+
return nil
|
20
|
+
end
|
21
|
+
|
22
|
+
intMetadataClass = InternalMetadata.new
|
23
|
+
intRequestedDate = intMetadataClass.newRequestedDate
|
24
|
+
|
25
|
+
if hRequestedDate.has_key?('requestedDateOfCollection')
|
26
|
+
hReturn = DateTime.unpack(hRequestedDate['requestedDateOfCollection'], responseObj, outContext)
|
27
|
+
unless hReturn.nil?
|
28
|
+
intRequestedDate[:requestedDateOfCollection] = hReturn
|
29
|
+
else
|
30
|
+
@MessagePath.issueError(161, responseObj, inContext)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
if hRequestedDate.has_key?('latestAcceptableDate')
|
35
|
+
hReturn = DateTime.unpack(hRequestedDate['latestAcceptableDate'], responseObj, outContext)
|
36
|
+
unless hReturn.nil?
|
37
|
+
intRequestedDate[:latestAcceptableDate] = hReturn
|
38
|
+
else
|
39
|
+
@MessagePath.issueError(161, responseObj, inContext)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
intRequestedDate
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|