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
@@ -1,32 +0,0 @@
1
- module ADIWG
2
- module Mdtranslator
3
- module Writers
4
- module Dcat_us
5
- module Rights
6
-
7
- def self.build(intObj, accessLevel)
8
- resourceInfo = intObj.dig(:metadata, :resourceInfo)
9
- constraints = resourceInfo&.dig(:constraints)
10
-
11
- if accessLevel && ["restricted public", "non-public"].include?(accessLevel)
12
- constraints&.each do |constraint|
13
- if constraint[:type] == "use"
14
- statement = constraint.dig(:releasability, :statement)
15
- disseminationConstraints = constraint.dig(:releasability, :disseminationConstraint)
16
-
17
- if statement && disseminationConstraints
18
- combinedConstraints = disseminationConstraints.join(" ")
19
- return "#{statement} #{combinedConstraints}".strip
20
- end
21
- end
22
- end
23
- end
24
-
25
- nil
26
- end
27
-
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,32 +0,0 @@
1
- module ADIWG
2
- module Mdtranslator
3
- module Writers
4
- module Dcat_us
5
- module Spatial
6
-
7
- def self.build(intObj)
8
- resourceInfo = intObj.dig(:metadata, :resourceInfo)
9
- extent = resourceInfo&.dig(:extents, 0)
10
- geographicExtent = extent&.dig(:geographicExtents, 0)
11
- boundingBox = geographicExtent&.dig(:boundingBox)
12
-
13
- if boundingBox
14
- return [
15
- boundingBox[:eastLongitude],
16
- boundingBox[:southLatitude],
17
- boundingBox[:westLongitude],
18
- boundingBox[:northLatitude]
19
- ].join(',')
20
- elsif geographicExtent&.dig(:geographicElement, 0, :type) == 'point'
21
- point = geographicExtent.dig(:geographicElement, 0, :coordinate)
22
- return "#{point[1]},#{point[0]}" if point&.length == 2
23
- end
24
-
25
- nil
26
- end
27
-
28
- end
29
- end
30
- end
31
- end
32
- end
@@ -1,28 +0,0 @@
1
- require 'jbuilder'
2
-
3
- module ADIWG
4
- module Mdtranslator
5
- module Writers
6
- module Dcat_us
7
- module SystemOfRecords
8
-
9
- def self.build(intObj)
10
- associatedResources = intObj.dig(:metadata, :associatedResources)
11
-
12
- return nil if associatedResources.nil?
13
-
14
- associatedResources.each do |resource|
15
- if resource[:initiativeType] == 'sorn'
16
- onlineResources = resource.dig(:resourceCitation, :onlineResources)
17
- return onlineResources.first[:olResURI] if onlineResources&.first&.has_key?(:olResURI)
18
- end
19
- end
20
-
21
- return nil
22
- end
23
-
24
- end
25
- end
26
- end
27
- end
28
- end
@@ -1,40 +0,0 @@
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
@@ -1,28 +0,0 @@
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
@@ -1,14 +0,0 @@
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