adiwg-mdtranslator 0.12.1 → 1.0.0rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.gitmodules +3 -3
- data/Rakefile +1 -1
- data/adiwg-mdtranslator.gemspec +3 -3
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +5 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_entity.rb +9 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_entityAttribute.rb +9 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_mdJson.rb +7 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +2 -2
- data/lib/adiwg/mdtranslator/version.rb +5 -1
- data/lib/adiwg/mdtranslator/writers/html/html_writer.rb +43 -0
- data/lib/adiwg/mdtranslator/writers/html/md_html_writer.rb +25 -0
- data/lib/adiwg/mdtranslator/writers/html/readme.md +10 -0
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_aggregateInformation.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_boundingPolygon.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_citation.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_contact.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataIdentification.rb +17 -17
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataQuality.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_date.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distribution.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_distributor.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_extent.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +11 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicDescription.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_identifier.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineage.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_maintenanceInformation.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_medium.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_metadataExtension.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiGeometry.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_onlineResource.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_processStep.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_responsibleParty.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_source.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonSystem.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_temporalExtent.rb +2 -2
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_usage.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso/classes/class_vouchers.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +159 -147
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +17 -23
- data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +11 -10
- data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +97 -103
- data/lib/adiwg/mdtranslator/writers/mdWriters.rb +1 -11
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_additionalDocumentation.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_address.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_associatedResource.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_browseGraphic.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_citation.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_contact.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_dictionaryInfo.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_domain.rb +4 -4
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_onlineResource.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_phone.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_reader_mdjson_responsibleParty.rb +3 -3
- data/test/readers/mdJson/{v0_9 → v1_0}/tc_translation.rb +4 -4
- data/test/schemas/v1_0/.gitignore +18 -0
- data/test/schemas/v1_0/.travis.yml +7 -0
- data/test/schemas/v1_0/CREDITS +3 -0
- data/test/schemas/v1_0/Gemfile +4 -0
- data/test/schemas/v1_0/LICENSE +24 -0
- data/test/schemas/v1_0/README.md +36 -0
- data/test/schemas/v1_0/Rakefile +12 -0
- data/test/schemas/v1_0/adiwg-json_schemas.gemspec +25 -0
- data/test/schemas/v1_0/examples/additionalDocumentation.json +61 -0
- data/test/schemas/v1_0/examples/address.json +10 -0
- data/test/schemas/v1_0/examples/associatedResource.json +119 -0
- data/test/schemas/v1_0/examples/citation.json +128 -0
- data/test/schemas/v1_0/examples/contact.json +205 -0
- data/test/schemas/v1_0/examples/contactRef.json +12 -0
- data/test/schemas/v1_0/examples/dataDictionary.json +547 -0
- data/test/schemas/v1_0/examples/dataQuality.json +272 -0
- data/test/schemas/v1_0/examples/date.json +19 -0
- data/test/schemas/v1_0/examples/distributor.json +113 -0
- data/test/schemas/v1_0/examples/extent_linestring.json +288 -0
- data/test/schemas/v1_0/examples/extent_point.json +246 -0
- data/test/schemas/v1_0/examples/extent_polygon.json +353 -0
- data/test/schemas/v1_0/examples/format.json +14 -0
- data/test/schemas/v1_0/examples/full_example.json +2844 -0
- data/test/schemas/v1_0/examples/full_example2.json +2325 -0
- data/test/schemas/v1_0/examples/geojson.json +446 -0
- data/test/schemas/v1_0/examples/graphicOverview.json +28 -0
- data/test/schemas/v1_0/examples/hierarchyLevel.json +90 -0
- data/test/schemas/v1_0/examples/keywords.json +144 -0
- data/test/schemas/v1_0/examples/lcc_project_example.json +326 -0
- data/test/schemas/v1_0/examples/legalConstraints.json +17 -0
- data/test/schemas/v1_0/examples/maintInfo.json +34 -0
- data/test/schemas/v1_0/examples/metadataInfo.json +103 -0
- data/test/schemas/v1_0/examples/minimum_example.json +35 -0
- data/test/schemas/v1_0/examples/onlineResource.json +17 -0
- data/test/schemas/v1_0/examples/resolution.json +9 -0
- data/test/schemas/v1_0/examples/resourceInfo.json +1264 -0
- data/test/schemas/v1_0/examples/resourceMaintenance.json +10 -0
- data/test/schemas/v1_0/examples/securityConstraints.json +13 -0
- data/test/schemas/v1_0/examples/spatialRef.json +14 -0
- data/test/schemas/v1_0/examples/taxonomy.json +197 -0
- data/test/schemas/v1_0/examples/temporalElement.json +29 -0
- data/test/schemas/v1_0/examples/uri.json +16 -0
- data/test/schemas/v1_0/examples/usage.json +35 -0
- data/test/schemas/v1_0/examples/verticalExtent.json +18 -0
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas/utils.rb +20 -0
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas/validator.rb +42 -0
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas/version.rb +6 -0
- data/test/schemas/v1_0/lib/adiwg/mdjson_schemas.rb +7 -0
- data/test/schemas/v1_0/lib/adiwg-mdjson_schemas.rb +1 -0
- data/test/schemas/v1_0/schema/schema/citation.json +186 -0
- data/test/schemas/v1_0/schema/schema/contact.json +255 -0
- data/test/schemas/v1_0/schema/schema/dataDictionary.json +209 -0
- data/test/schemas/v1_0/schema/schema/dataQuality.json +159 -0
- data/test/schemas/v1_0/schema/schema/distributor.json +171 -0
- data/test/schemas/v1_0/schema/schema/extent.json +214 -0
- data/test/schemas/v1_0/schema/schema/geojson/bbox.json +14 -0
- data/test/schemas/v1_0/schema/schema/geojson/crs.json +99 -0
- data/test/schemas/v1_0/schema/schema/geojson/geojson.json +194 -0
- data/test/schemas/v1_0/schema/schema/geojson/geometry.json +203 -0
- data/test/schemas/v1_0/schema/schema/graphicOverview.json +42 -0
- data/test/schemas/v1_0/schema/schema/keyword.json +39 -0
- data/test/schemas/v1_0/schema/schema/maintInfo.json +43 -0
- data/test/schemas/v1_0/schema/schema/metadata.json +173 -0
- data/test/schemas/v1_0/schema/schema/onlineResource.json +42 -0
- data/test/schemas/v1_0/schema/schema/resolution.json +51 -0
- data/test/schemas/v1_0/schema/schema/resourceConstraint.json +108 -0
- data/test/schemas/v1_0/schema/schema/resourceInfo.json +305 -0
- data/test/schemas/v1_0/schema/schema/taxonomy.json +122 -0
- data/test/schemas/v1_0/schema/schema/usage.json +39 -0
- data/test/schemas/v1_0/schema/schema.json +64 -0
- data/test/schemas/v1_0/templates/mdJson_template.json +1065 -0
- data/test/schemas/v1_0/test/draft-04.json +189 -0
- data/test/schemas/v1_0/test/tc_schemas.rb +210 -0
- data/test/schemas/v1_0/test/tc_utils.rb +27 -0
- metadata +241 -90
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_additionalDocumentation.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_address.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_associatedResource.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_boundingBox.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_browseGraphic.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_citation.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_contacts.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_coordinates.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_dataDictionary.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_dataQuality.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_dateTime.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_descriptiveKeyword.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_dictionaryInfo.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_distributionInfo.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_domain.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_domainItem.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_entityForeignKey.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_entityIndex.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_extent.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_geoCoordSystem.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_geoProperties.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_geographicElement.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_legalConstraint.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_lineString.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_lineage.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_metadata.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_metadataExtension.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_metadataInfo.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_onlineResource.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_phone.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_point.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_polygon.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_processStep.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resolution.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceFormat.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceIdentifier.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceInfo.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceMaintenance.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_resourceSpecificUsage.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_responsibleParty.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_securityConstraint.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_source.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_spatialReference.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_taxonClass.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_taxonomy.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_temporalElement.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_timeInstant.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_timePeriod.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_verticalElement.rb +0 -0
- /data/lib/adiwg/mdtranslator/readers/mdJson/{modules_0.9 → modules_1.0}/module_voucher.rb +0 -0
@@ -25,10 +25,10 @@ module ADIWG
|
|
25
25
|
def writeXML(hExtension)
|
26
26
|
|
27
27
|
# classes used
|
28
|
-
olResClass = $
|
29
|
-
rPartyClass = $
|
30
|
-
obCode = $
|
31
|
-
dataTCode = $
|
28
|
+
olResClass = $IsoNS::CI_OnlineResource.new(@xml)
|
29
|
+
rPartyClass = $IsoNS::CI_ResponsibleParty.new(@xml)
|
30
|
+
obCode = $IsoNS::MD_ObligationCode.new(@xml)
|
31
|
+
dataTCode = $IsoNS::MD_DatatypeCode.new(@xml)
|
32
32
|
|
33
33
|
@xml.tag!('gmd:MD_MetadataExtensionInformation') do
|
34
34
|
|
@@ -28,9 +28,9 @@ module ADIWG
|
|
28
28
|
|
29
29
|
# classes used
|
30
30
|
intMetadataClass = InternalMetadata.new
|
31
|
-
pointClass = $
|
32
|
-
lineClass = $
|
33
|
-
polygonClass = $
|
31
|
+
pointClass = $IsoNS::Point.new(@xml)
|
32
|
+
lineClass = $IsoNS::LineString.new(@xml)
|
33
|
+
polygonClass = $IsoNS::Polygon.new(@xml)
|
34
34
|
|
35
35
|
|
36
36
|
# gml:MultiGeometry attributes
|
@@ -22,7 +22,7 @@ module ADIWG
|
|
22
22
|
def writeXML(refSystem, refType)
|
23
23
|
|
24
24
|
# classes used
|
25
|
-
refIdClass = $
|
25
|
+
refIdClass = $IsoNS::RS_Identifier.new(@xml)
|
26
26
|
|
27
27
|
@xml.tag!('gmd:MD_ReferenceSystem') do
|
28
28
|
@xml.tag!('gmd:referenceSystemIdentifier') do
|
@@ -24,8 +24,8 @@ module ADIWG
|
|
24
24
|
def writeXML(rParty)
|
25
25
|
|
26
26
|
# classes used
|
27
|
-
ciContactClass = $
|
28
|
-
ciRoleCode = $
|
27
|
+
ciContactClass = $IsoNS::CI_Contact.new(@xml)
|
28
|
+
ciRoleCode = $IsoNS::CI_RoleCode.new(@xml)
|
29
29
|
|
30
30
|
# search array of responsible party for matches in contact object
|
31
31
|
rpID = rParty[:contactId]
|
@@ -23,8 +23,8 @@ module ADIWG
|
|
23
23
|
def writeXML(hSource)
|
24
24
|
|
25
25
|
# classes used
|
26
|
-
citationClass = $
|
27
|
-
pStepClass = $
|
26
|
+
citationClass = $IsoNS::CI_Citation.new(@xml)
|
27
|
+
pStepClass = $IsoNS::LI_ProcessStep.new(@xml)
|
28
28
|
|
29
29
|
@xml.tag!('gmd:LI_Source') do
|
30
30
|
|
@@ -25,10 +25,10 @@ module ADIWG
|
|
25
25
|
def writeXML(hTaxonSys)
|
26
26
|
|
27
27
|
# classes used
|
28
|
-
citationClass = $
|
29
|
-
rPartyClass = $
|
30
|
-
tVoucherClass = $
|
31
|
-
tClassClass = $
|
28
|
+
citationClass = $IsoNS::CI_Citation.new(@xml)
|
29
|
+
rPartyClass = $IsoNS::CI_ResponsibleParty.new(@xml)
|
30
|
+
tVoucherClass = $IsoNS::MD_Vouchers.new(@xml)
|
31
|
+
tClassClass = $IsoNS::MD_TaxonCl.new(@xml)
|
32
32
|
|
33
33
|
@xml.tag!('gmd:MD_TaxonSys') do
|
34
34
|
|
@@ -25,8 +25,8 @@ module ADIWG
|
|
25
25
|
|
26
26
|
# classes used
|
27
27
|
intMetadataClass = InternalMetadata.new
|
28
|
-
timeInstClass = $
|
29
|
-
timePeriodClass = $
|
28
|
+
timeInstClass = $IsoNS::TimeInstant.new(@xml)
|
29
|
+
timePeriodClass = $IsoNS::TimePeriod.new(@xml)
|
30
30
|
|
31
31
|
@xml.tag!('gmd:EX_TemporalExtent') do
|
32
32
|
|
@@ -9,166 +9,178 @@
|
|
9
9
|
require 'class_responsibleParty'
|
10
10
|
require 'class_featureType'
|
11
11
|
|
12
|
-
|
12
|
+
module ADIWG
|
13
|
+
module Mdtranslator
|
14
|
+
module Writers
|
15
|
+
module Iso19110
|
13
16
|
|
14
|
-
|
15
|
-
@xml = xml
|
16
|
-
end
|
17
|
+
class FC_FeatureCatalogue
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
rPartyClass = $WriterNS::CI_ResponsibleParty.new(@xml)
|
22
|
-
featureClass = $WriterNS::FC_FeatureType.new(@xml)
|
23
|
-
|
24
|
-
intDataDictionary = internalObj[:dataDictionary]
|
25
|
-
hDDInfo = intDataDictionary[:dictionaryInfo]
|
26
|
-
aEntities = intDataDictionary[:entities]
|
27
|
-
hCitation = hDDInfo[:dictCitation]
|
28
|
-
|
29
|
-
$intContactList = internalObj[:contacts]
|
30
|
-
$domainList = intDataDictionary[:domains]
|
31
|
-
|
32
|
-
# document head
|
33
|
-
metadata = @xml.instruct! :xml, encoding: 'UTF-8'
|
34
|
-
@xml.comment!('core gfc based instance document for ISO 19110')
|
35
|
-
@xml.tag!('gfc:FC_FeatureCatalogue', {'xmlns:gmi' => 'http://www.isotc211.org/2005/gmi',
|
36
|
-
'xmlns:gmd' => 'http://www.isotc211.org/2005/gmd',
|
37
|
-
'xmlns:gco' => 'http://www.isotc211.org/2005/gco',
|
38
|
-
'xmlns:gml' => 'http://www.opengis.net/gml/3.2',
|
39
|
-
'xmlns:gsr' => 'http://www.isotc211.org/2005/gsr',
|
40
|
-
'xmlns:gss' => 'http://www.isotc211.org/2005/gss',
|
41
|
-
'xmlns:gst' => 'http://www.isotc211.org/2005/gst',
|
42
|
-
'xmlns:gmx' => 'http://www.isotc211.org/2005/gmx',
|
43
|
-
'xmlns:gfc' => 'http://www.isotc211.org/2005/gfc',
|
44
|
-
'xmlns:xlink' => 'http://www.w3.org/1999/xlink',
|
45
|
-
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
46
|
-
'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
|
47
|
-
|
48
|
-
# feature catalogue information - name - required
|
49
|
-
# name is pulled from citation title in data dictionary information section
|
50
|
-
s = nil
|
51
|
-
if hCitation
|
52
|
-
if hCitation[:citTitle]
|
53
|
-
s = hCitation[:citTitle]
|
54
|
-
end
|
55
|
-
end
|
56
|
-
if !s.nil?
|
57
|
-
@xml.tag!('gmx:name') do
|
58
|
-
@xml.tag!('gco:CharacterString', s)
|
59
|
-
end
|
60
|
-
else
|
61
|
-
@xml.tag!('gmx:name', {'gco:nilReason' => 'missing'})
|
62
|
-
end
|
19
|
+
def initialize(xml)
|
20
|
+
@xml = xml
|
21
|
+
end
|
63
22
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
23
|
+
def writeXML(internalObj)
|
24
|
+
$IsoNS = ADIWG::Mdtranslator::Writers::Iso
|
25
|
+
|
26
|
+
# classes used
|
27
|
+
rPartyClass = $IsoNS::CI_ResponsibleParty.new(@xml)
|
28
|
+
featureClass = $IsoNS::FC_FeatureType.new(@xml)
|
29
|
+
|
30
|
+
intDataDictionary = internalObj[:dataDictionary][0]
|
31
|
+
hDDInfo = intDataDictionary[:dictionaryInfo]
|
32
|
+
aEntities = intDataDictionary[:entities]
|
33
|
+
hCitation = hDDInfo[:dictCitation]
|
34
|
+
|
35
|
+
$intContactList = internalObj[:contacts]
|
36
|
+
$domainList = intDataDictionary[:domains]
|
37
|
+
|
38
|
+
# document head
|
39
|
+
metadata = @xml.instruct! :xml, encoding: 'UTF-8'
|
40
|
+
@xml.comment!('core gfc based instance document for ISO 19110')
|
41
|
+
@xml.tag!('gfc:FC_FeatureCatalogue', {'xmlns:gmi' => 'http://www.isotc211.org/2005/gmi',
|
42
|
+
'xmlns:gmd' => 'http://www.isotc211.org/2005/gmd',
|
43
|
+
'xmlns:gco' => 'http://www.isotc211.org/2005/gco',
|
44
|
+
'xmlns:gml' => 'http://www.opengis.net/gml/3.2',
|
45
|
+
'xmlns:gsr' => 'http://www.isotc211.org/2005/gsr',
|
46
|
+
'xmlns:gss' => 'http://www.isotc211.org/2005/gss',
|
47
|
+
'xmlns:gst' => 'http://www.isotc211.org/2005/gst',
|
48
|
+
'xmlns:gmx' => 'http://www.isotc211.org/2005/gmx',
|
49
|
+
'xmlns:gfc' => 'http://www.isotc211.org/2005/gfc',
|
50
|
+
'xmlns:xlink' => 'http://www.w3.org/1999/xlink',
|
51
|
+
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
|
52
|
+
'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
|
53
|
+
|
54
|
+
# feature catalogue information - name - required
|
55
|
+
# name is pulled from citation title in data dictionary information section
|
56
|
+
s = nil
|
57
|
+
if hCitation
|
58
|
+
if hCitation[:citTitle]
|
59
|
+
s = hCitation[:citTitle]
|
60
|
+
end
|
61
|
+
end
|
62
|
+
if !s.nil?
|
63
|
+
@xml.tag!('gmx:name') do
|
64
|
+
@xml.tag!('gco:CharacterString', s)
|
65
|
+
end
|
66
|
+
else
|
67
|
+
@xml.tag!('gmx:name', {'gco:nilReason' => 'missing'})
|
68
|
+
end
|
74
69
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
70
|
+
# feature catalogue information - scope - required []
|
71
|
+
# only a single instance is being supported
|
72
|
+
s = hDDInfo[:dictResourceType]
|
73
|
+
if !s.nil?
|
74
|
+
@xml.tag!('gmx:scope') do
|
75
|
+
@xml.tag!('gco:CharacterString', s)
|
76
|
+
end
|
77
|
+
else
|
78
|
+
@xml.tag!('gmx:scope', {'gco:nilReason' => 'missing'})
|
79
|
+
end
|
85
80
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
@xml.tag!('gco:CharacterString', s)
|
97
|
-
end
|
98
|
-
else
|
99
|
-
@xml.tag!('gmx:versionNumber', {'gco:nilReason' => 'missing'})
|
100
|
-
end
|
81
|
+
# feature catalogue information - field of application []
|
82
|
+
# only a single instance is being supported
|
83
|
+
s = hDDInfo[:dictDescription]
|
84
|
+
if !s.nil?
|
85
|
+
@xml.tag!('gmx:fieldOfApplication') do
|
86
|
+
@xml.tag!('gco:CharacterString', s)
|
87
|
+
end
|
88
|
+
elsif $showAllTags
|
89
|
+
@xml.tag!('gmx:fieldOfApplication')
|
90
|
+
end
|
101
91
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
92
|
+
# feature catalogue information - version number - required
|
93
|
+
# version number is taken from citation citEdition in data dictionary the info section
|
94
|
+
s = nil
|
95
|
+
if hCitation
|
96
|
+
if hCitation[:citEdition]
|
97
|
+
s = hCitation[:citEdition]
|
98
|
+
end
|
99
|
+
end
|
100
|
+
if !s.nil?
|
101
|
+
@xml.tag!('gmx:versionNumber') do
|
102
|
+
@xml.tag!('gco:CharacterString', s)
|
103
|
+
end
|
104
|
+
else
|
105
|
+
@xml.tag!('gmx:versionNumber', {'gco:nilReason' => 'missing'})
|
115
106
|
end
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
if vDate.nil?
|
121
|
-
@xml.tag!('gmx:versionDate', {'gco:nilReason' => 'missing'})
|
122
|
-
else
|
123
|
-
@xml.tag!('gmx:versionDate') do
|
124
|
-
@xml.tag!('gco:Date', vDate)
|
125
|
-
end
|
126
|
-
end
|
127
107
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
108
|
+
# feature catalogue information - version date - required
|
109
|
+
# version number is taken from citation citEdition in data dictionary the info section
|
110
|
+
# citation allows an array of citation dates, only one can be used as version date
|
111
|
+
vDate = nil
|
112
|
+
if hCitation
|
113
|
+
if hCitation[:citDate]
|
114
|
+
if hCitation[:citDate][0]
|
115
|
+
hDate = hCitation[:citDate][0]
|
116
|
+
unless hDate.empty?
|
117
|
+
dateTime = hDate[:dateTime]
|
118
|
+
dateRes = hDate[:dateResolution]
|
119
|
+
unless dateTime.nil?
|
120
|
+
vDate = AdiwgDateTimeFun.stringDateFromDateTime(dateTime, dateRes)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
if vDate.nil?
|
127
|
+
@xml.tag!('gmx:versionDate', {'gco:nilReason' => 'missing'})
|
128
|
+
else
|
129
|
+
@xml.tag!('gmx:versionDate') do
|
130
|
+
@xml.tag!('gco:Date', vDate)
|
131
|
+
end
|
132
|
+
end
|
137
133
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
134
|
+
# feature catalogue information - language
|
135
|
+
s = hDDInfo[:dictLanguage]
|
136
|
+
if !s.nil?
|
137
|
+
@xml.tag!('gmx:language') do
|
138
|
+
@xml.tag!('gco:CharacterString', s)
|
139
|
+
end
|
140
|
+
elsif $showAllTags
|
141
|
+
@xml.tag!('gmx:language')
|
142
|
+
end
|
143
|
+
|
144
|
+
# feature catalogue information - producer - required - CI_ResponsibleParty
|
145
|
+
# producer is taken from citation responsibleParty in data dictionary the info section
|
146
|
+
# citation allows an array of responsible parties, only one can be used as producer
|
147
|
+
rParty = nil
|
148
|
+
if hCitation
|
149
|
+
if hCitation[:citResponsibleParty]
|
150
|
+
if hCitation[:citResponsibleParty][0]
|
151
|
+
rParty = hCitation[:citResponsibleParty][0]
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
if rParty.nil? || rParty.empty?
|
156
|
+
@xml.tag!('gfc:producer', {'gco:nilReason' => 'missing'})
|
157
|
+
else
|
158
|
+
@xml.tag!('gfc:producer') do
|
159
|
+
rPartyClass.writeXML(rParty)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
# feature catalogue feature type - required
|
164
|
+
# use feature type to represent entities
|
165
|
+
if !aEntities.empty?
|
166
|
+
aEntities.each do |hEntity|
|
167
|
+
@xml.tag!('gfc:featureType') do
|
168
|
+
featureClass.writeXML(hEntity)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
else
|
172
|
+
@xml.tag!('gfc:featureType', {'gco:nilReason' => 'missing'})
|
173
|
+
end
|
174
|
+
|
175
|
+
return metadata
|
176
|
+
end
|
156
177
|
|
157
|
-
# feature catalogue feature type - required
|
158
|
-
# use feature type to represent entities
|
159
|
-
if !aEntities.empty?
|
160
|
-
aEntities.each do |hEntity|
|
161
|
-
@xml.tag!('gfc:featureType') do
|
162
|
-
featureClass.writeXML(hEntity)
|
163
178
|
end
|
179
|
+
|
164
180
|
end
|
165
|
-
else
|
166
|
-
@xml.tag!('gfc:featureType', {'gco:nilReason' => 'missing'})
|
167
|
-
end
|
168
181
|
|
169
|
-
|
182
|
+
end
|
170
183
|
end
|
171
|
-
|
172
184
|
end
|
173
|
-
|
174
185
|
end
|
186
|
+
|
@@ -16,38 +16,32 @@ require 'adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue'
|
|
16
16
|
module ADIWG
|
17
17
|
module Mdtranslator
|
18
18
|
module Writers
|
19
|
-
module
|
19
|
+
module Iso19110
|
20
20
|
|
21
21
|
# set writer namespace
|
22
|
-
$WriterNS = ADIWG::Mdtranslator::Writers::
|
22
|
+
$WriterNS = ADIWG::Mdtranslator::Writers::Iso19110
|
23
23
|
|
24
|
-
|
24
|
+
def self.startWriter(intObj)
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
$idCount = '_000'
|
29
|
-
end
|
30
|
-
|
31
|
-
def writeXML(intObj)
|
32
|
-
|
33
|
-
# set the format of the output file based on the writer specified
|
34
|
-
$response[:writerFormat] = 'xml'
|
35
|
-
$response[:writerVersion] = ADIWG::Mdtranslator::VERSION
|
26
|
+
# reset ISO id='' counter
|
27
|
+
$idCount = '_000'
|
36
28
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
metadata = metadataWriter.writeXML(intObj)
|
29
|
+
# set the format of the output file based on the writer specified
|
30
|
+
$response[:writerFormat] = 'xml'
|
31
|
+
$response[:writerVersion] = ADIWG::Mdtranslator::VERSION
|
41
32
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
33
|
+
# create new XML document
|
34
|
+
xml = Builder::XmlMarkup.new(indent: 3)
|
35
|
+
metadataWriter = $WriterNS::FC_FeatureCatalogue.new(xml)
|
36
|
+
metadata = metadataWriter.writeXML(intObj)
|
47
37
|
|
48
|
-
|
38
|
+
# set writer pass to true if no messages
|
39
|
+
# false or warning will be set by code that places the message
|
40
|
+
if $response[:writerMessages].length == 0
|
41
|
+
$response[:writerPass] = true
|
49
42
|
end
|
50
43
|
|
44
|
+
return metadata
|
51
45
|
end
|
52
46
|
|
53
47
|
end
|
@@ -39,7 +39,7 @@ require 'module_dateTimeFun'
|
|
39
39
|
module ADIWG
|
40
40
|
module Mdtranslator
|
41
41
|
module Writers
|
42
|
-
module
|
42
|
+
module Iso19115_2
|
43
43
|
|
44
44
|
class MI_Metadata
|
45
45
|
|
@@ -48,17 +48,18 @@ module ADIWG
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def writeXML(internalObj)
|
51
|
+
$IsoNS = ADIWG::Mdtranslator::Writers::Iso
|
51
52
|
|
52
53
|
# classes used
|
53
|
-
charCode = $
|
54
|
-
scopeCode = $
|
55
|
-
rPartyClass = $
|
56
|
-
mdExtClass = $
|
57
|
-
dataIdClass = $
|
58
|
-
distClass = $
|
59
|
-
dqClass = $
|
60
|
-
metaMaintClass = $
|
61
|
-
refSysClass = $
|
54
|
+
charCode = $IsoNS::MD_CharacterSetCode.new(@xml)
|
55
|
+
scopeCode = $IsoNS::MD_ScopeCode.new(@xml)
|
56
|
+
rPartyClass = $IsoNS::CI_ResponsibleParty.new(@xml)
|
57
|
+
mdExtClass = $IsoNS::MD_MetadataExtensionInformation.new(@xml)
|
58
|
+
dataIdClass = $IsoNS::MD_DataIdentification.new(@xml)
|
59
|
+
distClass = $IsoNS::MD_Distribution.new(@xml)
|
60
|
+
dqClass = $IsoNS::DQ_DataQuality.new(@xml)
|
61
|
+
metaMaintClass = $IsoNS::MD_MaintenanceInformation.new(@xml)
|
62
|
+
refSysClass = $IsoNS::MD_ReferenceSystem.new(@xml)
|
62
63
|
|
63
64
|
intMetadata = internalObj[:metadata]
|
64
65
|
hMetaInfo = intMetadata[:metadataInfo]
|