adiwg-mdtranslator 0.9.0 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -6
- data/adiwg-mdtranslator.gemspec +2 -2
- data/bin/mdtranslator +10 -10
- data/lib/adiwg/mdtranslator.rb +54 -12
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +87 -7
- data/lib/adiwg/mdtranslator/readers/{adiwgJson/adiwgJson_reader.rb → mdJson/mdJson_reader.rb} +13 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson/adiwgJson_validator.rb → mdJson/mdJson_validator.rb} +18 -10
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_additionalDocumentation.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_address.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_associatedResource.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_boundingBox.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_browseGraphic.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_citation.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_contacts.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_coordinates.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataDictionary.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_dataQuality.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_dateTime.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_descriptiveKeyword.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dictionaryInfo.rb +52 -0
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_distributionInfo.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domain.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domainItem.rb +42 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entity.rb +92 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityAttribute.rb +91 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityForeignKey.rb +43 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityIndex.rb +42 -0
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_extent.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_geoCoordSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_geoProperties.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_geographicElement.rb +12 -12
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_legalConstraint.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_lineString.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_lineage.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_metadata.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_metadataExtension.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_metadataInfo.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_onlineResource.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_phone.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_point.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_polygon.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_processStep.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resolution.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceFormat.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceIdentifier.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceInfo.rb +16 -16
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceMaintenance.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceSpecificUsage.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_responsibleParty.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_securityConstraint.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_source.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_spatialReference.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_taxonClass.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_taxonomy.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_temporalElement.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_timeInstant.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_timePeriod.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_verticalElement.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_voucher.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +19 -0
- data/lib/adiwg/mdtranslator/version.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_FCfeatureCatalogue.rb +171 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2/classes/class_metadata.rb → iso/classes/class_MImetadata.rb} +3 -3
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_address.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_aggregateInformation.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_boundingPolygon.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_browseGraphic.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_citation.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_contact.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_dataIdentification.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_dataQuality.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_date.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_digitalTransferOptions.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_distribution.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_distributor.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_extent.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +114 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureConstraint.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +120 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_format.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_genericMetaData.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_geographicBoundingBox.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_geographicDescription.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_geographicElement.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_identifier.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_keyword.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_legalConstraints.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_lineString.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_lineage.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_listedValue.rb +68 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_maintenanceInformation.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_medium.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_metadataExtension.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_multiGeometry.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiplicity.rb +44 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_onlineResource.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_point.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_polygon.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_processStep.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_referenceIdentifier.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_referenceSystem.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_resolution.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_responsibleParty.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_securityConstraints.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_source.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_standardOrderProcess.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_taxonClassification.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_taxonSystem.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_telephone.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_temporalExtent.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_timeInstant.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_timePeriod.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_usage.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_useConstraints.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_verticalExtent.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_vouchers.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_associationType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_characterSet.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_classification.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_datatype.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_dateType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_initiativeType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_keywordType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_maintenanceFrequency.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_mediumFormat.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_mediumName.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_obligation.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_onlineFunction.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_presentationForm.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_progress.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_restriction.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_role.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_scope.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_spatialRepresentationType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_topicCategory.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_baseUnit.rb +27 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_conventionalUnit.rb +53 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_definitionUnit.rb +24 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb +31 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_unitsOfMeasure.rb +224 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/readme.md +13 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/readme.md +6 -9
- data/test/tc_translation.rb +35 -18
- metadata +166 -146
- data/lib/adiwg/mdtranslator/readers/adiwgJson/readme.md +0 -19
- data/mdtranslator.rb +0 -187
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
8
8
|
|
9
|
-
module
|
9
|
+
module Md_AdditionalDocumentation
|
10
10
|
|
11
11
|
def self.unpack(hAddDoc)
|
12
12
|
|
@@ -26,7 +26,7 @@ module Adiwg_AdditionalDocumentation
|
|
26
26
|
if hAddDoc.has_key?('citation')
|
27
27
|
hCitation = hAddDoc['citation']
|
28
28
|
unless hCitation.empty?
|
29
|
-
intAddDoc[:citation] =
|
29
|
+
intAddDoc[:citation] = Md_Citation.unpack(hCitation)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_associatedResource.rb
RENAMED
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
14
14
|
|
15
|
-
module
|
15
|
+
module Md_AssociatedResource
|
16
16
|
|
17
17
|
def self.unpack(hAssocRes)
|
18
18
|
|
@@ -48,7 +48,7 @@ module Adiwg_AssociatedResource
|
|
48
48
|
if hAssocRes.has_key?('resourceCitation')
|
49
49
|
hCitation = hAssocRes['resourceCitation']
|
50
50
|
unless hCitation.empty?
|
51
|
-
intAssocRes[:resourceCitation] =
|
51
|
+
intAssocRes[:resourceCitation] = Md_Citation.unpack(hCitation)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -56,7 +56,7 @@ module Adiwg_AssociatedResource
|
|
56
56
|
if hAssocRes.has_key?('metadataCitation')
|
57
57
|
hCitation = hAssocRes['metadataCitation']
|
58
58
|
unless hCitation.empty?
|
59
|
-
intAssocRes[:metadataCitation] =
|
59
|
+
intAssocRes[:metadataCitation] = Md_Citation.unpack(hCitation)
|
60
60
|
end
|
61
61
|
end
|
62
62
|
|
@@ -12,7 +12,7 @@ require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:
|
|
12
12
|
require ADIWG::Mdtranslator.reader_module('module_onlineResource', $response[:readerVersionUsed])
|
13
13
|
require ADIWG::Mdtranslator.reader_module('module_resourceIdentifier', $response[:readerVersionUsed])
|
14
14
|
|
15
|
-
module
|
15
|
+
module Md_Citation
|
16
16
|
|
17
17
|
def self.unpack(hCitation)
|
18
18
|
|
@@ -36,7 +36,7 @@ module Adiwg_Citation
|
|
36
36
|
if hCitDate.has_key?('date')
|
37
37
|
s = hCitDate['date']
|
38
38
|
if s != ''
|
39
|
-
intDateTime =
|
39
|
+
intDateTime = Md_DateTime.unpack(s)
|
40
40
|
if hCitDate.has_key?('dateType')
|
41
41
|
s = hCitDate['dateType']
|
42
42
|
if s != ''
|
@@ -63,7 +63,7 @@ module Adiwg_Citation
|
|
63
63
|
aRParty = hCitation['responsibleParty']
|
64
64
|
unless aRParty.empty?
|
65
65
|
aRParty.each do |hRParty|
|
66
|
-
intCitation[:citResponsibleParty] <<
|
66
|
+
intCitation[:citResponsibleParty] << Md_ResponsibleParty.unpack(hRParty)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
@@ -83,7 +83,7 @@ module Adiwg_Citation
|
|
83
83
|
aResIds = hCitation['identifier']
|
84
84
|
aResIds.each do |hIdentifier|
|
85
85
|
unless hIdentifier.empty?
|
86
|
-
intCitation[:
|
86
|
+
intCitation[:citResourceIds] << Md_ResourceIdentifier.unpack(hIdentifier)
|
87
87
|
end
|
88
88
|
end
|
89
89
|
end
|
@@ -93,7 +93,7 @@ module Adiwg_Citation
|
|
93
93
|
aOlRes = hCitation['onlineResource']
|
94
94
|
aOlRes.each do |hOlRes|
|
95
95
|
unless hOlRes.empty?
|
96
|
-
intCitation[:citOlResources] <<
|
96
|
+
intCitation[:citOlResources] << Md_OnlineResource.unpack(hOlRes)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|
@@ -14,7 +14,7 @@ require ADIWG::Mdtranslator.reader_module('module_address', $response[:readerVer
|
|
14
14
|
require ADIWG::Mdtranslator.reader_module('module_onlineResource', $response[:readerVersionUsed])
|
15
15
|
require ADIWG::Mdtranslator.reader_module('module_phone', $response[:readerVersionUsed])
|
16
16
|
|
17
|
-
module
|
17
|
+
module Md_Contact
|
18
18
|
|
19
19
|
def self.unpack(hContact)
|
20
20
|
|
@@ -26,7 +26,7 @@ module Adiwg_Contact
|
|
26
26
|
if hContact.has_key?('contactId')
|
27
27
|
s = hContact['contactId']
|
28
28
|
if s != ''
|
29
|
-
intCont[:
|
29
|
+
intCont[:contactId] = s
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -59,7 +59,7 @@ module Adiwg_Contact
|
|
59
59
|
aOlRes = hContact['onlineResource']
|
60
60
|
aOlRes.each do |hOlRes|
|
61
61
|
unless hOlRes.empty?
|
62
|
-
intCont[:onlineRes] <<
|
62
|
+
intCont[:onlineRes] << Md_OnlineResource.unpack(hOlRes)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
@@ -76,14 +76,14 @@ module Adiwg_Contact
|
|
76
76
|
if hContact.has_key?('phoneBook')
|
77
77
|
aPhones = hContact['phoneBook']
|
78
78
|
aPhones.each do |hPhone|
|
79
|
-
intCont[:phones].concat(
|
79
|
+
intCont[:phones].concat(Md_Phone.unpack(hPhone))
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
83
|
# address
|
84
84
|
if hContact.has_key?('address')
|
85
85
|
conAddress = hContact['address']
|
86
|
-
intCont[:address] =
|
86
|
+
intCont[:address] = Md_Address.unpack(conAddress)
|
87
87
|
end
|
88
88
|
|
89
89
|
return intCont
|
@@ -98,13 +98,13 @@ module Adiwg_Contact
|
|
98
98
|
|
99
99
|
# contact to support biological extensions
|
100
100
|
intCont = intMetadataClass.newContact
|
101
|
-
intCont[:
|
101
|
+
intCont[:contactId] = 'ADIwgBio'
|
102
102
|
intCont[:orgName] = 'National Biological Information Infrastructure (NBII)'
|
103
103
|
aDefContacts << intCont
|
104
104
|
|
105
105
|
# contact to support doi (digital object identifier)
|
106
106
|
intCont = intMetadataClass.newContact
|
107
|
-
intCont[:
|
107
|
+
intCont[:contactId] = 'ADIwgDOI'
|
108
108
|
intCont[:orgName] = 'International DOI Foundation (IDF)'
|
109
109
|
|
110
110
|
intOlRes = intMetadataClass.newOnlineResource
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# unpack a data dictionary
|
2
|
+
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2014-12-01 original script
|
6
|
+
|
7
|
+
require ADIWG::Mdtranslator.reader_module('module_dictionaryInfo', $response[:readerVersionUsed])
|
8
|
+
require ADIWG::Mdtranslator.reader_module('module_domain', $response[:readerVersionUsed])
|
9
|
+
require ADIWG::Mdtranslator.reader_module('module_entity', $response[:readerVersionUsed])
|
10
|
+
|
11
|
+
module Md_DataDictionary
|
12
|
+
|
13
|
+
def self.unpack(hDictionary)
|
14
|
+
|
15
|
+
# instance classes needed in script
|
16
|
+
intMetadataClass = InternalMetadata.new
|
17
|
+
intDict = intMetadataClass.newDataDictionary
|
18
|
+
|
19
|
+
unless hDictionary.empty?
|
20
|
+
|
21
|
+
# data dictionary - dictionary information
|
22
|
+
if hDictionary.has_key?('dictionaryInfo')
|
23
|
+
hDictInfo = hDictionary['dictionaryInfo']
|
24
|
+
intDict[:dictionaryInfo] = Md_DictionaryInfo.unpack(hDictInfo)
|
25
|
+
end
|
26
|
+
|
27
|
+
# data dictionary - domains
|
28
|
+
if hDictionary.has_key?('domain')
|
29
|
+
aDomains = hDictionary['domain']
|
30
|
+
aDomains.each do |hDomain|
|
31
|
+
unless hDomain.empty?
|
32
|
+
intDict[:domains] << Md_Domain.unpack(hDomain)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
# data dictionary - entity
|
38
|
+
if hDictionary.has_key?('entity')
|
39
|
+
aEntities = hDictionary['entity']
|
40
|
+
aEntities.each do |hEntity|
|
41
|
+
unless hEntity.empty?
|
42
|
+
intDict[:entities] << Md_Entity.unpack(hEntity)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
return intDict
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_dataQuality.rb
RENAMED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
require ADIWG::Mdtranslator.reader_module('module_lineage', $response[:readerVersionUsed])
|
9
9
|
|
10
|
-
module
|
10
|
+
module Md_DataQuality
|
11
11
|
|
12
12
|
def self.unpack(hDataQual)
|
13
13
|
|
@@ -30,7 +30,7 @@ module Adiwg_DataQuality
|
|
30
30
|
if hDataQual.has_key?('lineage')
|
31
31
|
hLineage = hDataQual['lineage']
|
32
32
|
unless hLineage.empty?
|
33
|
-
intDataQual[:dataLineage] =
|
33
|
+
intDataQual[:dataLineage] = Md_Lineage.unpack(hLineage)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_descriptiveKeyword.rb
RENAMED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
12
12
|
|
13
|
-
module
|
13
|
+
module Md_DescriptiveKeyword
|
14
14
|
|
15
15
|
def self.unpack(hDesKeyword)
|
16
16
|
|
@@ -38,7 +38,7 @@ module Adiwg_DescriptiveKeyword
|
|
38
38
|
if hDesKeyword.has_key?('thesaurus')
|
39
39
|
hCitation = hDesKeyword['thesaurus']
|
40
40
|
unless hCitation.empty?
|
41
|
-
intKeyword[:keyTheCitation] =
|
41
|
+
intKeyword[:keyTheCitation] = Md_Citation.unpack(hCitation)
|
42
42
|
end
|
43
43
|
|
44
44
|
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# unpack data dictionary information section
|
2
|
+
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2013-12-01 original script
|
6
|
+
|
7
|
+
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
8
|
+
|
9
|
+
module Md_DictionaryInfo
|
10
|
+
|
11
|
+
def self.unpack(hDictInfo)
|
12
|
+
|
13
|
+
# instance classes needed in script
|
14
|
+
intMetadataClass = InternalMetadata.new
|
15
|
+
intDictInfo = intMetadataClass.newDictionaryInfo
|
16
|
+
|
17
|
+
# dictionary info - citation
|
18
|
+
if hDictInfo.has_key?('citation')
|
19
|
+
hCitation = hDictInfo['citation']
|
20
|
+
unless hCitation.empty?
|
21
|
+
intDictInfo[:dictCitation] = Md_Citation.unpack(hCitation)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# dictionary info - description
|
26
|
+
if hDictInfo.has_key?('description')
|
27
|
+
s = hDictInfo['description']
|
28
|
+
if s != ''
|
29
|
+
intDictInfo[:dictDescription] = s
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# dictionary info - resource type
|
34
|
+
if hDictInfo.has_key?('resourceType')
|
35
|
+
s = hDictInfo['resourceType']
|
36
|
+
if s != ''
|
37
|
+
intDictInfo[:dictResourceType] = s
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# dictionary info - language
|
42
|
+
if hDictInfo.has_key?('language')
|
43
|
+
s = hDictInfo['language']
|
44
|
+
if s != ''
|
45
|
+
intDictInfo[:dictLanguage] = s
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
return intDictInfo
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_distributionInfo.rb
RENAMED
@@ -12,7 +12,7 @@ require ADIWG::Mdtranslator.reader_module('module_onlineResource', $response[:re
|
|
12
12
|
require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVersionUsed])
|
13
13
|
require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
|
14
14
|
|
15
|
-
module
|
15
|
+
module Md_DistributionInfo
|
16
16
|
|
17
17
|
def self.unpack(hDistributor)
|
18
18
|
|
@@ -24,7 +24,7 @@ module Adiwg_DistributionInfo
|
|
24
24
|
if hDistributor.has_key?('distributorContact')
|
25
25
|
hContact = hDistributor['distributorContact']
|
26
26
|
unless hContact.empty?
|
27
|
-
intDistributor[:distContact] =
|
27
|
+
intDistributor[:distContact] = Md_ResponsibleParty.unpack(hContact)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -46,7 +46,7 @@ module Adiwg_DistributionInfo
|
|
46
46
|
if distOrderProcess.has_key?('plannedAvailabilityDateTime')
|
47
47
|
s = distOrderProcess['plannedAvailabilityDateTime']
|
48
48
|
if s != ''
|
49
|
-
intDistOrder[:plannedDateTime] =
|
49
|
+
intDistOrder[:plannedDateTime] = Md_DateTime.unpack(s)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -108,7 +108,7 @@ module Adiwg_DistributionInfo
|
|
108
108
|
if distTransOpt.has_key?('online')
|
109
109
|
aOnlineOption = distTransOpt['online']
|
110
110
|
aOnlineOption.each do |hOlOption|
|
111
|
-
intTransOpt[:online] <<
|
111
|
+
intTransOpt[:online] << Md_OnlineResource.unpack(hOlOption)
|
112
112
|
end
|
113
113
|
end
|
114
114
|
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# unpack a data dictionary domain
|
2
|
+
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2013-12-01 original script
|
6
|
+
|
7
|
+
require ADIWG::Mdtranslator.reader_module('module_domainItem', $response[:readerVersionUsed])
|
8
|
+
|
9
|
+
module Md_Domain
|
10
|
+
|
11
|
+
def self.unpack(hDomain)
|
12
|
+
|
13
|
+
# instance classes needed in script
|
14
|
+
intMetadataClass = InternalMetadata.new
|
15
|
+
intDomain = intMetadataClass.newDictionaryDomain
|
16
|
+
|
17
|
+
# data dictionary domain - id
|
18
|
+
if hDomain.has_key?('domainId')
|
19
|
+
s = hDomain['domainId']
|
20
|
+
if s != ''
|
21
|
+
intDomain[:domainId] = s
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# data dictionary domain - name
|
26
|
+
if hDomain.has_key?('commonName')
|
27
|
+
s = hDomain['commonName']
|
28
|
+
if s != ''
|
29
|
+
intDomain[:domainName] = s
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# data dictionary domain - code
|
34
|
+
if hDomain.has_key?('codeName')
|
35
|
+
s = hDomain['codeName']
|
36
|
+
if s != ''
|
37
|
+
intDomain[:domainCode] = s
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# data dictionary domain - description
|
42
|
+
if hDomain.has_key?('description')
|
43
|
+
s = hDomain['description']
|
44
|
+
if s != ''
|
45
|
+
intDomain[:domainDescription] = s
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# data dictionary domain - members
|
50
|
+
if hDomain.has_key?('member')
|
51
|
+
aDoItems = hDomain['member']
|
52
|
+
aDoItems.each do |hDoItem|
|
53
|
+
unless hDoItem.empty?
|
54
|
+
intDomain[:domainItems] << Md_DomainItem.unpack(hDoItem)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
return intDomain
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# unpack a data dictionary domain item
|
2
|
+
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2013-12-01 original script
|
6
|
+
|
7
|
+
module Md_DomainItem
|
8
|
+
|
9
|
+
def self.unpack(hDoItem)
|
10
|
+
|
11
|
+
# instance classes needed in script
|
12
|
+
intMetadataClass = InternalMetadata.new
|
13
|
+
intItem = intMetadataClass.newDomainItem
|
14
|
+
|
15
|
+
# data dictionary domain item - name
|
16
|
+
if hDoItem.has_key?('name')
|
17
|
+
s = hDoItem['name']
|
18
|
+
if s != ''
|
19
|
+
intItem[:itemName] = s
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# data dictionary domain item - value
|
24
|
+
if hDoItem.has_key?('value')
|
25
|
+
s = hDoItem['value']
|
26
|
+
if s != ''
|
27
|
+
intItem[:itemValue] = s
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
# data dictionary domain item - definition
|
32
|
+
if hDoItem.has_key?('definition')
|
33
|
+
s = hDoItem['definition']
|
34
|
+
if s != ''
|
35
|
+
intItem[:itemDefinition] = s
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
return intItem
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|