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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec23318ef18dc9729c5aaa6c608b55c856234d8e31a893b6c011f02494f75718
4
- data.tar.gz: d28e618a12660f940c9fbc4d3ea380c1109cdc2c7756a32872c2f2e84b4e2c64
3
+ metadata.gz: 24a46249aaab639bcbfcf96546503546a9474db0aaf8d3d9136190cbd7ae2c19
4
+ data.tar.gz: da85309bcd6c126043a653d5e436535d7d29c4eb2107a416acb1cdc4575d3696
5
5
  SHA512:
6
- metadata.gz: 6c81ced313a48931ef23b337d408f512932836b81368c535eb197dc0950795b8510deea40f5a130b4372b3110f1d9020fb943d7537de8e80184dc88b25fe8994
7
- data.tar.gz: 0566ba79a6004232a532bd7eda527bb60a90191ea0a0ba47baf38764efa014341074a31418cdc798f82a2fe5a5860f13d9f8a3e9dce8d170389edea39392a47d
6
+ metadata.gz: 966ff66ba5977d8f190b38535637cf43b0d346291ed81928179814b8bbb081a2967d56bba02f80847525e0f86fce8c0e1d405d71fbd7dcf1338c7cc5e2c2a31c
7
+ data.tar.gz: ae9ec9bd0c85646c0b7b99d79adda40be5ea40de1bb14eb133471028a3b9800b86138591abf2e1c87d6c3bc8e5e07741a66f816755558823cdc76697d30b9845
@@ -7,7 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  steps:
9
9
  - uses: actions/checkout@v4
10
- - uses: ruby/setup-ruby@v1
10
+ - uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
11
11
  with:
12
12
  ruby-version: "3.1" # Not needed with a .ruby-version file
13
13
  - run: bundle install
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adiwg-mdtranslator (2.20.0.pre.beta.3)
5
- adiwg-mdcodes (= 2.9.4.pre.beta.0)
6
- adiwg-mdjson_schemas (= 2.9.3.pre.beta.0)
4
+ adiwg-mdtranslator (2.21.0.pre.beta.0)
5
+ adiwg-mdcodes (= 2.10.0)
6
+ adiwg-mdjson_schemas (= 2.10.0.pre.beta.5)
7
7
  builder (~> 3.2)
8
8
  coderay (~> 1.1)
9
9
  jbuilder (~> 2.5)
@@ -17,13 +17,13 @@ PATH
17
17
  GEM
18
18
  remote: https://rubygems.org/
19
19
  specs:
20
- actionview (7.1.3.2)
21
- activesupport (= 7.1.3.2)
20
+ actionview (7.1.3.3)
21
+ activesupport (= 7.1.3.3)
22
22
  builder (~> 3.1)
23
23
  erubi (~> 1.11)
24
24
  rails-dom-testing (~> 2.2)
25
25
  rails-html-sanitizer (~> 1.6)
26
- activesupport (7.1.3.2)
26
+ activesupport (7.1.3.3)
27
27
  base64
28
28
  bigdecimal
29
29
  concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -35,9 +35,9 @@ GEM
35
35
  tzinfo (~> 2.0)
36
36
  addressable (2.8.6)
37
37
  public_suffix (>= 2.0.2, < 6.0)
38
- adiwg-mdcodes (2.9.4.pre.beta.0)
38
+ adiwg-mdcodes (2.10.0)
39
39
  json (~> 2.0)
40
- adiwg-mdjson_schemas (2.9.3.pre.beta.0)
40
+ adiwg-mdjson_schemas (2.10.0.pre.beta.5)
41
41
  base64 (0.2.0)
42
42
  bigdecimal (3.1.8)
43
43
  builder (3.2.4)
@@ -67,7 +67,7 @@ GEM
67
67
  nokogiri (1.15.6-x86_64-linux)
68
68
  racc (~> 1.4)
69
69
  public_suffix (5.0.5)
70
- racc (1.7.3)
70
+ racc (1.8.0)
71
71
  rails-dom-testing (2.2.0)
72
72
  activesupport (>= 5.0.0)
73
73
  minitest
@@ -76,7 +76,9 @@ GEM
76
76
  loofah (~> 2.21)
77
77
  nokogiri (~> 1.14)
78
78
  rake (13.1.0)
