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

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/DCAT-US.md +67 -0
  4. data/Gemfile.lock +37 -27
  5. data/README.md +21 -0
  6. data/Rakefile +1 -0
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +1 -1
  8. data/lib/adiwg/mdtranslator/version.rb +1 -1
  9. data/lib/adiwg/mdtranslator/writers/dcat_us/dcat_us_writer.rb +98 -0
  10. data/lib/adiwg/mdtranslator/writers/dcat_us/readme.md +10 -0
  11. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_level.rb +55 -0
  12. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_url.rb +17 -0
  13. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_accrualPeriodicity.rb +45 -0
  14. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_bureau_code.rb +33 -0
  15. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_contact_point.rb +29 -0
  16. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_dcat_us.rb +104 -0
  17. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by.rb +29 -0
  18. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by_type.rb +33 -0
  19. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_description.rb +19 -0
  20. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_distribution.rb +59 -0
  21. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_download_url.rb +17 -0
  22. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_identifier.rb +29 -0
  23. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_is_part_of.rb +27 -0
  24. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_issued.rb +19 -0
  25. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_keyword.rb +19 -0
  26. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_landing_page.rb +27 -0
  27. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_language.rb +23 -0
  28. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_license.rb +18 -0
  29. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_media_type.rb +17 -0
  30. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_modified.rb +29 -0
  31. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_primaryITInvestmentUII.rb +19 -0
  32. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_program_code.rb +33 -0
  33. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_publisher.rb +74 -0
  34. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_references.rb +50 -0
  35. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_rights.rb +32 -0
  36. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_spatial.rb +32 -0
  37. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_system_of_records.rb +28 -0
  38. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_temporal.rb +40 -0
  39. data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_theme.rb +28 -0
  40. data/lib/adiwg/mdtranslator/writers/dcat_us/version.rb +14 -0
  41. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataQuality.rb +1 -1
  42. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQualityReport.rb +0 -28
  43. data/lib/adiwg/mdtranslator_cli.rb +1 -1
  44. metadata +34 -1
@@ -0,0 +1,40 @@
1
+ module ADIWG
2
+ module Mdtranslator
3
+ module Writers
4
+ module Dcat_us
5
+ module Temporal
6
+
7
+ def self.build(intObj)
8
+ resourceInfo = intObj.dig(:metadata, :resourceInfo)
9
+ extent = resourceInfo&.dig(:extents, 0)
10
+ temporalExtents = extent&.dig(:temporalExtents)
11
+
12
+ if temporalExtents
13
+ temporalExtents.each do |temporalExtent|
14
+ timePeriod = temporalExtent&.dig(:timePeriod)
15
+ next unless timePeriod
16
+
17
+ startDateHash = timePeriod[:startDateTime]
18
+ endDateHash = timePeriod[:endDateTime]
19
+
20
+ startDate = startDateHash&.dig(:dateTime)
21
+ endDate = endDateHash&.dig(:dateTime)
22
+
23
+ if startDate && endDate
24
+ return "#{startDate}/#{endDate}"
25
+ elsif startDate
26
+ return startDate
27
+ elsif endDate
28
+ return endDate
29
+ end
30
+ end
31
+ end
32
+
33
+ nil
34
+ end
35
+
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,28 @@
1
+ require 'jbuilder'
2
+
3
+ module ADIWG
4
+ module Mdtranslator
5
+ module Writers
6
+ module Dcat_us
7
+ module Theme
8
+
9
+ def self.build(intObj)
10
+ resourceInfo = intObj[:metadata][:resourceInfo]
11
+ keywords_str = []
12
+
13
+ resourceInfo[:keywords].each do |keyword_group|
14
+ if keyword_group[:thesaurus][:title] == "ISO Topic Categories"
15
+ keyword_group[:keywords].each do |keyword_obj|
16
+ keywords_str << keyword_obj[:keyword]
17
+ end
18
+ end
19
+ end
20
+
21
+ return keywords_str.join(" ")
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,14 @@
1
+ # dcat_us version history
2
+ # Johnathan Aspinwall 2023-06-22 created for mdJson/mdTranslator 2.0
3
+
4
+ module ADIWG
5
+ module Mdtranslator
6
+ module Writers
7
+ module Dcat_us
8
+
9
+ VERSION = '1.0.0'
10
+
11
+ end
12
+ end
13
+ end
14
+ end
@@ -56,7 +56,7 @@ module ADIWG
56
56
 
57
57
  # data quality 2.3 (complete) - completion report (not implemented) (required)
58
58
  completeness_report = hDataQuality[:report].find do |report|
