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,50 +0,0 @@
|
|
1
|
-
# unpack resource maintenance
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-10-31 original script
|
6
|
-
# Stan Smith 2013-12-18 made note an array
|
7
|
-
# Stan Smith 2013-12-18 added contact
|
8
|
-
# Stan Smith 2014-04-24 modified for json schema 0.3.0
|
9
|
-
# Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
|
10
|
-
|
11
|
-
require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
|
12
|
-
|
13
|
-
module Md_ResourceMaintenance
|
14
|
-
|
15
|
-
def self.unpack(hResource)
|
16
|
-
|
17
|
-
# instance classes needed in script
|
18
|
-
intMetadataClass = InternalMetadata.new
|
19
|
-
intResMaint = intMetadataClass.newResourceMaint
|
20
|
-
|
21
|
-
# resource maintenance - frequency code
|
22
|
-
if hResource.has_key?('maintenanceFrequency')
|
23
|
-
s = hResource['maintenanceFrequency']
|
24
|
-
if s != ''
|
25
|
-
intResMaint[:maintFreq] = s
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# resource maintenance - maintenance note
|
30
|
-
if hResource.has_key?('maintenanceNote')
|
31
|
-
aNotes = hResource['maintenanceNote']
|
32
|
-
unless aNotes.empty?
|
33
|
-
intResMaint[:maintNotes] = aNotes
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
# resource maintenance - contact
|
38
|
-
if hResource.has_key?('maintenanceContact')
|
39
|
-
aContact = hResource['maintenanceContact']
|
40
|
-
unless aContact.empty?
|
41
|
-
aContact.each do |hContact|
|
42
|
-
intResMaint[:maintContacts] << Md_ResponsibleParty.unpack(hContact)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
return intResMaint
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# unpack resource specific usage
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-11-25 original script
|
6
|
-
# Stan Smith 2013-11-27 modified to process a single resource usage
|
7
|
-
# Stan Smith 2014-04-28 modified attribute names to match json schema 0.3.0
|
8
|
-
# Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
|
9
|
-
|
10
|
-
require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
|
11
|
-
|
12
|
-
module Md_ResourceSpecificUsage
|
13
|
-
|
14
|
-
def self.unpack(hUsage)
|
15
|
-
|
16
|
-
# instance classes needed in script
|
17
|
-
intMetadataClass = InternalMetadata.new
|
18
|
-
intUsage = intMetadataClass.newDataUsage
|
19
|
-
|
20
|
-
# resource specific usage - specific usage
|
21
|
-
if hUsage.has_key?('specificUsage')
|
22
|
-
s = hUsage['specificUsage']
|
23
|
-
if s != ''
|
24
|
-
intUsage[:specificUsage] = s
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
# resource specific usage - user determined limitations
|
29
|
-
if hUsage.has_key?('userDeterminedLimitation')
|
30
|
-
s = hUsage['userDeterminedLimitation']
|
31
|
-
if s != ''
|
32
|
-
intUsage[:userLimits] = s
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# taxonomy - repository - responsible party
|
37
|
-
if hUsage.has_key?('userContactInfo')
|
38
|
-
aContacts = hUsage['userContactInfo']
|
39
|
-
unless aContacts.empty?
|
40
|
-
aContacts.each do |hContact|
|
41
|
-
intUsage[:userContacts] << Md_ResponsibleParty.unpack(hContact)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
return intUsage
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# unpack responsible party
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-08-26 original script
|
6
|
-
# Stan Smith 2014-05-28 modified to support JSON schema 0.5.0
|
7
|
-
# ... removed resource IDs associated with contact
|
8
|
-
|
9
|
-
module Md_ResponsibleParty
|
10
|
-
|
11
|
-
def self.unpack(hRParty)
|
12
|
-
|
13
|
-
# instance classes needed in script
|
14
|
-
intMetadataClass = InternalMetadata.new
|
15
|
-
intResById = intMetadataClass.newRespParty
|
16
|
-
|
17
|
-
# responsible party - contact
|
18
|
-
if hRParty.has_key?('contactId')
|
19
|
-
s = hRParty['contactId']
|
20
|
-
if s != ''
|
21
|
-
intResById[:contactId] = s
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# responsible party - role - required
|
26
|
-
if hRParty.has_key?('role')
|
27
|
-
s = hRParty['role']
|
28
|
-
if s != ''
|
29
|
-
intResById[:roleName] = s
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
return intResById
|
34
|
-
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# unpack security constraint
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-11-15 original script
|
6
|
-
# Stan Smith 2013-11-27 modified to process a single security constraint
|
7
|
-
|
8
|
-
module Md_SecurityConstraints
|
9
|
-
|
10
|
-
def self.unpack(hSecurityCon)
|
11
|
-
|
12
|
-
# instance classes needed in script
|
13
|
-
intMetadataClass = InternalMetadata.new
|
14
|
-
hIntCon = intMetadataClass.newSecurityConstraint
|
15
|
-
|
16
|
-
# security constraint - classification code - required
|
17
|
-
if hSecurityCon.has_key?('classification')
|
18
|
-
s = hSecurityCon['classification']
|
19
|
-
if s != ''
|
20
|
-
hIntCon[:classCode] = s
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# security constraint - user note
|
25
|
-
if hSecurityCon.has_key?('userNote')
|
26
|
-
s = hSecurityCon['userNote']
|
27
|
-
if s != ''
|
28
|
-
hIntCon[:userNote] = s
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# security constraint - classification system
|
33
|
-
if hSecurityCon.has_key?('classificationSystem')
|
34
|
-
s = hSecurityCon['classificationSystem']
|
35
|
-
if s != ''
|
36
|
-
hIntCon[:classSystem] = s
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# security constraint - handling description
|
41
|
-
if hSecurityCon.has_key?('handlingDescription')
|
42
|
-
s = hSecurityCon['handlingDescription']
|
43
|
-
if s != ''
|
44
|
-
hIntCon[:handlingDesc] = s
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
return hIntCon
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# unpack source
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-11-26 original script
|
6
|
-
# Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
|
7
|
-
|
8
|
-
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
9
|
-
require ADIWG::Mdtranslator.reader_module('module_processStep', $response[:readerVersionUsed])
|
10
|
-
|
11
|
-
module Md_Source
|
12
|
-
|
13
|
-
def self.unpack(hSource)
|
14
|
-
|
15
|
-
# instance classes needed in script
|
16
|
-
intMetadataClass = InternalMetadata.new
|
17
|
-
intDataSource = intMetadataClass.newDataSource
|
18
|
-
|
19
|
-
# source - description
|
20
|
-
if hSource.has_key?('description')
|
21
|
-
s = hSource['description']
|
22
|
-
if s != ''
|
23
|
-
intDataSource[:sourceDescription] = s
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
# source - citation
|
28
|
-
if hSource.has_key?('citation')
|
29
|
-
hCitation = hSource['citation']
|
30
|
-
unless hCitation.empty?
|
31
|
-
intDataSource[:sourceCitation] = Md_Citation.unpack(hCitation)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# source - data sources
|
36
|
-
if hSource.has_key?('processStep')
|
37
|
-
aSourceSteps = hSource['processStep']
|
38
|
-
unless aSourceSteps.empty?
|
39
|
-
aSourceSteps.each do |hStep|
|
40
|
-
intDataSource[:sourceSteps] << Md_ProcessStep.unpack(hStep)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
return intDataSource
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# unpack spatial reference system
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2014-09-03 original script
|
6
|
-
|
7
|
-
module Md_SpatialReferenceSystem
|
8
|
-
|
9
|
-
def self.unpack(hSpatialRef)
|
10
|
-
|
11
|
-
# instance classes needed in script
|
12
|
-
intMetadataClass = InternalMetadata.new
|
13
|
-
intSpatialRef = intMetadataClass.newSpatialReferenceSystem
|
14
|
-
|
15
|
-
# spatial reference system - by name
|
16
|
-
if hSpatialRef.has_key?('name')
|
17
|
-
aSystemNames = hSpatialRef['name']
|
18
|
-
unless aSystemNames.empty?
|
19
|
-
aSystemNames.each do |sRName|
|
20
|
-
intSpatialRef[:sRNames] << sRName
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
# spatial reference system - by epsg
|
26
|
-
if hSpatialRef.has_key?('epsgNumber')
|
27
|
-
aSystemNames = hSpatialRef['epsgNumber']
|
28
|
-
unless aSystemNames.empty?
|
29
|
-
aSystemNames.each do |sREPSG|
|
30
|
-
intSpatialRef[:sREPSGs] << sREPSG
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# spatial reference system - by wkt
|
36
|
-
if hSpatialRef.has_key?('wkt')
|
37
|
-
aSystemNames = hSpatialRef['wkt']
|
38
|
-
unless aSystemNames.empty?
|
39
|
-
aSystemNames.each do |sRWKT|
|
40
|
-
intSpatialRef[:sRWKTs] << sRWKT
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
return intSpatialRef
|
46
|
-
end
|
47
|
-
|
48
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# unpack taxonomy class
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-11-21 original script
|
6
|
-
|
7
|
-
module Md_TaxonCl
|
8
|
-
|
9
|
-
def self.unpack(hTaxClass)
|
10
|
-
|
11
|
-
# instance classes needed in script
|
12
|
-
intMetadataClass = InternalMetadata.new
|
13
|
-
|
14
|
-
intTaxClass = intMetadataClass.newTaxonClass
|
15
|
-
|
16
|
-
# taxonomic classification - common name
|
17
|
-
if hTaxClass.has_key?('common')
|
18
|
-
s = hTaxClass['common']
|
19
|
-
if s != ''
|
20
|
-
intTaxClass[:commonName] = s
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
# taxonomic classification - rank
|
25
|
-
if hTaxClass.has_key?('taxonRank')
|
26
|
-
s = hTaxClass['taxonRank']
|
27
|
-
if s != ''
|
28
|
-
intTaxClass[:taxRankName] = s
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# taxonomic classification - value
|
33
|
-
if hTaxClass.has_key?('taxonValue')
|
34
|
-
s = hTaxClass['taxonValue']
|
35
|
-
if s != ''
|
36
|
-
intTaxClass[:taxRankValue] = s
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
return intTaxClass
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
# unpack taxonomy
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-11-20 original script
|
6
|
-
# Stan Smith 2014-05-02 fixed assignment problem with taxon general scope
|
7
|
-
# Stan Smith 2014-05-02 fixed assignment problem with taxonomic procedures
|
8
|
-
# Stan Smith 2014-07-07 resolve require statements using Mdtranslator.reader_module
|
9
|
-
|
10
|
-
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
11
|
-
require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
|
12
|
-
require ADIWG::Mdtranslator.reader_module('module_voucher', $response[:readerVersionUsed])
|
13
|
-
require ADIWG::Mdtranslator.reader_module('module_taxonClass', $response[:readerVersionUsed])
|
14
|
-
|
15
|
-
module Md_Taxonomy
|
16
|
-
|
17
|
-
def self.unpack(hTaxonomy)
|
18
|
-
|
19
|
-
# instance classes needed in script
|
20
|
-
intMetadataClass = InternalMetadata.new
|
21
|
-
intTaxSys = intMetadataClass.newTaxonSystem
|
22
|
-
|
23
|
-
# taxonomy - taxonomy class system - citation
|
24
|
-
if hTaxonomy.has_key?('classificationSystem')
|
25
|
-
aClassSys = hTaxonomy['classificationSystem']
|
26
|
-
unless aClassSys.empty?
|
27
|
-
aClassSys.each do |hCitation|
|
28
|
-
intTaxSys[:taxClassSys] << Md_Citation.unpack(hCitation)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# taxonomy - general scope
|
34
|
-
if hTaxonomy.has_key?('taxonGeneralScope')
|
35
|
-
s = hTaxonomy['taxonGeneralScope']
|
36
|
-
if s != ''
|
37
|
-
intTaxSys[:taxGeneralScope] = s
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
# taxonomy - ID reference system
|
42
|
-
# not supported in JSON schema (defaulted to 'unknown')
|
43
|
-
|
44
|
-
# taxonomy - observers - responsible party
|
45
|
-
if hTaxonomy.has_key?('observer')
|
46
|
-
aObservers = hTaxonomy['observer']
|
47
|
-
unless aObservers.empty?
|
48
|
-
aObservers.each do |observer|
|
49
|
-
intTaxSys[:taxObservers] << Md_ResponsibleParty.unpack(observer)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
# taxonomy - taxonomic procedures
|
55
|
-
if hTaxonomy.has_key?('taxonomicProcedure')
|
56
|
-
s = hTaxonomy['taxonomicProcedure']
|
57
|
-
if s != ''
|
58
|
-
intTaxSys[:taxIdProcedures] = s
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
# taxonomy - voucher
|
63
|
-
if hTaxonomy.has_key?('voucher')
|
64
|
-
hVoucher = hTaxonomy['voucher']
|
65
|
-
unless hVoucher.empty?
|
66
|
-
intTaxSys[:taxVoucher] = Md_Voucher.unpack(hVoucher)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# taxonomy - classification (recursive)
|
71
|
-
if hTaxonomy.has_key?('taxonClass')
|
72
|
-
aTaxClass = hTaxonomy['taxonClass']
|
73
|
-
unless aTaxClass.empty?
|
74
|
-
aTaxClass.each do |hTaxClass|
|
75
|
-
intTaxSys[:taxClasses] << Md_TaxonCl.unpack(hTaxClass)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
return intTaxSys
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
@@ -1,71 +0,0 @@
|
|
1
|
-
# unpack temporal element
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-11-14 original script
|
6
|
-
# Stan Smith 2013-11-15
|
7
|
-
# . revised to handle temporal elements for both feature
|
8
|
-
# properties and extents
|
9
|
-
# . multiple temporal elements are allowed per extent
|
10
|
-
# . each definition will create a new element
|
11
|
-
# Stan Smith 2013-12-11 modified to handle single temporal element
|
12
|
-
# Stan Smith 2014-07-07 resolve require statements using Mdtranslator.reader_module
|
13
|
-
|
14
|
-
require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVersionUsed])
|
15
|
-
require ADIWG::Mdtranslator.reader_module('module_timeInstant', $response[:readerVersionUsed])
|
16
|
-
require ADIWG::Mdtranslator.reader_module('module_timePeriod', $response[:readerVersionUsed])
|
17
|
-
|
18
|
-
module Md_TemporalElement
|
19
|
-
|
20
|
-
def self.unpack(hTempElement)
|
21
|
-
|
22
|
-
# instance classes needed in script
|
23
|
-
intMetadataClass = InternalMetadata.new
|
24
|
-
aIntTempElements = Array.new
|
25
|
-
|
26
|
-
# temporal element - date
|
27
|
-
if hTempElement.has_key?('date')
|
28
|
-
aDates = hTempElement['date']
|
29
|
-
unless aDates.empty?
|
30
|
-
aDates.each do |s|
|
31
|
-
intTempEle = intMetadataClass.newTemporalElement
|
32
|
-
intTempEle[:date] = Md_DateTime.unpack(s)
|
33
|
-
aIntTempElements << intTempEle
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
# temporal element - time instant
|
39
|
-
if hTempElement.has_key?('timeInstant')
|
40
|
-
aTimeInst = hTempElement['timeInstant']
|
41
|
-
unless aTimeInst.empty?
|
42
|
-
aTimeInst.each do |hTimeInst|
|
43
|
-
if hTimeInst.has_key?('timePosition')
|
44
|
-
s = hTimeInst['timePosition']
|
45
|
-
if s != ''
|
46
|
-
intTempEle = intMetadataClass.newTemporalElement
|
47
|
-
intTempEle[:timeInstant] = Md_TimeInstant.unpack(hTimeInst)
|
48
|
-
aIntTempElements << intTempEle
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
# temporal element - time period
|
56
|
-
if hTempElement.has_key?('timePeriod')
|
57
|
-
aTimePeriod = hTempElement['timePeriod']
|
58
|
-
unless aTimePeriod.empty?
|
59
|
-
aTimePeriod.each do |hTimePeriod|
|
60
|
-
intTempEle = intMetadataClass.newTemporalElement
|
61
|
-
intTempEle[:timePeriod] = Md_TimePeriod.unpack(hTimePeriod)
|
62
|
-
aIntTempElements << intTempEle
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
return aIntTempElements
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|