79
- rexml (3.2.6)
79
+ rexml (3.2.8)
80
+ strscan (>= 3.0.9)
81
+ strscan (3.1.0)
80
82
  thor (0.20.3)
81
83
  tzinfo (2.0.6)
82
84
  concurrent-ruby (~> 1.0)
data/README.md CHANGED
@@ -23,27 +23,6 @@ Or install it yourself as:
23
23
 
24
24
  $ mdtranslator help translate
25
25
 
26
- ## Development
27
-
28
- ### Requirements
29
-
30
- Requires
31
- - [Ruby](https://www.ruby-lang.org/en/documentation/installation/)
32
- - bundler (`gem install bundler`)
33
- - rake (`gem install rake`)
34
-
35
- ### Tests
36
-
37
- In order to run the tests, first install the dependencies
38
-
39
- $ bundle install
40
-
41
- Then, run the rake command
42
-
43
- $ bundle exec rake
44
-
45
- _TODO: There are currently 4 tests that are not passing, related to mdJSON readers and writers_
46
-
47
26
  ## Contributing
48
27
 
49
28
  1. Fork it ( https://github.com/[my-github-username]/mdTranslator/fork )
data/Rakefile CHANGED
@@ -23,7 +23,6 @@ Rake::TestTask.new do |t|
23
23
  'test/writers/iso19115-3/tc*.rb',
24
24
  'test/writers/mdJson/tc*.rb',
25
25
  'test/writers/sbJson/tc*.rb',
26
- 'test/writers/dcat_us/tc*.rb',
27
26
  'test/translator/tc*.rb'
28
27
  ]
29
28
  t.verbose = true
@@ -34,8 +34,8 @@ Gem::Specification.new do |spec|
34
34
  spec.add_runtime_dependency "thor", "~> 0.19"
35
35
  spec.add_runtime_dependency "uuidtools", "~> 2.1"
36
36
  spec.add_runtime_dependency "json-schema", "~> 2.7"
37
- spec.add_runtime_dependency "adiwg-mdjson_schemas", "2.9.3.pre.beta.0"
38
- spec.add_runtime_dependency "adiwg-mdcodes", "2.9.4.pre.beta.0"
37
+ spec.add_runtime_dependency "adiwg-mdjson_schemas", "2.10.0.pre.beta.5"
38
+ spec.add_runtime_dependency "adiwg-mdcodes", "2.10.0"
39
39
  spec.add_runtime_dependency "jbuilder", "~> 2.5"
40
40
  spec.add_runtime_dependency "kramdown", ">= 1.13", "< 3.0"
41
41
  spec.add_runtime_dependency "coderay", "~> 1.1"
@@ -143,7 +143,8 @@ class InternalMetadata
143
143
  associatedResources: [],
144
144
  additionalDocuments: [],
145
145
  funding: [],
146
- dataQuality: []
146
+ dataQuality: [],
147
+ acquisitions: []
147
148
  }
148
149
  end
149
150
 
@@ -158,6 +159,7 @@ class InternalMetadata
158
159
  # acquisition ----------------------------
159
160
  def newAcquisition
160
161
  {
162
+ scope: {},
161
163
  plans: [],
162
164
  requirements: [],
163
165
  objectives: [],
@@ -175,19 +177,23 @@ class InternalMetadata
175
177
  averageAirTemperature: nil,
176
178
  maxRelativeHumidity: nil,
177
179
  maxAltitude: nil,
178
- meteorologicalConditions: nil
180
+ meteorologicalConditions: nil,
181
+ solarAzimuth: nil,
182
+ solarElevation: nil
183
+
179
184
  }
180
185
  end
181
186
 
182
187
  def newEvent
183
188
  {
184
189
  eventId: nil,
190
+ identifier: {},
185
191
  trigger: nil,
186
192
  context: nil,
187
193
  sequence: nil,
188
194
  dateTime: nil,
189
195
  expectedObjectives: [],
190
- relatedPass: nil,
196
+ relatedPass: {},
191
197
  relatedSensors: []
192
198
  }
193
199
  end
@@ -199,7 +205,29 @@ class InternalMetadata
199
205
  identifier: {},
200
206
  instrumentType: nil,
201
207
  description: nil,
202
- mountedOn: nil
208
+ mountedOn: {},
209
+ histories: [],
210
+ hostId: {}
211
+ }
212
+ end
213
+
214
+ def newInstrumentationEvent
215
+ {
216
+ citations: [],
217
+ description: nil,
218
+ extent: {},
219
+ eventType: nil,
220
+ revisionHistories: [],
221
+ }
222
+ end
223
+
224
+ def newInstrumentationEventList
225
+ {
226
+ citation: {},
227
+ description: nil,
228
+ locale: {},
229
+ constraints: [],
230
+ instrumentationEvents: []
203
231
  }
204
232
  end
205
233
 
@@ -240,14 +268,15 @@ class InternalMetadata
240
268
  def newOperation
241
269
  {
242
270
  operationId: nil,
271
+ description: nil,
243
272
  citation: {},
244
273
  identifier: {},
245
274
  status: nil,
246
275
  operationType: nil,
247
276
  objectives: [],
248
- parentOperations: nil,
277
+ parentOperation: {},
249
278
  childOperations: [],
250
- plan: nil,
279
+ plan: {},
251
280
  platforms: [],
252
281
  significantEvents: []
253
282
  }
@@ -267,6 +296,14 @@ class InternalMetadata
267
296
  }
268
297
  end
269
298
 
299
+ def newRevision
300
+ {
301
+ description: nil,
302
+ responsibleParty: {},
303
+ dateInfo: []
304
+ }
305
+ end
306
+
270
307
  def newPlatform
271
308
  {
272
309
  platformId: nil,
@@ -274,7 +311,8 @@ class InternalMetadata
274
311
  identifier: {},
275
312
  description: nil,
276
313
  sponsors: [],
277
- instruments: []
314
+ instruments: [],
315
+ history: []
278
316
  }
279
317
  end
280
318
 
@@ -28,24 +28,39 @@ module ADIWG
28
28
 
29
29
  # data quality 2.1 (attracc) - attribute accuracy
30
30
  xAccuracy = xDataQual.xpath('./attracc')
31
- accuracyReport = xAccuracy.xpath('./attraccr').text
32
- report = intMetadataClass.newDataQualityReport
33
- report[:type] = 'NonQuantitativeAttributeCorrectness'
34
- descriptiveResult = intMetadataClass.newDescriptiveResult
35
- descriptiveResult[:statement] = accuracyReport
36
- report[:descriptiveResult] << descriptiveResult
37
- hDataQuality[:report] << report
38
-
39
- # data quality 2.1 (qattracc) - Quantitative Attribute Accuracy Assessment
40
- xQuantitativeAccuracy = xDataQual.xpath('./qattracc')
41
- unless xQuantitativeAccuracy.xpath('./attraccv').empty?
42
- value = xQuantitativeAccuracy.xpath('./attraccv').text
43
- report = intMetadataClass.newDataQualityReport
44
- report[:type] = 'QuantitativeAttributeAccuracy'
45
- quantitativeResult = intMetadataClass.newQuantitativeResult
46
- quantitativeResult[:values] << value
47
- report[:quantitativeResult] << quantitativeResult
48
- hDataQuality[:report] << report
31
+ unless xAccuracy.empty?
32
+ # data quality 2.1.1 (attraccr) - Attribute Accuracy Report
33
+ xAccuracyReport = xAccuracy.xpath('./attraccr')
34
+ unless xAccuracyReport.empty?
35
+ report = intMetadataClass.newDataQualityReport
36
+ report[:type] = 'DQ_NonQuantitativeAttributeCorrectness'
37
+ descriptiveResult = intMetadataClass.newDescriptiveResult
38
+ descriptiveResult[:name] = 'Attribute Accuracy Report'
39
+ descriptiveResult[:statement] = xAccuracyReport.text
40
+ report[:descriptiveResult] << descriptiveResult
41
+ hDataQuality[:report] << report
42
+ end
43
+ # data quality 2.1.2 (qattracc) - Quantitative Attribute Accuracy Assessment
44
+ xQuantitativeAccuracy = xAccuracy.xpath('./qattracc')
45
+ unless xQuantitativeAccuracy.empty?
46
+ report = intMetadataClass.newDataQualityReport
47
+ report[:type] = 'DQ_QuantitativeAttributeAccuracy'
48
+ # data quality 2.1.2.1 (attraccv) - Attribute Accuracy Value
49
+ xQuantitativeAccuracyValue = xQuantitativeAccuracy.xpath('./attraccv')
50
+ unless xQuantitativeAccuracyValue.empty?
51
+ quantitativeResult = intMetadataClass.newQuantitativeResult
52
+ quantitativeResult[:name] = 'Attribute Accuracy Value'
53
+ quantitativeResult[:values] << xQuantitativeAccuracyValue.text
54
+ report[:quantitativeResult] << quantitativeResult
55
+ end
56
+ # data quality 2.1.2.2 (attracce) - Attribute Accuracy Explanation
57
+ xEvaluationMethod = xQuantitativeAccuracy.xpath('./attracce')
58
+ unless xEvaluationMethod.empty?
59
+ report[:evaluationMethod] = intMetadataClass.newEvaluationMethod
60
+ report[:evaluationMethod][:methodDescription] = xEvaluationMethod.text
61
+ end
62
+ hDataQuality[:report] << report unless report[:quantitativeResult].empty? && report[:evaluationMethod].empty?
63
+ end
49
64
  end
