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,52 +0,0 @@
|
|
1
|
-
# repack coordinates
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-11-07 original script
|
6
|
-
# Stan Smith 2013-11-13 added getDimension
|
7
|
-
# Stan Smith 2014-05-23 added getLevels
|
8
|
-
|
9
|
-
module Md_Coordinates
|
10
|
-
|
11
|
-
# repack coordinate array into single string for ISO
|
12
|
-
def self.unpack(aCoords)
|
13
|
-
s = ''
|
14
|
-
i = 0
|
15
|
-
coordCount = aCoords.length
|
16
|
-
aCoords.each do |coord|
|
17
|
-
if coord.kind_of?(Array)
|
18
|
-
s = s + unpack(coord)
|
19
|
-
else
|
20
|
-
i += 1
|
21
|
-
s = s + coord.to_s
|
22
|
-
if i < coordCount
|
23
|
-
s = s + ','
|
24
|
-
end
|
25
|
-
s = s + ' '
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
return s
|
30
|
-
end
|
31
|
-
|
32
|
-
# get the number of dimensions in a coordinate array
|
33
|
-
def self.getDimension(aCoords)
|
34
|
-
if aCoords[0].kind_of?(Array)
|
35
|
-
coordDim = getDimension(aCoords[0])
|
36
|
-
else
|
37
|
-
coordDim = aCoords.length
|
38
|
-
end
|
39
|
-
|
40
|
-
return coordDim
|
41
|
-
end
|
42
|
-
|
43
|
-
# get the number of levels in the coordinate array
|
44
|
-
def self.getLevels(aCoords)
|
45
|
-
i = 1
|
46
|
-
if aCoords[0].kind_of?(Array)
|
47
|
-
i = i + getLevels(aCoords[0])
|
48
|
-
end
|
49
|
-
return i
|
50
|
-
end
|
51
|
-
|
52
|
-
end
|
@@ -1,53 +0,0 @@
|
|
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
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# unpack data quality
|
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_lineage', $response[:readerVersionUsed])
|
9
|
-
|
10
|
-
module Md_DataQuality
|
11
|
-
|
12
|
-
def self.unpack(hDataQual)
|
13
|
-
|
14
|
-
# instance classes needed in script
|
15
|
-
intMetadataClass = InternalMetadata.new
|
16
|
-
intDataQual = intMetadataClass.newDataQuality
|
17
|
-
|
18
|
-
# data quality - scope
|
19
|
-
if hDataQual.has_key?('scope')
|
20
|
-
s = hDataQual['scope']
|
21
|
-
if s != ''
|
22
|
-
intDataQual[:dataScope] = s
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
# data quality - report
|
27
|
-
# on hold
|
28
|
-
|
29
|
-
# data quality - lineage
|
30
|
-
if hDataQual.has_key?('lineage')
|
31
|
-
hLineage = hDataQual['lineage']
|
32
|
-
unless hLineage.empty?
|
33
|
-
intDataQual[:dataLineage] = Md_Lineage.unpack(hLineage)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
return intDataQual
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
# unpack dateTime
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-12-11 original script
|
6
|
-
|
7
|
-
require 'module_dateTimeFun'
|
8
|
-
|
9
|
-
module Md_DateTime
|
10
|
-
|
11
|
-
def self.unpack(sDateTime)
|
12
|
-
|
13
|
-
# instance classes needed in script
|
14
|
-
intMetadataClass = InternalMetadata.new
|
15
|
-
|
16
|
-
# dateTime
|
17
|
-
intDateTime = intMetadataClass.newDateTime
|
18
|
-
|
19
|
-
aDateTimeReturn = AdiwgDateTimeFun.dateTimeFromString(sDateTime)
|
20
|
-
intDateTime[:dateTime] = aDateTimeReturn[0]
|
21
|
-
intDateTime[:dateResolution] = aDateTimeReturn[1]
|
22
|
-
|
23
|
-
return intDateTime
|
24
|
-
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,49 +0,0 @@
|
|
1
|
-
# unpack descriptive keyword
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-09-18 original script
|
6
|
-
# Stan Smith 2013-11-27 modified to process single keyword collection
|
7
|
-
# Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
|
8
|
-
# Stan Smith 2014-08-21 removed thesaurus link; replaced by onlineResource to citation
|
9
|
-
# Stan Smith 2014-08-21 removed extra level of encapsulation "citation" under "thesaurus"
|
10
|
-
|
11
|
-
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
12
|
-
|
13
|
-
module Md_DescriptiveKeyword
|
14
|
-
|
15
|
-
def self.unpack(hDesKeyword)
|
16
|
-
|
17
|
-
# instance classes needed in script
|
18
|
-
intMetadataClass = InternalMetadata.new
|
19
|
-
intKeyword = intMetadataClass.newKeyword
|
20
|
-
|
21
|
-
# descriptive keyword - keyword array
|
22
|
-
if hDesKeyword.has_key?('keyword')
|
23
|
-
aKeywords = hDesKeyword['keyword']
|
24
|
-
aKeywords.each do |keyword|
|
25
|
-
intKeyword[:keyword] << keyword
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# descriptive keyword - keyType
|
30
|
-
if hDesKeyword.has_key?('keywordType')
|
31
|
-
s = hDesKeyword['keywordType']
|
32
|
-
if s != ''
|
33
|
-
intKeyword[:keywordType] = s
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
# descriptive keyword - thesaurus
|
38
|
-
if hDesKeyword.has_key?('thesaurus')
|
39
|
-
hCitation = hDesKeyword['thesaurus']
|
40
|
-
unless hCitation.empty?
|
41
|
-
intKeyword[:keyTheCitation] = Md_Citation.unpack(hCitation)
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
|
46
|
-
return intKeyword
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
@@ -1,52 +0,0 @@
|
|
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
|
@@ -1,150 +0,0 @@
|
|
1
|
-
# unpack distribution info
|
2
|
-
# Reader - ADIwg JSON V1 to internal data structure
|
3
|
-
|
4
|
-
# History:
|
5
|
-
# Stan Smith 2013-09-23 original script
|
6
|
-
# Stan Smith 2013-11-27 changed to receive single distributor rather than array
|
7
|
-
# Stan Smith 2013-12-18 changed to unpack contact using responsible party
|
8
|
-
# Stan Smith 2014-05-02 changed to support responsible party as hash, not array
|
9
|
-
# Stan Smith 2014-07-08 resolve require statements using Mdtranslator.reader_module
|
10
|
-
|
11
|
-
require ADIWG::Mdtranslator.reader_module('module_onlineResource', $response[:readerVersionUsed])
|
12
|
-
require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVersionUsed])
|
13
|
-
require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
|
14
|
-
|
15
|
-
module Md_DistributionInfo
|
16
|
-
|
17
|
-
def self.unpack(hDistributor)
|
18
|
-
|
19
|
-
# instance classes needed in script
|
20
|
-
intMetadataClass = InternalMetadata.new
|
21
|
-
intDistributor = intMetadataClass.newDistributor
|
22
|
-
|
23
|
-
# distributor - distribution contact
|
24
|
-
if hDistributor.has_key?('distributorContact')
|
25
|
-
hContact = hDistributor['distributorContact']
|
26
|
-
unless hContact.empty?
|
27
|
-
intDistributor[:distContact] = Md_ResponsibleParty.unpack(hContact)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
# distributor - distribution order process
|
32
|
-
if hDistributor.has_key?('distributionOrderProcess')
|
33
|
-
aDistOrder = hDistributor['distributionOrderProcess']
|
34
|
-
unless aDistOrder.empty?
|
35
|
-
aDistOrder.each do |distOrderProcess|
|
36
|
-
|
37
|
-
intDistOrder = intMetadataClass.newDistOrder
|
38
|
-
|
39
|
-
if distOrderProcess.has_key?('fees')
|
40
|
-
s = distOrderProcess['fees']
|
41
|
-
if s != ''
|
42
|
-
intDistOrder[:fees] = s
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
if distOrderProcess.has_key?('plannedAvailabilityDateTime')
|
47
|
-
s = distOrderProcess['plannedAvailabilityDateTime']
|
48
|
-
if s != ''
|
49
|
-
intDistOrder[:plannedDateTime] = Md_DateTime.unpack(s)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
if distOrderProcess.has_key?('orderingInstructions')
|
54
|
-
s = distOrderProcess['orderingInstructions']
|
55
|
-
if s != ''
|
56
|
-
intDistOrder[:orderInstructions] = s
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
if distOrderProcess.has_key?('turnaround')
|
61
|
-
s = distOrderProcess['turnaround']
|
62
|
-
if s != ''
|
63
|
-
intDistOrder[:turnaround] = s
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
intDistributor[:distOrderProc] << intDistOrder
|
68
|
-
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
# distributor - distribution format
|
74
|
-
if hDistributor.has_key?('distributorFormat')
|
75
|
-
aDistFormat = hDistributor['distributorFormat']
|
76
|
-
unless aDistFormat.empty?
|
77
|
-
|
78
|
-
aDistFormat.each do |distFormat|
|
79
|
-
intResFormat = intMetadataClass.newResourceFormat
|
80
|
-
|
81
|
-
if distFormat.has_key?('formatName')
|
82
|
-
s = distFormat['formatName']
|
83
|
-
if s != ''
|
84
|
-
intResFormat[:formatName] = s
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
if distFormat.has_key?('version')
|
89
|
-
s = distFormat['version']
|
90
|
-
if s != ''
|
91
|
-
intResFormat[:formatVersion] = s
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
intDistributor[:distFormat] << intResFormat
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
# distributor - distribution transfer options
|
101
|
-
if hDistributor.has_key?('distributorTransferOptions')
|
102
|
-
aDistTransOpt = hDistributor['distributorTransferOptions']
|
103
|
-
unless aDistTransOpt.empty?
|
104
|
-
|
105
|
-
aDistTransOpt.each do |distTransOpt|
|
106
|
-
intTransOpt = intMetadataClass.newDigitalTransOption
|
107
|
-
|
108
|
-
if distTransOpt.has_key?('online')
|
109
|
-
aOnlineOption = distTransOpt['online']
|
110
|
-
aOnlineOption.each do |hOlOption|
|
111
|
-
intTransOpt[:online] << Md_OnlineResource.unpack(hOlOption)
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
if distTransOpt.has_key?('offline')
|
116
|
-
intOfflineOpt = intMetadataClass.newMedium
|
117
|
-
distOfflineOpt = distTransOpt['offline']
|
118
|
-
if distOfflineOpt.has_key?('name')
|
119
|
-
s = distOfflineOpt['name']
|
120
|
-
if s != ''
|
121
|
-
intOfflineOpt[:mediumName] = s
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
|
-
if distOfflineOpt.has_key?('mediumFormat')
|
126
|
-
s = distOfflineOpt['mediumFormat']
|
127
|
-
if s != ''
|
128
|
-
intOfflineOpt[:mediumFormat] = s
|
129
|
-
end
|
130
|
-
end
|
131
|
-
|
132
|
-
if distOfflineOpt.has_key?('mediumNote')
|
133
|
-
s = distOfflineOpt['mediumNote']
|
134
|
-
if s != ''
|
135
|
-
intOfflineOpt[:mediumNote] = s
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
intTransOpt[:offline] = intOfflineOpt
|
140
|
-
end
|
141
|
-
|
142
|
-
intDistributor[:distTransOption] << intTransOpt
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
return intDistributor
|
148
|
-
end
|
149
|
-
|
150
|
-
end
|
@@ -1,62 +0,0 @@
|
|
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
|