adiwg-mdtranslator 0.10.2 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -4
- data/Rakefile +4 -1
- data/adiwg-mdtranslator.gemspec +10 -8
- data/bin/mdtranslator +8 -2
- data/lib/adiwg/mdtranslator.rb +72 -147
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +538 -538
- data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +78 -78
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +153 -74
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +41 -108
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_additionalDocumentation.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_address.rb +89 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_associatedResource.rb +82 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_boundingBox.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_browseGraphic.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_citation.rb +122 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_contacts.rb +150 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_coordinates.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataDictionary.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataQuality.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dateTime.rb +38 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_descriptiveKeyword.rb +60 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dictionaryInfo.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_distributionInfo.rb +161 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domain.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domainItem.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entity.rb +103 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityAttribute.rb +102 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityForeignKey.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityIndex.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_extent.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoCoordSystem.rb +57 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoProperties.rb +100 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geographicElement.rb +179 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_legalConstraint.rb +56 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineString.rb +36 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineage.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_mdJson.rb +69 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadata.rb +88 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataExtension.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataInfo.rb +123 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_onlineResource.rb +79 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_phone.rb +79 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_point.rb +36 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_polygon.rb +66 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_processStep.rb +75 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resolution.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceFormat.rb +46 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceIdentifier.rb +60 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceInfo.rb +328 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceMaintenance.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceSpecificUsage.rb +61 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_responsibleParty.rb +48 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_securityConstraint.rb +63 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_source.rb +59 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_spatialReference.rb +59 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonClass.rb +54 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonomy.rb +94 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_temporalElement.rb +82 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timeInstant.rb +56 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timePeriod.rb +64 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_verticalElement.rb +64 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_voucher.rb +49 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/validator.rb +43 -0
- data/lib/adiwg/mdtranslator/readers/mdReaders.rb +55 -0
- data/lib/adiwg/mdtranslator/version.rb +15 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_address.rb +107 -86
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_aggregateInformation.rb +68 -57
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_boundingPolygon.rb +59 -48
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_browseGraphic.rb +57 -46
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_citation.rb +149 -138
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_contact.rb +83 -72
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataIdentification.rb +334 -322
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataQuality.rb +46 -34
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_date.rb +47 -36
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +42 -31
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distribution.rb +29 -18
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distributor.rb +77 -66
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_extent.rb +87 -76
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +113 -102
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureConstraint.rb +44 -33
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +121 -110
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb +45 -34
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +45 -36
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicBoundingBox.rb +78 -67
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicDescription.rb +25 -14
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb +30 -19
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_identifier.rb +41 -30
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb +58 -49
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb +65 -54
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineString.rb +77 -66
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineage.rb +62 -51
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_listedValue.rb +70 -59
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_maintenanceInformation.rb +54 -43
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_medium.rb +58 -47
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_metadataExtension.rb +154 -143
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiGeometry.rb +138 -127
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiplicity.rb +37 -26
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_onlineResource.rb +79 -68
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_point.rb +77 -66
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_polygon.rb +98 -87
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_processStep.rb +80 -69
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceIdentifier.rb +38 -27
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +25 -14
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_resolution.rb +51 -40
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_responsibleParty.rb +88 -77
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb +70 -59
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_source.rb +58 -47
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_standardOrderProcess.rb +75 -63
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonClassification.rb +55 -44
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonSystem.rb +98 -87
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_telephone.rb +73 -62
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_temporalExtent.rb +58 -47
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_timeInstant.rb +36 -27
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_timePeriod.rb +42 -33
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_usage.rb +59 -48
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_useConstraints.rb +26 -15
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_verticalExtent.rb +52 -41
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_vouchers.rb +39 -28
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_associationType.rb +41 -29
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_characterSet.rb +82 -47
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_classification.rb +42 -24
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_datatype.rb +56 -34
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb +34 -19
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_initiativeType.rb +41 -29
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_keywordType.rb +46 -27
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_maintenanceFrequency.rb +55 -36
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumFormat.rb +44 -26
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumName.rb +68 -38
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_obligation.rb +32 -25
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_onlineFunction.rb +42 -25
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_presentationForm.rb +58 -31
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_progress.rb +44 -25
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_restriction.rb +47 -32
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_role.rb +52 -29
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_scope.rb +58 -35
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_spatialRepresentationType.rb +43 -30
- data/lib/adiwg/mdtranslator/writers/iso/codelists/code_topicCategory.rb +51 -44
- data/lib/adiwg/mdtranslator/writers/iso/units/class_baseUnit.rb +26 -15
- data/lib/adiwg/mdtranslator/writers/iso/units/class_conventionalUnit.rb +56 -45
- data/lib/adiwg/mdtranslator/writers/iso/units/class_definitionUnit.rb +23 -12
- data/lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb +30 -19
- data/lib/adiwg/mdtranslator/writers/iso/units/class_unitsOfMeasure.rb +223 -212
- data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +174 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +41 -12
- data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +347 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +151 -119
- data/lib/adiwg/mdtranslator/writers/mdWriters.rb +63 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_additionalDocumentation.rb +84 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_address.rb +100 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_associatedResource.rb +100 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_browseGraphic.rb +66 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_citation.rb +115 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_contact.rb +137 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_onlineResource.rb +47 -0
- data/test/readers/mdJson/v0_9/tc_reader_mdjson_phone.rb +128 -0
- data/test/readers/mdJson/v0_9/tc_translation.rb +82 -0
- data/test/writers/iso19115_2/tc_writer_iso19115_2_address.rb +222 -0
- metadata +87 -60
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_additionalDocumentation.rb +0 -36
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_address.rb +0 -71
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_associatedResource.rb +0 -66
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_boundingBox.rb +0 -51
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_browseGraphic.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_citation.rb +0 -104
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_contacts.rb +0 -121
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_coordinates.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataDictionary.rb +0 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataQuality.rb +0 -40
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dateTime.rb +0 -27
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_descriptiveKeyword.rb +0 -49
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dictionaryInfo.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_distributionInfo.rb +0 -150
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domain.rb +0 -62
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domainItem.rb +0 -42
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entity.rb +0 -92
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityAttribute.rb +0 -91
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityForeignKey.rb +0 -43
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityIndex.rb +0 -42
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_extent.rb +0 -62
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoCoordSystem.rb +0 -46
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoProperties.rb +0 -89
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geographicElement.rb +0 -168
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_legalConstraint.rb +0 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineString.rb +0 -25
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineage.rb +0 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadata.rb +0 -77
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataExtension.rb +0 -40
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataInfo.rb +0 -112
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_onlineResource.rb +0 -62
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_phone.rb +0 -59
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_point.rb +0 -25
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_polygon.rb +0 -55
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_processStep.rb +0 -64
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resolution.rb +0 -42
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceFormat.rb +0 -35
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceIdentifier.rb +0 -49
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceInfo.rb +0 -317
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceMaintenance.rb +0 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceSpecificUsage.rb +0 -50
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_responsibleParty.rb +0 -37
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_securityConstraint.rb +0 -52
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_source.rb +0 -48
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_spatialReference.rb +0 -48
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonClass.rb +0 -43
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonomy.rb +0 -83
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_temporalElement.rb +0 -71
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timeInstant.rb +0 -45
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timePeriod.rb +0 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_verticalElement.rb +0 -53
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_voucher.rb +0 -38
- data/lib/adiwg/mdtranslator/validator.rb +0 -43
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_FCfeatureCatalogue.rb +0 -171
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_MImetadata.rb +0 -333
- data/test/tc_translation.rb +0 -73
@@ -1,42 +0,0 @@
|
|
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
|
@@ -1,92 +0,0 @@
|
|
1
|
-
# unpack a data dictionary entity
|
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_entityIndex', $response[:readerVersionUsed])
|
8
|
-
require ADIWG::Mdtranslator.reader_module('module_entityAttribute', $response[:readerVersionUsed])
|
9
|
-
require ADIWG::Mdtranslator.reader_module('module_entityForeignKey', $response[:readerVersionUsed])
|
10
|
-
|
11
|
-
module Md_Entity
|
12
|
-
|
13
|
-
def self.unpack(hEntity)
|
14
|
-
|
15
|
-
# instance classes needed in script
|
16
|
-
intMetadataClass = InternalMetadata.new
|
17
|
-
intEntity = intMetadataClass.newEntity
|
18
|
-
|
19
|
-
# data entity - id
|
20
|
-
if hEntity.has_key?('entityId')
|
21
|
-
s = hEntity['entityId']
|
22
|
-
if s != ''
|
23
|
-
intEntity[:entityId] = s
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
# data entity - name
|
28
|
-
if hEntity.has_key?('commonName')
|
29
|
-
s = hEntity['commonName']
|
30
|
-
if s != ''
|
31
|
-
intEntity[:entityName] = s
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# data entity - code
|
36
|
-
if hEntity.has_key?('codeName')
|
37
|
-
s = hEntity['codeName']
|
38
|
-
if s != ''
|
39
|
-
intEntity[:entityCode] = s
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
# data entity - definition
|
44
|
-
if hEntity.has_key?('definition')
|
45
|
-
s = hEntity['definition']
|
46
|
-
if s != ''
|
47
|
-
intEntity[:entityDefinition] = s
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
# data entity - primary key
|
52
|
-
if hEntity.has_key?('primaryKeyAttributeCodeName')
|
53
|
-
aKeyAttributes = hEntity['primaryKeyAttributeCodeName']
|
54
|
-
unless aKeyAttributes.empty?
|
55
|
-
intEntity[:primaryKey] = aKeyAttributes
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
# data entity - indexes []
|
60
|
-
if hEntity.has_key?('index')
|
61
|
-
aIndexes = hEntity['index']
|
62
|
-
aIndexes.each do |hIndex|
|
63
|
-
unless hIndex.empty?
|
64
|
-
intEntity[:indexes] << Md_EntityIndex.unpack(hIndex)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
# data entity - attributes []
|
70
|
-
if hEntity.has_key?('attribute')
|
71
|
-
aAttributes = hEntity['attribute']
|
72
|
-
aAttributes.each do |hAttribute|
|
73
|
-
unless hAttribute.empty?
|
74
|
-
intEntity[:attributes] << Md_EntityAttribute.unpack(hAttribute)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
# data entity - foreign keys []
|
80
|
-
if hEntity.has_key?('foreignKey')
|
81
|
-
aFKeys = hEntity['foreignKey']
|
82
|
-
aFKeys.each do |hFKey|
|
83
|
-
unless hFKey.empty?
|
84
|
-
intEntity[:foreignKeys] << Md_EntityForeignKey.unpack(hFKey)
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
return intEntity
|
90
|
-
end
|
91
|
-
|
92
|
-
end
|
@@ -1,91 +0,0 @@
|
|
1
|
-
# unpack an data entity attribute
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-12-01 original script
|
6
|
-
|
7
|
-
module Md_EntityAttribute
|
8
|
-
|
9
|
-
def self.unpack(hAttribute)
|
10
|
-
|
11
|
-
# instance classes needed in script
|
12
|
-
intMetadataClass = InternalMetadata.new
|
13
|
-
intAttribute = intMetadataClass.newEntityAttribute
|
14
|
-
|
15
|
-
# attribute - common name
|
16
|
-
if hAttribute.has_key?('commonName')
|
17
|
-
s = hAttribute['commonName']
|
18
|
-
if s != ''
|
19
|
-
intAttribute[:attributeName] = s
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# attribute - code name
|
24
|
-
if hAttribute.has_key?('codeName')
|
25
|
-
s = hAttribute['codeName']
|
26
|
-
if s != ''
|
27
|
-
intAttribute[:attributeCode] = s
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# attribute - definition
|
32
|
-
if hAttribute.has_key?('definition')
|
33
|
-
s = hAttribute['definition']
|
34
|
-
if s != ''
|
35
|
-
intAttribute[:attributeDefinition] = s
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
# attribute - data type
|
40
|
-
if hAttribute.has_key?('dataType')
|
41
|
-
s = hAttribute['dataType']
|
42
|
-
if s != ''
|
43
|
-
intAttribute[:dataType] = s
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
# attribute - required attribute?
|
48
|
-
if hAttribute.has_key?('allowNull')
|
49
|
-
s = hAttribute['allowNull']
|
50
|
-
if s != ''
|
51
|
-
intAttribute[:allowNull] = s
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
# attribute - units of measure
|
56
|
-
if hAttribute.has_key?('units')
|
57
|
-
s = hAttribute['units']
|
58
|
-
if s != ''
|
59
|
-
intAttribute[:unitOfMeasure] = s
|
60
|
-
end
|
61
|
-
end
|
62
|
-
|
63
|
-
# attribute - domain ID
|
64
|
-
if hAttribute.has_key?('domainId')
|
65
|
-
s = hAttribute['domainId']
|
66
|
-
if s != ''
|
67
|
-
intAttribute[:domainId] = s
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
# attribute - minimum value
|
72
|
-
if hAttribute.has_key?('minValue')
|
73
|
-
s = hAttribute['minValue']
|
74
|
-
if s != ''
|
75
|
-
intAttribute[:minValue] = s
|
76
|
-
end
|
77
|
-
end
|
78
|
-
|
79
|
-
# attribute - maximum value
|
80
|
-
if hAttribute.has_key?('maxValue')
|
81
|
-
s = hAttribute['maxValue']
|
82
|
-
if s != ''
|
83
|
-
intAttribute[:maxValue] = s
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
return intAttribute
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# unpack an data entity foreign key
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-12-01 original script
|
6
|
-
|
7
|
-
module Md_EntityForeignKey
|
8
|
-
|
9
|
-
def self.unpack(hFKey)
|
10
|
-
|
11
|
-
# instance classes needed in script
|
12
|
-
intMetadataClass = InternalMetadata.new
|
13
|
-
intFKey = intMetadataClass.newEntityForeignKey
|
14
|
-
|
15
|
-
# entity foreign key - local attribute code name
|
16
|
-
if hFKey.has_key?('localAttributeCodeName')
|
17
|
-
aLocalAttributes = hFKey['localAttributeCodeName']
|
18
|
-
unless aLocalAttributes.empty?
|
19
|
-
intFKey[:fkLocalAttributes] = aLocalAttributes
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# entity foreign key - referenced entity code name
|
24
|
-
if hFKey.has_key?('referencedEntityCodeName')
|
25
|
-
s = hFKey['referencedEntityCodeName']
|
26
|
-
if s != ''
|
27
|
-
intFKey[:fkReferencedEntity] = s
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# entity foreign key - referenced attribute code name
|
32
|
-
if hFKey.has_key?('referencedAttributeCodeName')
|
33
|
-
aRefAttributes = hFKey['referencedAttributeCodeName']
|
34
|
-
unless aRefAttributes.empty?
|
35
|
-
intFKey[:fkReferencedAttributes] = aRefAttributes
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
return intFKey
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# unpack an data entity index
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-12-01 original script
|
6
|
-
|
7
|
-
module Md_EntityIndex
|
8
|
-
|
9
|
-
def self.unpack(hIndex)
|
10
|
-
|
11
|
-
# instance classes needed in script
|
12
|
-
intMetadataClass = InternalMetadata.new
|
13
|
-
intIndex = intMetadataClass.newEntityIndex
|
14
|
-
|
15
|
-
# entity index - code name
|
16
|
-
if hIndex.has_key?('codeName')
|
17
|
-
s = hIndex['codeName']
|
18
|
-
if s != ''
|
19
|
-
intIndex[:indexCode] = s
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# entity index - allow duplicates
|
24
|
-
if hIndex.has_key?('allowDuplicates')
|
25
|
-
s = hIndex['allowDuplicates']
|
26
|
-
if s != ''
|
27
|
-
intIndex[:duplicate] = s
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# entity index - attribute list
|
32
|
-
if hIndex.has_key?('attributeCodeName')
|
33
|
-
aKeyAttributes = hIndex['attributeCodeName']
|
34
|
-
unless aKeyAttributes.empty?
|
35
|
-
intIndex[:attributeNames] = aKeyAttributes
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
return intIndex
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# unpack extent
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-11-04 original script
|
6
|
-
# Stan Smith 2013-11-14 add temporal elements
|
7
|
-
# Stan Smith 2013-11-14 add vertical elements
|
8
|
-
# Stan Smith 2013-11-27 modified to process a single extent
|
9
|
-
# Stan Smith 2013-12-05 modified to for new temporalElement schema
|
10
|
-
# Stan Smith 2014-07-07 resolve require statements using Mdtranslator.reader_module
|
11
|
-
|
12
|
-
require ADIWG::Mdtranslator.reader_module('module_geographicElement', $response[:readerVersionUsed])
|
13
|
-
require ADIWG::Mdtranslator.reader_module('module_temporalElement', $response[:readerVersionUsed])
|
14
|
-
require ADIWG::Mdtranslator.reader_module('module_verticalElement', $response[:readerVersionUsed])
|
15
|
-
|
16
|
-
module Md_Extent
|
17
|
-
|
18
|
-
def self.unpack(hExtent)
|
19
|
-
|
20
|
-
# instance classes needed in script
|
21
|
-
intMetadataClass = InternalMetadata.new
|
22
|
-
intExtent = intMetadataClass.newExtent
|
23
|
-
|
24
|
-
# extent - description
|
25
|
-
if hExtent.has_key?('description')
|
26
|
-
s = hExtent['description']
|
27
|
-
if s != ''
|
28
|
-
intExtent[:extDesc] = s
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# extent - geographic elements
|
33
|
-
if hExtent.has_key?('geographicElement')
|
34
|
-
aGeoElements = hExtent['geographicElement']
|
35
|
-
unless aGeoElements.empty?
|
36
|
-
intExtent[:extGeoElements] = Md_GeographicElement.unpack(aGeoElements)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# extent - temporal elements
|
41
|
-
if hExtent.has_key?('temporalElement')
|
42
|
-
hTempElement = hExtent['temporalElement']
|
43
|
-
unless hTempElement.empty?
|
44
|
-
intExtent[:extTempElements] = Md_TemporalElement.unpack(hTempElement)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# extent - vertical elements
|
49
|
-
if hExtent.has_key?('verticalElement')
|
50
|
-
aVertElements = hExtent['verticalElement']
|
51
|
-
unless aVertElements.empty?
|
52
|
-
aVertElements.each do |hVertElement|
|
53
|
-
intExtent[:extVertElements] << Md_VerticalElement.unpack(hVertElement)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
return intExtent
|
59
|
-
|
60
|
-
end
|
61
|
-
|
62
|
-
end
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# unpack GeoJSON properties
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2014-04-30 original script
|
6
|
-
|
7
|
-
module Md_GeoCoordSystem
|
8
|
-
|
9
|
-
def self.unpack(hGeoCrs, intElement)
|
10
|
-
|
11
|
-
intMetadataClass = InternalMetadata.new
|
12
|
-
intSRS = intMetadataClass.newSRS
|
13
|
-
|
14
|
-
# get coordinate reference system
|
15
|
-
# null crs will default to CRS84 in writer
|
16
|
-
if hGeoCrs.has_key?('properties')
|
17
|
-
hCRSProp = hGeoCrs['properties']
|
18
|
-
|
19
|
-
if hCRSProp.has_key?('name')
|
20
|
-
s = hCRSProp['name']
|
21
|
-
if s != ''
|
22
|
-
intSRS[:srsName] = s
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
if hCRSProp.has_key?('href')
|
27
|
-
s = hCRSProp['href']
|
28
|
-
if s != ''
|
29
|
-
intSRS[:srsHref] = s
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
if hCRSProp.has_key?('type')
|
34
|
-
s = hCRSProp['type']
|
35
|
-
if s != ''
|
36
|
-
intSRS[:srsType] = s
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
intElement[:elementSrs] = intSRS
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
end
|
@@ -1,89 +0,0 @@
|
|
1
|
-
# unpack GeoJSON properties
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2014-04-29 original script
|
6
|
-
# Stan Smith 2014-07-07 resolve require statements using Mdtranslator.reader_module
|
7
|
-
# Stan Smith 2014-08-18 changed assignedId to identifier schema 0.6.0
|
8
|
-
|
9
|
-
require ADIWG::Mdtranslator.reader_module('module_temporalElement', $response[:readerVersionUsed])
|
10
|
-
require ADIWG::Mdtranslator.reader_module('module_verticalElement', $response[:readerVersionUsed])
|
11
|
-
require ADIWG::Mdtranslator.reader_module('module_resourceIdentifier', $response[:readerVersionUsed])
|
12
|
-
|
13
|
-
module Md_GeoProperties
|
14
|
-
|
15
|
-
def self.unpack(hGeoProps, intElement)
|
16
|
-
|
17
|
-
# set element extent - (default true)
|
18
|
-
intElement[:elementIncludeData] = true
|
19
|
-
if hGeoProps.has_key?('includesData')
|
20
|
-
if !hGeoProps['includesData']
|
21
|
-
intElement[:elementIncludeData] = false
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# set element feature name
|
26
|
-
if hGeoProps.has_key?('featureName')
|
27
|
-
s = hGeoProps['featureName']
|
28
|
-
if s != ''
|
29
|
-
intElement[:elementName] = s
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# set element description
|
34
|
-
if hGeoProps.has_key?('description')
|
35
|
-
s = hGeoProps['description']
|
36
|
-
if s != ''
|
37
|
-
intElement[:elementDescription] = s
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# set temporal information
|
42
|
-
if hGeoProps.has_key?('temporalElement')
|
43
|
-
hTempEle = hGeoProps['temporalElement']
|
44
|
-
unless hTempEle.empty?
|
45
|
-
intElement[:temporalElements] = Md_TemporalElement.unpack(hTempEle)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
# set vertical information
|
50
|
-
if hGeoProps.has_key?('verticalElement')
|
51
|
-
aVertEle = hGeoProps['verticalElement']
|
52
|
-
unless aVertEle.empty?
|
53
|
-
aVertEle.each do |hVertEle|
|
54
|
-
intElement[:verticalElements] << Md_VerticalElement.unpack(hVertEle)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
# set other assigned IDs
|
60
|
-
if hGeoProps.has_key?('identifier')
|
61
|
-
aResIds = hGeoProps['identifier']
|
62
|
-
unless aResIds.empty?
|
63
|
-
aResIds.each do |hIdentifier|
|
64
|
-
intElement[:elementIdentifiers] << Md_ResourceIdentifier.unpack(hIdentifier)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
# set feature scope
|
70
|
-
if hGeoProps.has_key?('featureScope')
|
71
|
-
s = hGeoProps['featureScope']
|
72
|
-
if s != ''
|
73
|
-
intElement[:elementScope] = s
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
# set feature acquisition methodology
|
78
|
-
if hGeoProps.has_key?('featureAcquisitionMethod')
|
79
|
-
s = hGeoProps['featureAcquisitionMethod']
|
80
|
-
if s != ''
|
81
|
-
intElement[:elementAcquisition] = s
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
return intElement
|
86
|
-
|
87
|
-
end
|
88
|
-
|
89
|
-
end
|