50
65
 
51
66
  # data quality 2.2 (logic) - logical consistency (required) (not implemented)
@@ -55,9 +70,11 @@ module ADIWG
55
70
  else
56
71
  logic = xLogic.text
57
72
  report = intMetadataClass.newDataQualityReport
58
- report[:type] = 'ConceptualConsistency'
59
- report[:qualityMeasure] = intMetadataClass.newQualityMeasure
60
- report[:qualityMeasure][:description] = logic
73
+ report[:type] = 'DQ_ConceptualConsistency'
74
+ descriptiveResult = intMetadataClass.newDescriptiveResult
75
+ descriptiveResult[:name] = 'Logical Consistency Report'
76
+ descriptiveResult[:statement] = logic
77
+ report[:descriptiveResult] << descriptiveResult
61
78
  hDataQuality[:report] << report
62
79
  end
63
80
 
@@ -68,59 +85,86 @@ module ADIWG
68
85
  else
69
86
  complete = xComplete.text
70
87
  report = intMetadataClass.newDataQualityReport
71
- report[:type] = 'Omission'
88
+ report[:type] = 'DQ_CompletenessOmission'
72
89
  descriptiveResult = intMetadataClass.newDescriptiveResult
90
+ descriptiveResult[:name] = 'Completeness Report'
73
91
  descriptiveResult[:statement] = complete
74
92
  report[:descriptiveResult] << descriptiveResult
75
93
  hDataQuality[:report] << report
76
94
  end
77
95
 
78
- # data quality 2.4 (position) - positional accuracy
96
+ # data quality 2.4 (posacc) - Positional Accuracy
79
97
  xPositionalAccuracy = xDataQual.xpath('./posacc')
80
98
  unless xPositionalAccuracy.empty?
81
- # horizontal positional accuracy
82
- xHorizontal = xPositionalAccuracy.xpath('./horizpa')
83
- unless xHorizontal.empty?
99
+ # data quality 2.4.1 (horizpa) - Horizontal Positional Accuracy
100
+ xHorizontalAccuracy = xPositionalAccuracy.xpath('./horizpa')
101
+ unless xHorizontalAccuracy.empty?
84
102
  report = intMetadataClass.newDataQualityReport
85
- report[:type] = 'AbsoluteExternalPositionalAccuracy'
86
- unless xHorizontal.xpath('qhorizpa/horizpae').empty?
87
- report[:qualityMeasure] = intMetadataClass.newQualityMeasure
88
- report[:qualityMeasure][:description] = xHorizontal.xpath('qhorizpa/horizpae').text
89
- name = 'Horizontal Positional Accuracy Report'
90
- report[:qualityMeasure][:nameOfMeasure] << name
103
+ report[:type] = 'DQ_AbsoluteExternalPositionalAccuracy'
104
+ # data quality 2.4.1.1 (horizpar) - Horizontal Positional Accuracy Report
105
+ xHorizontalAccuracyReport = xHorizontalAccuracy.xpath('./horizpar')
106
+ unless xHorizontalAccuracyReport.empty?
107
+ descriptiveResult = intMetadataClass.newDescriptiveResult
108
+ descriptiveResult[:name] = 'Horizontal Positional Accuracy Report'
109
+ descriptiveResult[:statement] = xHorizontalAccuracyReport.text
110
+ report[:descriptiveResult] << descriptiveResult
91
111
  end