59
- report[:type] == 'CompletenessOmission' &&
59
+ report[:type] == 'Omission' &&
60
60
  !report.dig(:descriptiveResult, 0, :statement).nil?
61
61
  end
62
62
 
@@ -185,13 +185,6 @@ module ADIWG
185
185
  end
186
186
  end
187
187
  end
188
-
189
- # Name
190
- unless result[:name].nil?
191
- @html.em('Name: ')
192
- @html.text!(result[:name])
193
- @html.br
194
- end
195
188
 
196
189
  # Specification (citation)
197
190
  unless result[:specification].empty?
@@ -249,13 +242,6 @@ module ADIWG
249
242
  end
250
243
  end
251
244
 
252
- # Name
253
- unless result[:name].nil?
254
- @html.em('Name: ')
255
- @html.text!(result[:name])
256
- @html.br
257
- end
258
-
259
245
  # SpatialRepresentationType
260
246
  unless result[:spatialRepresentationType].nil?
261
247
  @html.em('Spatial Representation Type: ')
@@ -331,13 +317,6 @@ module ADIWG
331
317
  end
332
318
  end
333
319
  end
334
-
335
- # Name
336
- unless result[:name].nil?
337
- @html.em('Name: ')
338
- @html.text!(result[:name])
339
- @html.br
340
- end
341
320
 
342
321
  # Statement
343
322
  unless result[:statement].nil?
@@ -373,13 +352,6 @@ module ADIWG
373
352
  end
374
353
  end
375
354
  end
376
-
377
- # Name
378
- unless result[:name].nil?
379
- @html.em('Name: ')
380
- @html.text!(result[:name])
381
- @html.br
382
- end
383
355
 
384
356
  # Value
385
357
  unless result[:values].empty?
@@ -39,7 +39,7 @@ and to choose the level of validation for mdJson input files.
39
39
  :enum => %w{mdJson sbJson fgdc}, :required => true
40
40
  method_option :writer, :aliases => '-w',
41
41
  :desc => 'Writer to create your output metadata file, leave blank to validate input only',
42
- :enum => %w{fgdc html iso19110 iso19115_1 iso19115_2 iso19115_3 mdJson sbJson simple_html }
42
+ :enum => %w{fgdc html iso19110 iso19115_1 iso19115_2 iso19115_3 mdJson sbJson simple_html dcat_us}
43
43
  method_option :validate, :aliases => '-v', :desc => 'Specify level of validation to be performed',
44
44
  :enum => %w{none normal strict}, :default => 'normal'
45
45
  method_option :forceValid, :aliases => '-f', :desc => 'Insert tags for required elements missing from input',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adiwg-mdtranslator
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.0.pre.beta.16
4
+ version: 2.20.0.pre.beta.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stan Smith
@@ -232,6 +232,7 @@ files:
232
232
  - ".jsbeautifyrc"
233
233
  - ".travis.yml"
234
234
  - CHANGELOG.md
235
+ - DCAT-US.md
235
236
  - Gemfile
236
237
  - Gemfile.lock
237
238
  - LICENSE.txt
@@ -474,6 +475,38 @@ files:
474
475
  - lib/adiwg/mdtranslator/readers/sbJson/sbJson_reader.rb
475
476
  - lib/adiwg/mdtranslator/readers/sbJson/version.rb
476
477
  - lib/adiwg/mdtranslator/version.rb
478
+ - lib/adiwg/mdtranslator/writers/dcat_us/dcat_us_writer.rb
479
+ - lib/adiwg/mdtranslator/writers/dcat_us/readme.md
480
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_level.rb
481
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_url.rb
482
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_accrualPeriodicity.rb
483
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_bureau_code.rb
484
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_contact_point.rb
485
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_dcat_us.rb
486
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by.rb
487
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by_type.rb
488
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_description.rb
489
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_distribution.rb
490
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_download_url.rb
491
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_identifier.rb
492
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_is_part_of.rb
493
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_issued.rb
494
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_keyword.rb
495
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_landing_page.rb
496
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_language.rb
497
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_license.rb
498
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_media_type.rb
499
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_modified.rb
500
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_primaryITInvestmentUII.rb
501
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_program_code.rb
502
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_publisher.rb
503
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_references.rb
504
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_rights.rb
505
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_spatial.rb
506
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_system_of_records.rb
507
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_temporal.rb
508
+ - lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_theme.rb
509
+ - lib/adiwg/mdtranslator/writers/dcat_us/version.rb
477
510
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_address.rb
478
511
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb
479
512
  - lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb