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.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/Gemfile.lock +12 -10
- data/README.md +0 -21
- data/Rakefile +0 -1
- data/adiwg-mdtranslator.gemspec +2 -2
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +45 -7
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dataQuality.rb +103 -59
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_acquisition.rb +133 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_conformanceResult.rb +5 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageResult.rb +4 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataQuality.rb +7 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_descriptiveResult.rb +4 -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_quantitativeResult.rb +4 -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/fgdc/classes/class_dataQuality.rb +101 -31
- 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_dataQuality.rb +17 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataQualityReport.rb +28 -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/iso19115_3/classes/class_dataIdentification.rb +29 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_dataQualityReport.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_gcoDateTime.rb +10 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_acquisition.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_conformanceResult.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageResult.rb +1 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_descriptiveResult.rb +1 -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_onlineResource.rb +1 -1
- 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_quantitativeResult.rb +6 -5
- 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_resourceInfo.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_revision.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_citation.rb +9 -26
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_dataQuality.rb +1 -1
- data/lib/adiwg/mdtranslator_cli.rb +1 -1
- metadata +48 -39
- 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
@@ -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
|