92
- unless xHorizontal.xpath('horizpar').empty?
93
- report[:evaluationMethod] = intMetadataClass.newEvaluationMethod
94
- report[:evaluationMethod][:methodDescription] = xHorizontal.xpath('horizpar').text
95
- end
96
- unless xHorizontal.xpath('qhorizpa/horizpav').empty?
97
- quantitativeResult = intMetadataClass.newQuantitativeResult
98
- value = xHorizontal.xpath('qhorizpa/horizpav').text
99
- quantitativeResult[:values] << value
100
- report[:quantitativeResult] << quantitativeResult
112
+ # data quality 2.4.1.2 (qhorizpa) - Quantitative Horizontal Positional Accuracy Assessment
113
+ xQuantitativeHorizontalAccuracy = xHorizontalAccuracy.xpath('./qhorizpa')
114
+ unless xQuantitativeHorizontalAccuracy.empty?
115
+ # data quality 2.4.1.2.1 (horizpav) - Horizontal Positional Accuracy Value
116
+ xHorizontalAccuracyValue = xQuantitativeHorizontalAccuracy.xpath('horizpav')
117
+ unless xHorizontalAccuracyValue.empty?
118
+ quantitativeResult = intMetadataClass.newQuantitativeResult
119
+ value = xHorizontalAccuracyValue.text
120
+ quantitativeResult[:name] = 'Horizontal Positional Accuracy Value'
121
+ quantitativeResult[:values] << value
122
+ report[:quantitativeResult] << quantitativeResult
123
+ end
124
+ # data quality 2.4.1.2.2 (horizpae) - Horizontal Positional Accuracy Explanation
125
+ xHorizontalAccuracyExplanation = xQuantitativeHorizontalAccuracy.xpath('horizpae')
126
+ unless xHorizontalAccuracyExplanation.empty?
127
+ descriptiveResult = intMetadataClass.newDescriptiveResult
128
+ descriptiveResult[:name] = 'Horizontal Positional Accuracy Explanation'
129
+ descriptiveResult[:statement] = xHorizontalAccuracyExplanation.text
130
+ report[:descriptiveResult] << descriptiveResult
131
+ end
101
132
  end
102
133
  hDataQuality[:report] << report
103
134
  end
104
- # vertical positional accuracy
105
- xVertical = xPositionalAccuracy.xpath('./vertacc')
106
- unless xVertical.empty?
135
+ # data quality 2.4.2 (vertacc) - Vertical Positional Accuracy
136
+ xVerticalAccuracy = xPositionalAccuracy.xpath('./vertacc')
137
+ unless xVerticalAccuracy.empty?
107
138
  report = intMetadataClass.newDataQualityReport
108
- report[:type] = 'AbsoluteExternalPositionalAccuracy'
109
- unless xVertical.xpath('qvertpa/vertacce').empty?
110
- report[:qualityMeasure] = intMetadataClass.newQualityMeasure
111
- report[:qualityMeasure][:description] = xVertical.xpath('qvertpa/vertacce').text
112
- name = 'Vertical Positional Accuracy Report'
113
- report[:qualityMeasure][:nameOfMeasure] << name
114
- end
115
- unless xVertical.xpath('vertaccr').empty?
116
- report[:evaluationMethod] = intMetadataClass.newEvaluationMethod
117
- report[:evaluationMethod][:methodDescription] = xVertical.xpath('vertaccr').text
139
+ report[:type] = 'DQ_AbsoluteExternalPositionalAccuracy'
140
+ # data quality 2.4.2.1 (vertaccr) - Vertical Positional Accuracy Report
141
+ xVerticalAccuracyReport = xVerticalAccuracy.xpath('./vertaccr')
142
+ unless xVerticalAccuracyReport.empty?
143
+ descriptiveResult = intMetadataClass.newDescriptiveResult
144
+ descriptiveResult[:name] = 'Vertical Positional Accuracy Report'
145
+ descriptiveResult[:statement] = xVerticalAccuracyReport.text
146
+ report[:descriptiveResult] << descriptiveResult
118
147
  end
