adiwg-mdtranslator 0.9.0 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -6
- data/adiwg-mdtranslator.gemspec +2 -2
- data/bin/mdtranslator +10 -10
- data/lib/adiwg/mdtranslator.rb +54 -12
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +87 -7
- data/lib/adiwg/mdtranslator/readers/{adiwgJson/adiwgJson_reader.rb → mdJson/mdJson_reader.rb} +13 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson/adiwgJson_validator.rb → mdJson/mdJson_validator.rb} +18 -10
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_additionalDocumentation.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_address.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_associatedResource.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_boundingBox.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_browseGraphic.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_citation.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_contacts.rb +7 -7
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_coordinates.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataDictionary.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_dataQuality.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_dateTime.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_descriptiveKeyword.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dictionaryInfo.rb +52 -0
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_distributionInfo.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domain.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domainItem.rb +42 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entity.rb +92 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityAttribute.rb +91 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityForeignKey.rb +43 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityIndex.rb +42 -0
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_extent.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_geoCoordSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_geoProperties.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_geographicElement.rb +12 -12
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_legalConstraint.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_lineString.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_lineage.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_metadata.rb +6 -6
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_metadataExtension.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_metadataInfo.rb +8 -8
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_onlineResource.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_phone.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_point.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_polygon.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_processStep.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resolution.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceFormat.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceIdentifier.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceInfo.rb +16 -16
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceMaintenance.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_resourceSpecificUsage.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_responsibleParty.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_securityConstraint.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_source.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_spatialReference.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_taxonClass.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_taxonomy.rb +5 -5
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_temporalElement.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_timeInstant.rb +3 -3
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_timePeriod.rb +4 -4
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_verticalElement.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_voucher.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +19 -0
- data/lib/adiwg/mdtranslator/version.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_FCfeatureCatalogue.rb +171 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2/classes/class_metadata.rb → iso/classes/class_MImetadata.rb} +3 -3
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_address.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_aggregateInformation.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_boundingPolygon.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_browseGraphic.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_citation.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_contact.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_dataIdentification.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_dataQuality.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_date.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_digitalTransferOptions.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_distribution.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_distributor.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_extent.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +114 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureConstraint.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +120 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_format.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_genericMetaData.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_geographicBoundingBox.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_geographicDescription.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_geographicElement.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_identifier.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_keyword.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_legalConstraints.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_lineString.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_lineage.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_listedValue.rb +68 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_maintenanceInformation.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_medium.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_metadataExtension.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_multiGeometry.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiplicity.rb +44 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_onlineResource.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_point.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_polygon.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_processStep.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_referenceIdentifier.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_referenceSystem.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_resolution.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_responsibleParty.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_securityConstraints.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_source.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_standardOrderProcess.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_taxonClassification.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_taxonSystem.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_telephone.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_temporalExtent.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_timeInstant.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_timePeriod.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_usage.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_useConstraints.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_verticalExtent.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/classes/class_vouchers.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_associationType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_characterSet.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_classification.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_datatype.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_dateType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_initiativeType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_keywordType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_maintenanceFrequency.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_mediumFormat.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_mediumName.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_obligation.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_onlineFunction.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_presentationForm.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_progress.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_restriction.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_role.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_scope.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_spatialRepresentationType.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/{iso19115_2 → iso}/codelists/code_topicCategory.rb +0 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_baseUnit.rb +27 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_conventionalUnit.rb +53 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_definitionUnit.rb +24 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb +31 -0
- data/lib/adiwg/mdtranslator/writers/iso/units/class_unitsOfMeasure.rb +224 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/readme.md +13 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19115_2/readme.md +6 -9
- data/test/tc_translation.rb +35 -18
- metadata +166 -146
- data/lib/adiwg/mdtranslator/readers/adiwgJson/readme.md +0 -19
- data/mdtranslator.rb +0 -187
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
|
11
11
|
|
12
|
-
module
|
12
|
+
module Md_ResourceSpecificUsage
|
13
13
|
|
14
14
|
def self.unpack(hUsage)
|
15
15
|
|
@@ -38,7 +38,7 @@ module Adiwg_ResourceSpecificUsage
|
|
38
38
|
aContacts = hUsage['userContactInfo']
|
39
39
|
unless aContacts.empty?
|
40
40
|
aContacts.each do |hContact|
|
41
|
-
intUsage[:userContacts] <<
|
41
|
+
intUsage[:userContacts] << Md_ResponsibleParty.unpack(hContact)
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_responsibleParty.rb
RENAMED
@@ -6,7 +6,7 @@
|
|
6
6
|
# Stan Smith 2014-05-28 modified to support JSON schema 0.5.0
|
7
7
|
# ... removed resource IDs associated with contact
|
8
8
|
|
9
|
-
module
|
9
|
+
module Md_ResponsibleParty
|
10
10
|
|
11
11
|
def self.unpack(hRParty)
|
12
12
|
|
@@ -18,7 +18,7 @@ module Adiwg_ResponsibleParty
|
|
18
18
|
if hRParty.has_key?('contactId')
|
19
19
|
s = hRParty['contactId']
|
20
20
|
if s != ''
|
21
|
-
intResById[:
|
21
|
+
intResById[:contactId] = s
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
@@ -8,7 +8,7 @@
|
|
8
8
|
require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
|
9
9
|
require ADIWG::Mdtranslator.reader_module('module_processStep', $response[:readerVersionUsed])
|
10
10
|
|
11
|
-
module
|
11
|
+
module Md_Source
|
12
12
|
|
13
13
|
def self.unpack(hSource)
|
14
14
|
|
@@ -28,7 +28,7 @@ module Adiwg_Source
|
|
28
28
|
if hSource.has_key?('citation')
|
29
29
|
hCitation = hSource['citation']
|
30
30
|
unless hCitation.empty?
|
31
|
-
intDataSource[:sourceCitation] =
|
31
|
+
intDataSource[:sourceCitation] = Md_Citation.unpack(hCitation)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -37,7 +37,7 @@ module Adiwg_Source
|
|
37
37
|
aSourceSteps = hSource['processStep']
|
38
38
|
unless aSourceSteps.empty?
|
39
39
|
aSourceSteps.each do |hStep|
|
40
|
-
intDataSource[:sourceSteps] <<
|
40
|
+
intDataSource[:sourceSteps] << Md_ProcessStep.unpack(hStep)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -12,7 +12,7 @@ require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:
|
|
12
12
|
require ADIWG::Mdtranslator.reader_module('module_voucher', $response[:readerVersionUsed])
|
13
13
|
require ADIWG::Mdtranslator.reader_module('module_taxonClass', $response[:readerVersionUsed])
|
14
14
|
|
15
|
-
module
|
15
|
+
module Md_Taxonomy
|
16
16
|
|
17
17
|
def self.unpack(hTaxonomy)
|
18
18
|
|
@@ -25,7 +25,7 @@ module Adiwg_Taxonomy
|
|
25
25
|
aClassSys = hTaxonomy['classificationSystem']
|
26
26
|
unless aClassSys.empty?
|
27
27
|
aClassSys.each do |hCitation|
|
28
|
-
intTaxSys[:taxClassSys] <<
|
28
|
+
intTaxSys[:taxClassSys] << Md_Citation.unpack(hCitation)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
@@ -46,7 +46,7 @@ module Adiwg_Taxonomy
|
|
46
46
|
aObservers = hTaxonomy['observer']
|
47
47
|
unless aObservers.empty?
|
48
48
|
aObservers.each do |observer|
|
49
|
-
intTaxSys[:taxObservers] <<
|
49
|
+
intTaxSys[:taxObservers] << Md_ResponsibleParty.unpack(observer)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
end
|
@@ -63,7 +63,7 @@ module Adiwg_Taxonomy
|
|
63
63
|
if hTaxonomy.has_key?('voucher')
|
64
64
|
hVoucher = hTaxonomy['voucher']
|
65
65
|
unless hVoucher.empty?
|
66
|
-
intTaxSys[:taxVoucher] =
|
66
|
+
intTaxSys[:taxVoucher] = Md_Voucher.unpack(hVoucher)
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
@@ -72,7 +72,7 @@ module Adiwg_Taxonomy
|
|
72
72
|
aTaxClass = hTaxonomy['taxonClass']
|
73
73
|
unless aTaxClass.empty?
|
74
74
|
aTaxClass.each do |hTaxClass|
|
75
|
-
intTaxSys[:taxClasses] <<
|
75
|
+
intTaxSys[:taxClasses] << Md_TaxonCl.unpack(hTaxClass)
|
76
76
|
end
|
77
77
|
end
|
78
78
|
end
|
data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_temporalElement.rb
RENAMED
@@ -15,7 +15,7 @@ require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVe
|
|
15
15
|
require ADIWG::Mdtranslator.reader_module('module_timeInstant', $response[:readerVersionUsed])
|
16
16
|
require ADIWG::Mdtranslator.reader_module('module_timePeriod', $response[:readerVersionUsed])
|
17
17
|
|
18
|
-
module
|
18
|
+
module Md_TemporalElement
|
19
19
|
|
20
20
|
def self.unpack(hTempElement)
|
21
21
|
|
@@ -29,7 +29,7 @@ module Adiwg_TemporalElement
|
|
29
29
|
unless aDates.empty?
|
30
30
|
aDates.each do |s|
|
31
31
|
intTempEle = intMetadataClass.newTemporalElement
|
32
|
-
intTempEle[:date] =
|
32
|
+
intTempEle[:date] = Md_DateTime.unpack(s)
|
33
33
|
aIntTempElements << intTempEle
|
34
34
|
end
|
35
35
|
end
|
@@ -44,7 +44,7 @@ module Adiwg_TemporalElement
|
|
44
44
|
s = hTimeInst['timePosition']
|
45
45
|
if s != ''
|
46
46
|
intTempEle = intMetadataClass.newTemporalElement
|
47
|
-
intTempEle[:timeInstant] =
|
47
|
+
intTempEle[:timeInstant] = Md_TimeInstant.unpack(hTimeInst)
|
48
48
|
aIntTempElements << intTempEle
|
49
49
|
end
|
50
50
|
end
|
@@ -58,7 +58,7 @@ module Adiwg_TemporalElement
|
|
58
58
|
unless aTimePeriod.empty?
|
59
59
|
aTimePeriod.each do |hTimePeriod|
|
60
60
|
intTempEle = intMetadataClass.newTemporalElement
|
61
|
-
intTempEle[:timePeriod] =
|
61
|
+
intTempEle[:timePeriod] = Md_TimePeriod.unpack(hTimePeriod)
|
62
62
|
aIntTempElements << intTempEle
|
63
63
|
end
|
64
64
|
end
|
data/lib/adiwg/mdtranslator/readers/{adiwgJson → mdJson}/modules_0.9.0/module_timeInstant.rb
RENAMED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVersionUsed])
|
9
9
|
|
10
|
-
module
|
10
|
+
module Md_TimeInstant
|
11
11
|
|
12
12
|
def self.unpack(hTimeInst)
|
13
13
|
|
@@ -20,7 +20,7 @@ module Adiwg_TimeInstant
|
|
20
20
|
if hTimeInst.has_key?('id')
|
21
21
|
s = hTimeInst['id']
|
22
22
|
if s != ''
|
23
|
-
intTimeInst[:
|
23
|
+
intTimeInst[:timeId] = s
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -35,7 +35,7 @@ module Adiwg_TimeInstant
|
|
35
35
|
if hTimeInst.has_key?('timePosition')
|
36
36
|
s = hTimeInst['timePosition']
|
37
37
|
if s != ''
|
38
|
-
intTimeInst[:timePosition] =
|
38
|
+
intTimeInst[:timePosition] = Md_DateTime.unpack(s)
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVersionUsed])
|
9
9
|
|
10
|
-
module
|
10
|
+
module Md_TimePeriod
|
11
11
|
|
12
12
|
def self.unpack(hTimePeriod)
|
13
13
|
|
@@ -20,7 +20,7 @@ module Adiwg_TimePeriod
|
|
20
20
|
if hTimePeriod.has_key?('id')
|
21
21
|
s = hTimePeriod['id']
|
22
22
|
if s != ''
|
23
|
-
intTimePer[:
|
23
|
+
intTimePer[:timeId] = s
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -34,7 +34,7 @@ module Adiwg_TimePeriod
|
|
34
34
|
if hTimePeriod.has_key?('beginPosition')
|
35
35
|
s = hTimePeriod['beginPosition']
|
36
36
|
if s != ''
|
37
|
-
intTimePer[:beginTime] =
|
37
|
+
intTimePer[:beginTime] = Md_DateTime.unpack(s)
|
38
38
|
|
39
39
|
end
|
40
40
|
end
|
@@ -42,7 +42,7 @@ module Adiwg_TimePeriod
|
|
42
42
|
if hTimePeriod.has_key?('endPosition')
|
43
43
|
s = hTimePeriod['endPosition']
|
44
44
|
if s != ''
|
45
|
-
intTimePer[:endTime] =
|
45
|
+
intTimePer[:endTime] = Md_DateTime.unpack(s)
|
46
46
|
|
47
47
|
end
|
48
48
|
end
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
|
9
9
|
|
10
|
-
module
|
10
|
+
module Md_Voucher
|
11
11
|
|
12
12
|
def self.unpack(hVoucher)
|
13
13
|
|
@@ -27,7 +27,7 @@ module Adiwg_Voucher
|
|
27
27
|
if hVoucher.has_key?('repository')
|
28
28
|
hRepository = hVoucher['repository']
|
29
29
|
unless hRepository.empty?
|
30
|
-
intTaxVoucher[:repository] =
|
30
|
+
intTaxVoucher[:repository] = Md_ResponsibleParty.unpack(hRepository)
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
## mdJson
|
3
|
+
|
4
|
+
### Supported versions
|
5
|
+
|
6
|
+
> 0.9.0
|
7
|
+
|
8
|
+
### Reader for ADIwg JSON metadata format (mdJson)
|
9
|
+
|
10
|
+
The mdJson format is a simple JSON format for documenting and exchanging information
|
11
|
+
about scientific projects and data. The Alaska Data Integration working group (ADIwg) wrote the
|
12
|
+
standard to support translation to complex standards such as the ISO 19115-2 Geographic Metadata standard
|
13
|
+
and FGDC's Content Standard for Digital Geospatial Metadata. The mdJson standard
|
14
|
+
remains independent of any published standards while comprehensive enough to support translation
|
15
|
+
to many. The mdJson standard is also a convenient format to exchange directly with other organizations as
|
16
|
+
the JSON structure is easier create and ingest by programming languages.
|
17
|
+
|
18
|
+
The mdJson format is fully documented on the interactive
|
19
|
+
[mdJson Viewer](http://www.adiwg.org/mdJson-schema-viewer) website.
|
@@ -17,11 +17,15 @@
|
|
17
17
|
# 0.8.7 2014-10-29 added support for resource time period
|
18
18
|
# 0.9.0 2014-11-06 added resourceType to associatedResource and additionalInformation
|
19
19
|
# ... moved resourceType from metadataInfo to resourceInfo in json
|
20
|
+
# 0.9.1 2014-12-01 changed adiwgJson to mdJson
|
21
|
+
# 0.9.2 2014-12-01 added data dictionary support
|
22
|
+
# 0.10.0 2014-12-01 added ISO 19110 writer
|
23
|
+
# 0.10.1 2014-12-04 fixed problem with messages not returned in an array
|
20
24
|
|
21
25
|
module ADIWG
|
22
26
|
module Mdtranslator
|
23
27
|
# current mdtranslator version
|
24
|
-
VERSION = "0.
|
28
|
+
VERSION = "0.10.2"
|
25
29
|
end
|
26
30
|
end
|
27
31
|
|
@@ -0,0 +1,171 @@
|
|
1
|
+
# ISO 19110 <<Class>> FC_FeatureCatalogue
|
2
|
+
# writer output in XML
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2013-12-01 original script
|
6
|
+
|
7
|
+
require 'class_responsibleParty'
|
8
|
+
require 'class_featureType'
|
9
|
+
|
10
|
+
class FC_FeatureCatalogue
|
11
|
+
|
12
|
+
def initialize(xml)
|
13
|
+
@xml = xml
|
14
|
+
end
|
15
|
+
|
16
|
+
def writeXML(internalObj)
|
17
|
+
|
18
|
+
# classes used in MD_Metadata
|
19
|
+
rPartyClass = CI_ResponsibleParty.new(@xml)
|
20
|
+
featureClass = FC_FeatureType.new(@xml)
|
21
|
+
|
22
|
+
intDataDictionary = internalObj[:dataDictionary]
|
23
|
+
hDDInfo = intDataDictionary[:dictionaryInfo]
|
24
|
+
aEntities = intDataDictionary[:entities]
|
25
|
+
hCitation = hDDInfo[:dictCitation]
|
26
|
+
|
27
|
+
$intContactList = internalObj[:contacts]
|
28
|
+
$domainList = intDataDictionary[:domains]
|
29
|
+
|
30
|
+
# document head
|
31
|
+
@xml.instruct! :xml, encoding: 'UTF-8'
|
32
|
+
@xml.comment!('core gfc based instance document for ISO 19110')
|
33
|
+
@xml.tag!('gfc:FC_FeatureCatalogue',{'xmlns:gmi' => 'http://www.isotc211.org/2005/gmi',
|
34
|
+
'xmlns:gmd' => 'http://www.isotc211.org/2005/gmd',
|
35
|
+
'xmlns:gco' => 'http://www.isotc211.org/2005/gco',
|
36
|
+
'xmlns:gml' => 'http://www.opengis.net/gml/3.2',
|
37
|
+
'xmlns:gsr' => 'http://www.isotc211.org/2005/gsr',
|
38
|
+
'xmlns:gss' => 'http://www.isotc211.org/2005/gss',
|
39
|
+
'xmlns:gst' => 'http://www.isotc211.org/2005/gst',
|
40
|
+
'xmlns:gmx' => 'http://www.isotc211.org/2005/gmx',
|
41
|
+
'xmlns:gfc' => 'http://www.isotc211.org/2005/gfc',
|
42
|
+
'xmlns:xlink' => 'http://www.w3.org/1999/xlink',
|
43
|
+
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
44
|
+
'xsi:schemaLocation' => 'http://www.isotc211.org/2005/gfc ftp://ftp.ncddc.noaa.gov/pub/Metadata/Online_ISO_Training/Intro_to_ISO/schemas/ISObio/schema.xsd'}) do
|
45
|
+
|
46
|
+
# feature catalogue information - name - required
|
47
|
+
# name is pulled from citation title in data dictionary information section
|
48
|
+
s = nil
|
49
|
+
if hCitation
|
50
|
+
if hCitation[:citTitle]
|
51
|
+
s = hCitation[:citTitle]
|
52
|
+
end
|
53
|
+
end
|
54
|
+
if !s.nil?
|
55
|
+
@xml.tag!('gmx:name') do
|
56
|
+
@xml.tag!('gco:CharacterString', s)
|
57
|
+
end
|
58
|
+
else
|
59
|
+
@xml.tag!('gmx:name', {'gco:nilReason' => 'missing'})
|
60
|
+
end
|
61
|
+
|
62
|
+
# feature catalogue information - scope - required []
|
63
|
+
# only a single instance is being supported
|
64
|
+
s = hDDInfo[:dictResourceType]
|
65
|
+
if !s.nil?
|
66
|
+
@xml.tag!('gmx:scope') do
|
67
|
+
@xml.tag!('gco:CharacterString', s)
|
68
|
+
end
|
69
|
+
else
|
70
|
+
@xml.tag!('gmx:scope', {'gco:nilReason' => 'missing'})
|
71
|
+
end
|
72
|
+
|
73
|
+
# feature catalogue information - field of application []
|
74
|
+
# only a single instance is being supported
|
75
|
+
s = hDDInfo[:dictDescription]
|
76
|
+
if !s.nil?
|
77
|
+
@xml.tag!('gmx:fieldOfApplication') do
|
78
|
+
@xml.tag!('gco:CharacterString', s)
|
79
|
+
end
|
80
|
+
elsif $showAllTags
|
81
|
+
@xml.tag!('gmx:fieldOfApplication')
|
82
|
+
end
|
83
|
+
|
84
|
+
# feature catalogue information - version number - required
|
85
|
+
# version number is taken from citation citEdition in data dictionary the info section
|
86
|
+
s = nil
|
87
|
+
if hCitation
|
88
|
+
if hCitation[:citEdition]
|
89
|
+
s = hCitation[:citEdition]
|
90
|
+
end
|
91
|
+
end
|
92
|
+
if !s.nil?
|
93
|
+
@xml.tag!('gmx:versionNumber') do
|
94
|
+
@xml.tag!('gco:CharacterString', s)
|
95
|
+
end
|
96
|
+
else
|
97
|
+
@xml.tag!('gmx:versionNumber',{'gco:nilReason' => 'missing'})
|
98
|
+
end
|
99
|
+
|
100
|
+
# feature catalogue information - version date - required
|
101
|
+
# version number is taken from citation citEdition in data dictionary the info section
|
102
|
+
# citation allows an array of citation dates, only one can be used as version date
|
103
|
+
vDate = nil
|
104
|
+
if hCitation
|
105
|
+
if hCitation[:citDate]
|
106
|
+
if hCitation[:citDate][0]
|
107
|
+
hDate = hCitation[:citDate][0]
|
108
|
+
unless hDate.empty?
|
109
|
+
dateTime = hDate[:dateTime]
|
110
|
+
dateRes = hDate[:dateResolution]
|
111
|
+
unless dateTime.nil?
|
112
|
+
vDate = AdiwgDateTimeFun.stringDateFromDateTime(dateTime, dateRes)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
if vDate.nil?
|
119
|
+
@xml.tag!('gmx:versionDate',{'gco:nilReason' => 'missing'})
|
120
|
+
else
|
121
|
+
@xml.tag!('gmx:versionDate') do
|
122
|
+
@xml.tag!('gco:Date', vDate)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# feature catalogue information - language
|
127
|
+
s = hDDInfo[:dictLanguage]
|
128
|
+
if !s.nil?
|
129
|
+
@xml.tag!('gmx:language') do
|
130
|
+
@xml.tag!('gco:CharacterString', s)
|
131
|
+
end
|
132
|
+
elsif $showAllTags
|
133
|
+
@xml.tag!('gmx:language')
|
134
|
+
end
|
135
|
+
|
136
|
+
# feature catalogue information - producer - required - CI_ResponsibleParty
|
137
|
+
# producer is taken from citation responsibleParty in data dictionary the info section
|
138
|
+
# citation allows an array of responsible parties, only one can be used as producer
|
139
|
+
rParty = nil
|
140
|
+
if hCitation
|
141
|
+
if hCitation[:citResponsibleParty]
|
142
|
+
if hCitation[:citResponsibleParty][0]
|
143
|
+
rParty = hCitation[:citResponsibleParty][0]
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
if rParty.nil? || rParty.empty?
|
148
|
+
@xml.tag!('gfc:producer',{'gco:nilReason' => 'missing'})
|
149
|
+
else
|
150
|
+
@xml.tag!('gfc:producer') do
|
151
|
+
rPartyClass.writeXML(rParty)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
# feature catalogue feature type - required
|
156
|
+
# use feature type to represent entities
|
157
|
+
if !aEntities.empty?
|
158
|
+
aEntities.each do |hEntity|
|
159
|
+
@xml.tag!('gfc:featureType') do
|
160
|
+
featureClass.writeXML(hEntity)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
else
|
164
|
+
@xml.tag!('gfc:featureType',{'gco:nilReason' => 'missing'})
|
165
|
+
end
|
166
|
+
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
|
171
|
+
end
|