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