119
- unless xVertical.xpath('qvertpa/vertaccv').empty?
120
- quantitativeResult = intMetadataClass.newQuantitativeResult
121
- value = xVertical.xpath('qvertpa/vertaccv').text
122
- quantitativeResult[:values] << value
123
- report[:quantitativeResult] << quantitativeResult
148
+ # data quality 2.4.2.2 (qvertpa) - Quantitative Vertical Positional Accuracy Assessment
149
+ xVerticalAccuracyAssessment = xVerticalAccuracy.xpath('./qvertpa')
150
+ unless xVerticalAccuracyAssessment.empty?
151
+ # data quality 2.4.2.2.1 (vertaccv) - Vertical Positional Accuracy Value
152
+ xVerticalAccuracyValue = xVerticalAccuracyAssessment.xpath('vertaccv')
153
+ unless xVerticalAccuracyValue.empty?
154
+ quantitativeResult = intMetadataClass.newQuantitativeResult
155
+ value = xVerticalAccuracyValue.text
156
+ quantitativeResult[:name] = 'Vertical Positional Accuracy Value'
157
+ quantitativeResult[:values] << value
158
+ report[:quantitativeResult] << quantitativeResult
159
+ end
160
+ # data quality 2.4.2.2.2 (vertacce) - Vertical Positional Accuracy Explanation
161
+ xVerticalAccuracyExplanation = xVerticalAccuracyAssessment.xpath('vertacce')
162
+ unless xVerticalAccuracyExplanation.empty?
163
+ descriptiveResult = intMetadataClass.newDescriptiveResult
164
+ descriptiveResult[:name] = 'Vertical Positional Accuracy Explanation'
165
+ descriptiveResult[:statement] = xVerticalAccuracyExplanation.text
166
+ report[:descriptiveResult] << descriptiveResult
167
+ end
124
168
  end
125
169
  hDataQuality[:report] << report
126
170
  end
@@ -0,0 +1,133 @@
1
+ require_relative 'module_scope'
2
+ require_relative 'module_objective'
3
+ require_relative 'module_requirement'
4
+ require_relative 'module_platform'
5
+ require_relative 'module_instrument'
6
+ require_relative 'module_operation'
7
+ require_relative 'module_pass'
8
+ require_relative 'module_event'
9
+ require_relative 'module_environment'
10
+ require_relative 'module_plan'
11
+
12
+ module ADIWG
13
+ module Mdtranslator
14
+ module Readers
15
+ module MdJson
16
+
17
+ module Acquisition
18
+
19
+ def self.unpack(hAcquisition, responseObj, inContext = nil)
20
+
21
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
22
+
23
+ outContext = 'acquisition'
24
+ outContext = inContext + ' > ' + outContext unless inContext.nil?
25
+
26
+ # instance classes needed in script
27
+ intMetadataClass = InternalMetadata.new
28
+ intAcquisition = intMetadataClass.newAcquisition
29
+
30
+ if hAcquisition.has_key?('scope')
31
+ unless hAcquisition['scope'].empty?
32
+ hReturn = Scope.unpack(hAcquisition['scope'], responseObj, outContext)
33
+ unless hReturn.nil?
34
+ intAcquisition[:scope] = hReturn
35
+ end
36
+ end
37
+ end
38
+
39
+ if hAcquisition.has_key?('plan')
40
+ aItems = hAcquisition['plan']
41
+ aItems.each do |item|
42
+ hReturn = Plan.unpack(item, responseObj, outContext)
43
+ unless hReturn.nil?
44
+ intAcquisition[:plans] << hReturn
45
+ end
46
+ end
47
+ end
48
+
49
+ if hAcquisition.has_key?('requirement')
50
+ aItems = hAcquisition['requirement']
51
+ aItems.each do |item|
52
+ hReturn = Requirement.unpack(item, responseObj, outContext)
53
+ unless hReturn.nil?
54
+ intAcquisition[:requirements] << hReturn
55
+ end
56
+ end
57
+ end
58
+
59
+ if hAcquisition.has_key?('objective')
60
+ aItems = hAcquisition['objective']
61
+ aItems.each do |item|
62
+ hReturn = Objective.unpack(item, responseObj, outContext)
63
+ unless hReturn.nil?
64
+ intAcquisition[:objectives] << hReturn
65
+ end
66
+ end
67
+ end
68
+
69
+ if hAcquisition.has_key?('platform')
70
+ aItems = hAcquisition['platform']
71
+ aItems.each do |item|
72
+ hReturn = Platform.unpack(item, responseObj, outContext)
73
+ unless hReturn.nil?
74
+ intAcquisition[:platforms] << hReturn
75
+ end
76
+ end
77
+ end
78
+
79
+ if hAcquisition.has_key?('instrument')
80
+ aItems = hAcquisition['instrument']
81
+ aItems.each do |item|
82
+ hReturn = Instrument.unpack(item, responseObj, outContext)
83
+ unless hReturn.nil?
84
+ intAcquisition[:instruments] << hReturn
85
+ end
86
+ end
87
+ end
88
+
89
+ if hAcquisition.has_key?('operation')
90
+ aItems = hAcquisition['operation']
91
+ aItems.each do |item|
92
+ hReturn = Operation.unpack(item, responseObj, outContext)
93
+ unless hReturn.nil?
94
+ intAcquisition[:operations] << hReturn
95
+ end
96
+ end
97
+ end
98
+
99
+ if hAcquisition.has_key?('event')
100
+ aItems = hAcquisition['event']
101
+ aItems.each do |item|
102
+ hReturn = Event.unpack(item, responseObj, outContext)
103
+ unless hReturn.nil?
104
+ intAcquisition[:events] << hReturn
105
+ end
106
+ end
107
+ end
108
+
109
+ if hAcquisition.has_key?('pass')
110
+ aItems = hAcquisition['pass']
111
+ aItems.each do |item|
112
+ hReturn = Pass.unpack(item, responseObj, outContext)
113
+ unless hReturn.nil?
114
+ intAcquisition[:passes] << hReturn
115
+ end
116
+ end
117
+ end
118
+
119
+ if hAcquisition.has_key?('environment')
120
+ intAcquisition[:environment] = Environment.unpack(hAcquisition['environment'], responseObj, outContext)
121
+ end
122
+
123
+ return intAcquisition
124
+
125
+ end
126
+
127
+ end
128
+
129
+ end
130
+ end
131
+ end
132
+ end
133
+
@@ -23,6 +23,11 @@ module ADIWG
23
23
  intConformanceResult[:scope] = Scope.unpack(hConformanceResult['scope'], responseObj)
