adiwg-mdtranslator 1.3.0 → 1.4.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.jsbeautifyrc +8 -0
- data/Rakefile +1 -3
- data/adiwg-mdtranslator.gemspec +2 -0
- data/bin/mdtranslator +2 -2
- data/lib/adiwg/mdtranslator.rb +2 -0
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +6 -3
- data/lib/adiwg/mdtranslator/internal/module_geoFormat.rb +183 -190
- data/lib/adiwg/mdtranslator/internal/module_lineString.rb +18 -0
- data/lib/adiwg/mdtranslator/internal/module_point.rb +18 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_contacts.rb +3 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_geographicElement.rb +18 -10
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_additionalDocumentation.rb +52 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_boundingBox.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_browseGraphic.rb +66 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_citation.rb +125 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_contacts.rb +144 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_dateTime.rb +31 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_distributionInfo.rb +64 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_extent.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoCoordSystem.rb +50 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geoProperties.rb +91 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_geographicElement.rb +161 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadata.rb +70 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_metadataInfo.rb +131 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_onlineResource.rb +71 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceIdentifier.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_resourceInfo.rb +437 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_responsibleParty.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/module_sbJson.rb +52 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/modules_v0/version.rb +12 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/readme.md +12 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/sbJson_reader.rb +205 -0
- data/lib/adiwg/mdtranslator/readers/sbJson/sbJson_validator.rb +44 -0
- data/lib/adiwg/mdtranslator/version.rb +1 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_browseGraphic.rb +2 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiGeometry.rb +5 -5
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/mdJson_writer.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/readme.md +19 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_additionalDoc.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_address.rb +22 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_associatedResource.rb +22 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_attribute.rb +27 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_base.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_citation.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_constraint.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_contact.rb +31 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageInfo.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_coverageItem.rb +44 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dataQuality.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dateTime.rb +18 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_distributionInfo.rb +31 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domain.rb +25 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_extent.rb +26 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_format.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_geographicElement.rb +81 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_graphicOverview.rb +20 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_gridInfo.rb +27 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_imageInfo.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_keyword.rb +20 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_locale.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadataInfo.rb +36 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_onlineResource.rb +21 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_phone.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_processStep.rb +25 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceIdentifier.rb +23 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +69 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceMaintenance.rb +23 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_responsibleParty.rb +18 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_spatialreference.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxon.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomy.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_temporalElement.rb +38 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_timePeriod.rb +20 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_transferOption.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_usage.rb +23 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_verticalElement.rb +20 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/version.rb +13 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/readme.md +12 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sbJson_writer.rb +126 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_base.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_contact.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_identifier.rb +22 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_spatial.rb +49 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/version.rb +13 -0
- data/test/readers/mdJson/v1/tc_reader_mdjson_translation.rb +83 -0
- data/test/readers/sbJson/v0/tc_reader_sbjson_translation.rb +79 -0
- data/test/readers/sbJson/v0/test.json +431 -0
- data/test/readers/sbJson/v0/test1.json +383 -0
- data/test/writers/mdJson/v1/tc_writer_mdJson.rb +60 -0
- data/test/writers/sbJson/v0/tc_writer_sbJson.rb +60 -0
- metadata +121 -7
- data/test/readers/mdJson/v1/tc_translation_19115_2.rb +0 -67
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module MdJson
|
7
|
+
module Domain
|
8
|
+
def self.build(intObj)
|
9
|
+
Jbuilder.new do |json|
|
10
|
+
json.domainId(intObj[:domainId])
|
11
|
+
json.commonName intObj[:domainName]
|
12
|
+
json.codeName intObj[:domainCode]
|
13
|
+
json.description intObj[:domainDescription]
|
14
|
+
json.member(intObj[:domainItems]) do |mem|
|
15
|
+
json.name mem[:itemName]
|
16
|
+
json.value mem[:itemValue]
|
17
|
+
json.definition mem[:itemDefinition]
|
18
|
+
end unless intObj[:domainItems].empty?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_base'
|
3
|
+
require_relative 'mdJson_attribute'
|
4
|
+
|
5
|
+
module ADIWG
|
6
|
+
module Mdtranslator
|
7
|
+
module Writers
|
8
|
+
module MdJson
|
9
|
+
module Entity
|
10
|
+
extend MdJson::Base
|
11
|
+
|
12
|
+
def self.build(intObj)
|
13
|
+
Jbuilder.new do |json|
|
14
|
+
json.entityId intObj[:entityId]
|
15
|
+
json.commonName intObj[:entityName]
|
16
|
+
json.codeName intObj[:entityCode]
|
17
|
+
json.alias intObj[:entityAlias]
|
18
|
+
json.definition intObj[:entityDefinition]
|
19
|
+
json.primaryKeyAttributeCodeName (intObj[:primaryKey])
|
20
|
+
json.index(intObj[:indexes]) do |idx|
|
21
|
+
json.codeName idx[:indexCode]
|
22
|
+
json.allowDuplicates idx[:duplicate]
|
23
|
+
json.attributeCodeName (idx[:attributeNames])
|
24
|
+
end unless intObj[:indexes].empty?
|
25
|
+
json.attribute json_map(intObj[:attributes], Attribute)
|
26
|
+
json.foreignKey(intObj[:foreignKeys]) do |fk|
|
27
|
+
json.localAttributeCodeName(fk[:fkLocalAttributes])
|
28
|
+
json.referencedEntityCodeName fk[:fkReferencedEntity]
|
29
|
+
json.referencedAttributeCodeName(fk[:fkReferencedAttributes])
|
30
|
+
end unless intObj[:foreignKeys].empty?
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_base'
|
3
|
+
require_relative 'mdJson_geographicElement'
|
4
|
+
|
5
|
+
module ADIWG
|
6
|
+
module Mdtranslator
|
7
|
+
module Writers
|
8
|
+
module MdJson
|
9
|
+
module Extent
|
10
|
+
extend MdJson::Base
|
11
|
+
|
12
|
+
def self.build(intObj)
|
13
|
+
Jbuilder.new do |json|
|
14
|
+
json.description intObj[:extDesc]
|
15
|
+
json.geographicElement(intObj[:extGeoElements]) do |ge|
|
16
|
+
json.merge! GeographicElement.build(ge)
|
17
|
+
end unless intObj[:extGeoElements].empty?
|
18
|
+
json.temporalElement TemporalElement.build(intObj[:extTempElements])
|
19
|
+
json.verticalElement json_map(intObj[:extVertElements], VerticalElement)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module MdJson
|
7
|
+
module Format
|
8
|
+
def self.build(intObj)
|
9
|
+
Jbuilder.new do |json|
|
10
|
+
json.formatName intObj[:formatName]
|
11
|
+
json.version intObj[:formatVersion]
|
12
|
+
json.compressionMethod intObj[:compressionMethod] unless intObj[:compressionMethod].nil?
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_base'
|
3
|
+
require_relative 'mdJson_resourceIdentifier'
|
4
|
+
require_relative 'mdJson_temporalElement'
|
5
|
+
require_relative 'mdJson_verticalElement'
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module MdJson
|
11
|
+
module GeographicElement
|
12
|
+
extend MdJson::Base
|
13
|
+
|
14
|
+
def self.build(intObj)
|
15
|
+
geo = AdiwgGeoFormat.internal_to_geoJson(intObj, false)
|
16
|
+
|
17
|
+
case intObj[:elementType]
|
18
|
+
when 'GeometryCollection'
|
19
|
+
geo[:type] = intObj[:elementType]
|
20
|
+
|
21
|
+
geo[:geometries] = []
|
22
|
+
intObj[:elementGeometry][:geometry].each do |geom|
|
23
|
+
geo[:geometries] << AdiwgGeoFormat.internal_to_geoJson(geom, false)
|
24
|
+
end
|
25
|
+
|
26
|
+
when 'FeatureCollection'
|
27
|
+
geo[:type] = intObj[:elementType]
|
28
|
+
fc = build_feature(geo, intObj)
|
29
|
+
fc[:features] = []
|
30
|
+
intObj[:elementGeometry][:geometry].each do |fea|
|
31
|
+
feaGeo = AdiwgGeoFormat.internal_to_geoJson(fea, false)
|
32
|
+
fc[:features] << build_feature(feaGeo, fea)
|
33
|
+
end
|
34
|
+
geo = fc
|
35
|
+
|
36
|
+
when 'BBOX'
|
37
|
+
geo[:type] = 'Feature'
|
38
|
+
|
39
|
+
when 'Feature'
|
40
|
+
geo = build_feature(geo, intObj)
|
41
|
+
end
|
42
|
+
|
43
|
+
geo[:bbox] = build_bbox(intObj[:bbox]) if intObj.include?(:bbox)
|
44
|
+
geo
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.build_feature(geom, obj)
|
48
|
+
j = Jbuilder.new do |json|
|
49
|
+
json.type obj[:elementType]
|
50
|
+
json.id obj[:elementId]
|
51
|
+
json.geometry geom unless geom[:type] == 'FeatureCollection'
|
52
|
+
json.crs obj[:elementSrs].empty? ? geom[:crs] : nil
|
53
|
+
json.properties do
|
54
|
+
json.includesData obj[:elementIncludeData]
|
55
|
+
json.temporalElement TemporalElement.build(obj[:temporalElements])
|
56
|
+
json.verticalElement json_map(obj[:verticalElements], VerticalElement)
|
57
|
+
json.description obj[:elementDescription]
|
58
|
+
json.featureName obj[:elementName]
|
59
|
+
json.featureScope obj[:elementScope]
|
60
|
+
json.featureAcquisitionMethod obj[:elementAcquisition]
|
61
|
+
json.identifier json_map(obj[:elementIdentifiers], ResourceIdentifier)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
j.attributes!
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.build_bbox(box)
|
69
|
+
coor = box[:geometry]
|
70
|
+
[
|
71
|
+
[coor[:westLong], coor[:eastLong]].min,
|
72
|
+
[coor[:northLat], coor[:southLat]].min,
|
73
|
+
[coor[:westLong], coor[:eastLong]].max,
|
74
|
+
[coor[:northLat], coor[:southLat]].max
|
75
|
+
]
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module MdJson
|
7
|
+
module GraphicOverview
|
8
|
+
def self.build(intObj)
|
9
|
+
Jbuilder.new do |json|
|
10
|
+
json.fileName (intObj[:bGName])
|
11
|
+
json.fileDescription (intObj[:bGDescription])
|
12
|
+
json.fileType (intObj[:bGType])
|
13
|
+
json.fileUri (intObj[:bGURI])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module MdJson
|
7
|
+
module GridInfo
|
8
|
+
def self.build(intObj)
|
9
|
+
Jbuilder.new do |json|
|
10
|
+
json.numberOfDimensions intObj[:dimensions]
|
11
|
+
json.dimension(intObj[:dimensionInfo]) do |dim|
|
12
|
+
json.dimensionType dim[:dimensionType]
|
13
|
+
json.dimensionSize dim[:dimensionSize]
|
14
|
+
json.resolution dim[:resolution]
|
15
|
+
json.resolutionUnit dim[:resolutionUnits]
|
16
|
+
json.dimensionTitle dim[:dimensionTitle]
|
17
|
+
json.dimensionDescription dim[:dimensionDescription]
|
18
|
+
end
|
19
|
+
json.cellGeometry intObj[:dimensionGeometry]
|
20
|
+
json.transformationParameterAvailability intObj[:dimensionTransformParams]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_resourceIdentifier'
|
3
|
+
|
4
|
+
module ADIWG
|
5
|
+
module Mdtranslator
|
6
|
+
module Writers
|
7
|
+
module MdJson
|
8
|
+
module ImageInfo
|
9
|
+
def self.build(intObj)
|
10
|
+
Jbuilder.new do |json|
|
11
|
+
json.illuminationElevationAngle intObj[:illuminationElevationAngle]
|
12
|
+
json.illuminationAzimuthAngle intObj[:illuminationAzimuthAngle]
|
13
|
+
json.imagingCondition intObj[:imagingCondition]
|
14
|
+
json.imageQuality ResourceIdentifier.build(intObj[:imageQuality]) unless intObj[:imageQuality].empty?
|
15
|
+
json.cloudCoverPercent intObj[:cloudCoverPercent]
|
16
|
+
json.compressionQuantity intObj[:coverageDescription]
|
17
|
+
json.triangulationIndicator intObj[:triangulationInfo]
|
18
|
+
json.radiometricCalibrationAvailable intObj[:radiometricCalibrationInfo]
|
19
|
+
json.cameraCalibrationAvailable intObj[:cameraCalibrationInfo]
|
20
|
+
json.filmDistortionAvailable intObj[:filmDistortionInfo]
|
21
|
+
json.lensDistortionAvailable intObj[:lensDistortionInfo]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_citation'
|
3
|
+
|
4
|
+
module ADIWG
|
5
|
+
module Mdtranslator
|
6
|
+
module Writers
|
7
|
+
module MdJson
|
8
|
+
module Keyword
|
9
|
+
def self.build(item)
|
10
|
+
Jbuilder.new do |json|
|
11
|
+
json.keyword (item[:keyword])
|
12
|
+
json.keywordType item[:keywordType]
|
13
|
+
json.thesaurus Citation.build(item[:keyTheCitation])
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module MdJson
|
7
|
+
module Locale
|
8
|
+
def self.build(intObj)
|
9
|
+
Jbuilder.new do |json|
|
10
|
+
json.language intObj[:languageCode]
|
11
|
+
json.country intObj[:countryCode]
|
12
|
+
json.characterSet intObj[:characterEncoding]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
require_relative 'mdJson_base'
|
4
|
+
require_relative 'mdJson_metadataInfo'
|
5
|
+
require_relative 'mdJson_resourceInfo'
|
6
|
+
require_relative 'mdJson_distributionInfo'
|
7
|
+
require_relative 'mdJson_associatedResource'
|
8
|
+
require_relative 'mdJson_additionalDoc'
|
9
|
+
|
10
|
+
module ADIWG
|
11
|
+
module Mdtranslator
|
12
|
+
module Writers
|
13
|
+
module MdJson
|
14
|
+
module Metadata
|
15
|
+
extend MdJson::Base
|
16
|
+
|
17
|
+
def self.build(metadata)
|
18
|
+
Jbuilder.new do |json|
|
19
|
+
json.metadataInfo MetadataInfo.build(metadata[:metadataInfo])
|
20
|
+
json.resourceInfo ResourceInfo.build(metadata[:resourceInfo])
|
21
|
+
json.distributionInfo json_map(metadata[:distributorInfo], DistributionInfo)
|
22
|
+
json.associatedResource json_map(metadata[:associatedResources], AssociatedResource)
|
23
|
+
json.additionalDocumentation json_map(metadata[:additionalDocuments], AdditionalDoc)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_base'
|
3
|
+
require_relative 'mdJson_citation'
|
4
|
+
require_relative 'mdJson_resourceIdentifier'
|
5
|
+
require_relative 'mdJson_responsibleParty'
|
6
|
+
require_relative 'mdJson_locale'
|
7
|
+
require_relative 'mdJson_resourceMaintenance'
|
8
|
+
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Writers
|
12
|
+
module MdJson
|
13
|
+
module MetadataInfo
|
14
|
+
extend MdJson::Base
|
15
|
+
|
16
|
+
def self.build(_info)
|
17
|
+
Jbuilder.new do |json|
|
18
|
+
unless _info[:metadataId].nil?
|
19
|
+
json.metadataIdentifier ResourceIdentifier.build(_info[:metadataId])
|
20
|
+
json.parentMetadata Citation.build(_info[:parentMetadata])
|
21
|
+
json.metadataContact json_map(_info[:metadataCustodians], ResponsibleParty)
|
22
|
+
json.metadataCharacterSet _info[:metadataCharacterSet]
|
23
|
+
json.metadataLocales json_map(_info[:metadataLocales], Locale)
|
24
|
+
json.metadataCreationDate _info[:metadataCreateDate][:dateTime]
|
25
|
+
json.metadataLastUpdate _info[:metadataUpdateDate][:dateTime]
|
26
|
+
json.metadataUri _info[:metadataURI]
|
27
|
+
json.metadataStatus _info[:metadataStatus]
|
28
|
+
json.metadataMaintenance ResourceMaintenance.build( _info[:maintInfo])
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module MdJson
|
7
|
+
module OnlineResource
|
8
|
+
def self.build(intObj)
|
9
|
+
Jbuilder.new do |json|
|
10
|
+
json.uri intObj[:olResURI]
|
11
|
+
json.protocol intObj[:olResProtocol]
|
12
|
+
json.name intObj[:olResName]
|
13
|
+
json.description intObj[:olResDesc]
|
14
|
+
json.function intObj[:olResFunction]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module MdJson
|
7
|
+
module Phone
|
8
|
+
def self.build(intObj)
|
9
|
+
Jbuilder.new do |json|
|
10
|
+
json.phoneName intObj[:phoneName]
|
11
|
+
json.phoneNumber intObj[:phoneNumber]
|
12
|
+
json.service([intObj[:phoneServiceType]])
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_base'
|
3
|
+
require_relative 'mdJson_responsibleParty'
|
4
|
+
|
5
|
+
module ADIWG
|
6
|
+
module Mdtranslator
|
7
|
+
module Writers
|
8
|
+
module MdJson
|
9
|
+
module ProcessStep
|
10
|
+
extend MdJson::Base
|
11
|
+
|
12
|
+
def self.build(intObj)
|
13
|
+
Jbuilder.new do |json|
|
14
|
+
json.stepId intObj[:stepId]
|
15
|
+
json.description intObj[:stepDescription]
|
16
|
+
json.rationale intObj[:stepRationale]
|
17
|
+
json.dateTime intObj[:stepDateTime][:dateTime] unless intObj[:stepDateTime].empty?
|
18
|
+
json.processor json_map(intObj[:stepProcessors], ResponsibleParty)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|