24
24
  end
25
25
 
26
+ # name
27
+ if hConformanceResult.has_key?('name')
28
+ intConformanceResult[:name] = hConformanceResult['name']
29
+ end
30
+
26
31
  #specification
27
32
  if hConformanceResult.has_key?('specification')
28
33
  intConformanceResult[:specification] = Citation.unpack(hConformanceResult['specification'], responseObj)
@@ -26,6 +26,10 @@ module ADIWG
26
26
  intResult[:scope] = Scope.unpack(hResult['scope'], responseObj)
27
27
  end
28
28
 
29
+ # name
30
+ if hResult.has_key?('name')
31
+ intResult[:name] = hResult['name']
32
+ end
29
33
 
30
34
  # spatialRepresentationType
31
35
  if hResult.has_key?('spatialRepresentationType')
@@ -35,6 +35,13 @@ module ADIWG
35
35
  end
36
36
  end
37
37
 
38
+ if hDataQuality.has_key?('systemIdentifier')
39
+ systemIdentifier = hDataQuality['systemIdentifier']
40
+ intDataQuality[:systemIdentifier] = {}
41
+ intDataQuality[:systemIdentifier][:uid] = systemIdentifier['uid']
42
+ intDataQuality[:systemIdentifier][:label] = systemIdentifier['label']
43
+ end
44
+
38
45
  if hDataQuality.has_key?('standaloneQualityReport')
39
46
  hObject = hDataQuality['standaloneQualityReport']
40
47
  unless hObject.empty?
@@ -25,6 +25,10 @@ module ADIWG
25
25
  intResult[:scope] = Scope.unpack(hResult['scope'], responseObj)
26
26
  end
27
27
 
28
+ if hResult.has_key?('name')
29
+ intResult[:name] = hResult['name']
30
+ end
31
+
28
32
  if hResult.has_key?('statement')
29
33
  intResult[:statement] = hResult['statement']
30
34
  end