adiwg-mdtranslator 0.10.2 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -4
  3. data/Rakefile +4 -1
  4. data/adiwg-mdtranslator.gemspec +10 -8
  5. data/bin/mdtranslator +8 -2
  6. data/lib/adiwg/mdtranslator.rb +72 -147
  7. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +538 -538
  8. data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +78 -78
  9. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +153 -74
  10. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +41 -108
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_additionalDocumentation.rb +54 -0
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_address.rb +89 -0
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_associatedResource.rb +82 -0
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_boundingBox.rb +62 -0
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_browseGraphic.rb +69 -0
  16. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_citation.rb +122 -0
  17. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_contacts.rb +150 -0
  18. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_coordinates.rb +63 -0
  19. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataDictionary.rb +63 -0
  20. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataQuality.rb +51 -0
  21. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dateTime.rb +38 -0
  22. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_descriptiveKeyword.rb +60 -0
  23. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dictionaryInfo.rb +63 -0
  24. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_distributionInfo.rb +161 -0
  25. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domain.rb +73 -0
  26. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domainItem.rb +53 -0
  27. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entity.rb +103 -0
  28. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityAttribute.rb +102 -0
  29. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityForeignKey.rb +54 -0
  30. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityIndex.rb +53 -0
  31. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_extent.rb +73 -0
  32. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoCoordSystem.rb +57 -0
  33. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoProperties.rb +100 -0
  34. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geographicElement.rb +179 -0
  35. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_legalConstraint.rb +56 -0
  36. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineString.rb +36 -0
  37. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineage.rb +61 -0
  38. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_mdJson.rb +69 -0
  39. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadata.rb +88 -0
  40. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataExtension.rb +51 -0
  41. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataInfo.rb +123 -0
  42. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_onlineResource.rb +79 -0
  43. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_phone.rb +79 -0
  44. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_point.rb +36 -0
  45. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_polygon.rb +66 -0
  46. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_processStep.rb +75 -0
  47. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resolution.rb +53 -0
  48. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceFormat.rb +46 -0
  49. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceIdentifier.rb +60 -0
  50. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceInfo.rb +328 -0
  51. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceMaintenance.rb +61 -0
  52. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceSpecificUsage.rb +61 -0
  53. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_responsibleParty.rb +48 -0
  54. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_securityConstraint.rb +63 -0
  55. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_source.rb +59 -0
  56. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_spatialReference.rb +59 -0
  57. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonClass.rb +54 -0
  58. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonomy.rb +94 -0
  59. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_temporalElement.rb +82 -0
  60. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timeInstant.rb +56 -0
  61. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timePeriod.rb +64 -0
  62. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_verticalElement.rb +64 -0
  63. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_voucher.rb +49 -0
  64. data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +1 -1
  65. data/lib/adiwg/mdtranslator/readers/mdJson/validator.rb +43 -0
  66. data/lib/adiwg/mdtranslator/readers/mdReaders.rb +55 -0
  67. data/lib/adiwg/mdtranslator/version.rb +15 -4
  68. data/lib/adiwg/mdtranslator/writers/iso/classes/class_address.rb +107 -86
  69. data/lib/adiwg/mdtranslator/writers/iso/classes/class_aggregateInformation.rb +68 -57
  70. data/lib/adiwg/mdtranslator/writers/iso/classes/class_boundingPolygon.rb +59 -48
  71. data/lib/adiwg/mdtranslator/writers/iso/classes/class_browseGraphic.rb +57 -46
  72. data/lib/adiwg/mdtranslator/writers/iso/classes/class_citation.rb +149 -138
  73. data/lib/adiwg/mdtranslator/writers/iso/classes/class_contact.rb +83 -72
  74. data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataIdentification.rb +334 -322
  75. data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataQuality.rb +46 -34
  76. data/lib/adiwg/mdtranslator/writers/iso/classes/class_date.rb +47 -36
  77. data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +42 -31
  78. data/lib/adiwg/mdtranslator/writers/iso/classes/class_distribution.rb +29 -18
  79. data/lib/adiwg/mdtranslator/writers/iso/classes/class_distributor.rb +77 -66
  80. data/lib/adiwg/mdtranslator/writers/iso/classes/class_extent.rb +87 -76
  81. data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +113 -102
  82. data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureConstraint.rb +44 -33
  83. data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +121 -110
  84. data/lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb +45 -34
  85. data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +45 -36
  86. data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicBoundingBox.rb +78 -67
  87. data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicDescription.rb +25 -14
  88. data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb +30 -19
  89. data/lib/adiwg/mdtranslator/writers/iso/classes/class_identifier.rb +41 -30
  90. data/lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb +58 -49
  91. data/lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb +65 -54
  92. data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineString.rb +77 -66
  93. data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineage.rb +62 -51
  94. data/lib/adiwg/mdtranslator/writers/iso/classes/class_listedValue.rb +70 -59
  95. data/lib/adiwg/mdtranslator/writers/iso/classes/class_maintenanceInformation.rb +54 -43
  96. data/lib/adiwg/mdtranslator/writers/iso/classes/class_medium.rb +58 -47
  97. data/lib/adiwg/mdtranslator/writers/iso/classes/class_metadataExtension.rb +154 -143
  98. data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiGeometry.rb +138 -127
  99. data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiplicity.rb +37 -26
  100. data/lib/adiwg/mdtranslator/writers/iso/classes/class_onlineResource.rb +79 -68
  101. data/lib/adiwg/mdtranslator/writers/iso/classes/class_point.rb +77 -66
  102. data/lib/adiwg/mdtranslator/writers/iso/classes/class_polygon.rb +98 -87
  103. data/lib/adiwg/mdtranslator/writers/iso/classes/class_processStep.rb +80 -69
  104. data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceIdentifier.rb +38 -27
  105. data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +25 -14
  106. data/lib/adiwg/mdtranslator/writers/iso/classes/class_resolution.rb +51 -40
  107. data/lib/adiwg/mdtranslator/writers/iso/classes/class_responsibleParty.rb +88 -77
  108. data/lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb +70 -59
  109. data/lib/adiwg/mdtranslator/writers/iso/classes/class_source.rb +58 -47
  110. data/lib/adiwg/mdtranslator/writers/iso/classes/class_standardOrderProcess.rb +75 -63
  111. data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonClassification.rb +55 -44
  112. data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonSystem.rb +98 -87
  113. data/lib/adiwg/mdtranslator/writers/iso/classes/class_telephone.rb +73 -62
  114. data/lib/adiwg/mdtranslator/writers/iso/classes/class_temporalExtent.rb +58 -47
  115. data/lib/adiwg/mdtranslator/writers/iso/classes/class_timeInstant.rb +36 -27
  116. data/lib/adiwg/mdtranslator/writers/iso/classes/class_timePeriod.rb +42 -33
  117. data/lib/adiwg/mdtranslator/writers/iso/classes/class_usage.rb +59 -48
  118. data/lib/adiwg/mdtranslator/writers/iso/classes/class_useConstraints.rb +26 -15
  119. data/lib/adiwg/mdtranslator/writers/iso/classes/class_verticalExtent.rb +52 -41
  120. data/lib/adiwg/mdtranslator/writers/iso/classes/class_vouchers.rb +39 -28
  121. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_associationType.rb +41 -29
  122. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_characterSet.rb +82 -47
  123. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_classification.rb +42 -24
  124. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_datatype.rb +56 -34
  125. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb +34 -19
  126. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_initiativeType.rb +41 -29
  127. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_keywordType.rb +46 -27
  128. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_maintenanceFrequency.rb +55 -36
  129. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumFormat.rb +44 -26
  130. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumName.rb +68 -38
  131. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_obligation.rb +32 -25
  132. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_onlineFunction.rb +42 -25
  133. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_presentationForm.rb +58 -31
  134. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_progress.rb +44 -25
  135. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_restriction.rb +47 -32
  136. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_role.rb +52 -29
  137. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_scope.rb +58 -35
  138. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_spatialRepresentationType.rb +43 -30
  139. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_topicCategory.rb +51 -44
  140. data/lib/adiwg/mdtranslator/writers/iso/units/class_baseUnit.rb +26 -15
  141. data/lib/adiwg/mdtranslator/writers/iso/units/class_conventionalUnit.rb +56 -45
  142. data/lib/adiwg/mdtranslator/writers/iso/units/class_definitionUnit.rb +23 -12
  143. data/lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb +30 -19
  144. data/lib/adiwg/mdtranslator/writers/iso/units/class_unitsOfMeasure.rb +223 -212
  145. data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +174 -0
  146. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +41 -12
  147. data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +347 -0
  148. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +151 -119
  149. data/lib/adiwg/mdtranslator/writers/mdWriters.rb +63 -0
  150. data/test/readers/mdJson/v0_9/tc_reader_mdjson_additionalDocumentation.rb +84 -0
  151. data/test/readers/mdJson/v0_9/tc_reader_mdjson_address.rb +100 -0
  152. data/test/readers/mdJson/v0_9/tc_reader_mdjson_associatedResource.rb +100 -0
  153. data/test/readers/mdJson/v0_9/tc_reader_mdjson_browseGraphic.rb +66 -0
  154. data/test/readers/mdJson/v0_9/tc_reader_mdjson_citation.rb +115 -0
  155. data/test/readers/mdJson/v0_9/tc_reader_mdjson_contact.rb +137 -0
  156. data/test/readers/mdJson/v0_9/tc_reader_mdjson_onlineResource.rb +47 -0
  157. data/test/readers/mdJson/v0_9/tc_reader_mdjson_phone.rb +128 -0
  158. data/test/readers/mdJson/v0_9/tc_translation.rb +82 -0
  159. data/test/writers/iso19115_2/tc_writer_iso19115_2_address.rb +222 -0
  160. metadata +87 -60
  161. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_additionalDocumentation.rb +0 -36
  162. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_address.rb +0 -71
  163. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_associatedResource.rb +0 -66
  164. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_boundingBox.rb +0 -51
  165. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_browseGraphic.rb +0 -52
  166. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_citation.rb +0 -104
  167. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_contacts.rb +0 -121
  168. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_coordinates.rb +0 -52
  169. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataDictionary.rb +0 -53
  170. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataQuality.rb +0 -40
  171. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dateTime.rb +0 -27
  172. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_descriptiveKeyword.rb +0 -49
  173. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dictionaryInfo.rb +0 -52
  174. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_distributionInfo.rb +0 -150
  175. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domain.rb +0 -62
  176. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domainItem.rb +0 -42
  177. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entity.rb +0 -92
  178. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityAttribute.rb +0 -91
  179. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityForeignKey.rb +0 -43
  180. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityIndex.rb +0 -42
  181. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_extent.rb +0 -62
  182. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoCoordSystem.rb +0 -46
  183. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoProperties.rb +0 -89
  184. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geographicElement.rb +0 -168
  185. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_legalConstraint.rb +0 -45
  186. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineString.rb +0 -25
  187. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineage.rb +0 -50
  188. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadata.rb +0 -77
  189. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataExtension.rb +0 -40
  190. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataInfo.rb +0 -112
  191. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_onlineResource.rb +0 -62
  192. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_phone.rb +0 -59
  193. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_point.rb +0 -25
  194. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_polygon.rb +0 -55
  195. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_processStep.rb +0 -64
  196. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resolution.rb +0 -42
  197. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceFormat.rb +0 -35
  198. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceIdentifier.rb +0 -49
  199. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceInfo.rb +0 -317
  200. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceMaintenance.rb +0 -50
  201. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceSpecificUsage.rb +0 -50
  202. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_responsibleParty.rb +0 -37
  203. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_securityConstraint.rb +0 -52
  204. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_source.rb +0 -48
  205. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_spatialReference.rb +0 -48
  206. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonClass.rb +0 -43
  207. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonomy.rb +0 -83
  208. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_temporalElement.rb +0 -71
  209. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timeInstant.rb +0 -45
  210. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timePeriod.rb +0 -53
  211. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_verticalElement.rb +0 -53
  212. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_voucher.rb +0 -38
  213. data/lib/adiwg/mdtranslator/validator.rb +0 -43
  214. data/lib/adiwg/mdtranslator/writers/iso/classes/class_FCfeatureCatalogue.rb +0 -171
  215. data/lib/adiwg/mdtranslator/writers/iso/classes/class_MImetadata.rb +0 -333
  216. data/test/tc_translation.rb +0 -73
@@ -6,65 +6,76 @@
6
6
  # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
7
7
  # Stan Smith 2014-11-06 take initiativeType from internal initiativeType
8
8
  # ... rather than resourceType for 0.9.0
9
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
9
10
 
10
11
  require 'code_associationType'
11
12
  require 'code_initiativeType'
12
13
  require 'class_citation'
13
14
 
14
- class MD_AggregateInformation
15
-
16
- def initialize(xml)
17
- @xml = xml
18
- end
19
-
20
- def writeXML(hAssocRes)
21
-
22
- # aggregate information is being supported in the 19115-1 style,
23
- # ... aggregateDataSetIdentifier is being dropped and
24
- # ... resource identifiers are being carried inside the
25
- # ... citation > identifier section
26
-
27
- # classes used
28
- assocCode = DS_AssociationTypeCode.new(@xml)
29
- initCode = DS_InitiativeTypeCode.new(@xml)
30
- citationClass = CI_Citation.new(@xml)
31
-
32
- @xml.tag!('gmd:MD_AggregateInformation') do
33
-
34
- # aggregate information - aggregate data set name - citation
35
- hAssocCit = hAssocRes[:resourceCitation]
36
- if !hAssocCit.empty?
37
- @xml.tag!('gmd:aggregateDataSetName') do
38
- citationClass.writeXML(hAssocCit)
39
- end
40
- elsif $showAllTags
41
- @xml.tag!('gmd:aggregateDataSetName')
42
- end
43
-
44
- # aggregate information - aggregate data set identifier (use citation > identifier)
45
-
46
- # aggregate information - association type
47
- s = hAssocRes[:associationType]
48
- if !s.nil?
49
- @xml.tag!('gmd:associationType') do
50
- assocCode.writeXML(s)
51
- end
52
- elsif $showAllTags
53
- @xml.tag!('gmd:associationType')
54
- end
55
-
56
- # aggregate information - initiative type
57
- s = hAssocRes[:initiativeType]
58
- if !s.nil?
59
- @xml.tag!('gmd:initiativeType') do
60
- initCode.writeXML(s)
61
- end
62
- elsif $showAllTags
63
- @xml.tag!('gmd:initiativeType')
64
- end
65
-
66
- end
67
-
68
- end
69
-
70
- end
15
+ module ADIWG
16
+ module Mdtranslator
17
+ module Writers
18
+ module Iso
19
+
20
+ class MD_AggregateInformation
21
+
22
+ def initialize(xml)
23
+ @xml = xml
24
+ end
25
+
26
+ def writeXML(hAssocRes)
27
+
28
+ # aggregate information is being supported in the 19115-1 style,
29
+ # ... aggregateDataSetIdentifier is being dropped and
30
+ # ... resource identifiers are being carried inside the
31
+ # ... citation > identifier section
32
+
33
+ # classes used
34
+ assocCode = $WriterNS::DS_AssociationTypeCode.new(@xml)
35
+ initCode = $WriterNS::DS_InitiativeTypeCode.new(@xml)
36
+ citationClass = $WriterNS::CI_Citation.new(@xml)
37
+
38
+ @xml.tag!('gmd:MD_AggregateInformation') do
39
+
40
+ # aggregate information - aggregate data set name - citation
41
+ hAssocCit = hAssocRes[:resourceCitation]
42
+ if !hAssocCit.empty?
43
+ @xml.tag!('gmd:aggregateDataSetName') do
44
+ citationClass.writeXML(hAssocCit)
45
+ end
46
+ elsif $showAllTags
47
+ @xml.tag!('gmd:aggregateDataSetName')
48
+ end
49
+
50
+ # aggregate information - aggregate data set identifier (use citation > identifier)
51
+
52
+ # aggregate information - association type
53
+ s = hAssocRes[:associationType]
54
+ if !s.nil?
55
+ @xml.tag!('gmd:associationType') do
56
+ assocCode.writeXML(s)
57
+ end
58
+ elsif $showAllTags
59
+ @xml.tag!('gmd:associationType')
60
+ end
61
+
62
+ # aggregate information - initiative type
63
+ s = hAssocRes[:initiativeType]
64
+ if !s.nil?
65
+ @xml.tag!('gmd:initiativeType') do
66
+ initCode.writeXML(s)
67
+ end
68
+ elsif $showAllTags
69
+ @xml.tag!('gmd:initiativeType')
70
+ end
71
+
72
+ end
73
+
74
+ end
75
+
76
+ end
77
+
78
+ end
79
+ end
80
+ end
81
+ end
@@ -9,67 +9,78 @@
9
9
  # Stan Smith 2014-05-30 modified for version 0.5.0
10
10
  # Stan Smith 2014-05-30 added multi-point, multi-linestring, multi-polygon support
11
11
  # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
12
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
12
13
 
13
14
  require 'class_point'
14
15
  require 'class_lineString'
15
16
  require 'class_multiGeometry'
16
17
  require 'class_polygon'
17
18
 
18
- class EX_BoundingPolygon
19
+ module ADIWG
20
+ module Mdtranslator
21
+ module Writers
22
+ module Iso
19
23
 
20
- def initialize(xml)
21
- @xml = xml
22
- end
24
+ class EX_BoundingPolygon
23
25
 
24
- def writeXML(hGeoElement)
26
+ def initialize(xml)
27
+ @xml = xml
28
+ end
25
29
 
26
- # classes used by MD_Metadata
27
- pointClass = Point.new(@xml)
28
- lineClass = LineString.new(@xml)
29
- multiGeoClass = MultiGeometry.new(@xml)
30
- polygonClass = Polygon.new(@xml)
30
+ def writeXML(hGeoElement)
31
31
 
32
- hGeometry = hGeoElement[:elementGeometry]
33
- polyType = hGeometry[:geoType]
32
+ # classes used
33
+ pointClass = $WriterNS::Point.new(@xml)
34
+ lineClass = $WriterNS::LineString.new(@xml)
35
+ multiGeoClass = $WriterNS::MultiGeometry.new(@xml)
36
+ polygonClass = $WriterNS::Polygon.new(@xml)
34
37
 
35
- @xml.tag!('gmd:EX_BoundingPolygon') do
38
+ hGeometry = hGeoElement[:elementGeometry]
39
+ polyType = hGeometry[:geoType]
36
40
 
37
- # bounding polygon - extent type - required
38
- extentType = hGeoElement[:elementIncludeData]
39
- if extentType.nil?
40
- @xml.tag!('gmd:extentTypeCode',{'gco:nilReason'=>'missing'})
41
- elsif extentType == true || extentType == false
42
- @xml.tag!('gmd:extentTypeCode') do
43
- @xml.tag!('gco:Boolean',extentType)
44
- end
45
- else
46
- @xml.tag!('gmd:extentTypeCode',{'gco:nilReason'=>extentType})
47
- end
41
+ @xml.tag!('gmd:EX_BoundingPolygon') do
48
42
 
49
- # bounding polygon - polygon - required
50
- if hGeometry[:geometry].empty?
51
- @xml.tag!('gmd:polygon', {'gco:nilReason' => 'missing'})
52
- else
53
- @xml.tag!('gmd:polygon') do
54
- case polyType
55
- when 'Point'
56
- pointClass.writeXML(hGeoElement)
57
- when 'LineString'
58
- lineClass.writeXML(hGeoElement)
59
- when 'Polygon'
60
- polygonClass.writeXML(hGeoElement)
61
- when 'MultiPoint', 'MultiLineString', 'MultiPolygon', 'MultiGeometry'
62
- multiGeoClass.writeXML(hGeoElement)
63
- when 'MultiGeometry'
64
- multiGeoClass.writeXML(hGeoElement)
65
- else
66
- # log - the bounding polygon type is not supported
67
- end
68
- end
69
- end
43
+ # bounding polygon - extent type - required
44
+ extentType = hGeoElement[:elementIncludeData]
45
+ if extentType.nil?
46
+ @xml.tag!('gmd:extentTypeCode', {'gco:nilReason' => 'missing'})
47
+ elsif extentType == true || extentType == false
48
+ @xml.tag!('gmd:extentTypeCode') do
49
+ @xml.tag!('gco:Boolean', extentType)
50
+ end
51
+ else
52
+ @xml.tag!('gmd:extentTypeCode', {'gco:nilReason' => extentType})
53
+ end
70
54
 
71
- end
55
+ # bounding polygon - polygon - required
56
+ if hGeometry[:geometry].empty?
57
+ @xml.tag!('gmd:polygon', {'gco:nilReason' => 'missing'})
58
+ else
59
+ @xml.tag!('gmd:polygon') do
60
+ case polyType
61
+ when 'Point'
62
+ pointClass.writeXML(hGeoElement)
63
+ when 'LineString'
64
+ lineClass.writeXML(hGeoElement)
65
+ when 'Polygon'
66
+ polygonClass.writeXML(hGeoElement)
67
+ when 'MultiPoint', 'MultiLineString', 'MultiPolygon', 'MultiGeometry'
68
+ multiGeoClass.writeXML(hGeoElement)
69
+ when 'MultiGeometry'
70
+ multiGeoClass.writeXML(hGeoElement)
71
+ else
72
+ # log - the bounding polygon type is not supported
73
+ end
74
+ end
75
+ end
72
76
 
73
- end
77
+ end
74
78
 
75
- end
79
+ end
80
+
81
+ end
82
+
83
+ end
84
+ end
85
+ end
86
+ end
@@ -3,49 +3,60 @@
3
3
 
4
4
  # History:
5
5
  # Stan Smith 2013-10-17 original script
6
-
7
- class MD_BrowseGraphic
8
-
9
- def initialize(xml)
10
- @xml = xml
11
- end
12
-
13
- def writeXML(graphic)
14
-
15
- @xml.tag!('gmd:MD_BrowseGraphic') do
16
-
17
- # browse graphic - file name - required
18
- s = graphic[:bGName]
19
- if !s.nil?
20
- @xml.tag!('gmd:fileName') do
21
- @xml.tag!('gco:CharacterString',s)
22
- end
23
- elsif $showAllTags
24
- @xml.tag!('gmd:fileName')
25
- end
26
-
27
- # browse graphic - file description
28
- s = graphic[:bGDescription]
29
- if !s.nil?
30
- @xml.tag!('gmd:fileDescription') do
31
- @xml.tag!('gco:CharacterString',s)
32
- end
33
- elsif $showAllTags
34
- @xml.tag!('gmd:fileDescription')
35
- end
36
-
37
- # browse graphic - file type
38
- s = graphic[:bGType]
39
- if !s.nil?
40
- @xml.tag!('gmd:fileType') do
41
- @xml.tag!('gco:CharacterString',s)
42
- end
43
- elsif $showAllTags
44
- @xml.tag!('gmd:fileType')
45
- end
46
-
47
- end
48
-
49
- end
50
-
51
- end
6
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Writers
11
+ module Iso
12
+
13
+ class MD_BrowseGraphic
14
+
15
+ def initialize(xml)
16
+ @xml = xml
17
+ end
18
+
19
+ def writeXML(graphic)
20
+
21
+ @xml.tag!('gmd:MD_BrowseGraphic') do
22
+
23
+ # browse graphic - file name - required
24
+ s = graphic[:bGName]
25
+ if !s.nil?
26
+ @xml.tag!('gmd:fileName') do
27
+ @xml.tag!('gco:CharacterString', s)
28
+ end
29
+ elsif $showAllTags
30
+ @xml.tag!('gmd:fileName')
31
+ end
32
+
33
+ # browse graphic - file description
34
+ s = graphic[:bGDescription]
35
+ if !s.nil?
36
+ @xml.tag!('gmd:fileDescription') do
37
+ @xml.tag!('gco:CharacterString', s)
38
+ end
39
+ elsif $showAllTags
40
+ @xml.tag!('gmd:fileDescription')
41
+ end
42
+
43
+ # browse graphic - file type
44
+ s = graphic[:bGType]
45
+ if !s.nil?
46
+ @xml.tag!('gmd:fileType') do
47
+ @xml.tag!('gco:CharacterString', s)
48
+ end
49
+ elsif $showAllTags
50
+ @xml.tag!('gmd:fileType')
51
+ end
52
+
53
+ end
54
+
55
+ end
56
+
57
+ end
58
+
59
+ end
60
+ end
61
+ end
62
+ end
@@ -10,148 +10,159 @@
10
10
  # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
11
11
  # Stan Smith 2014-08-18 modify identifier section for schema 0.6.0
12
12
  # Stan Smith 2014-08-18 process isbn and issn from identifier section per 0.6.0
13
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
13
14
 
14
15
  require 'code_presentationForm'
15
16
  require 'class_responsibleParty'
16
17
  require 'class_date'
17
18
  require 'class_identifier'
18
19
 
19
- class CI_Citation
20
-
21
- def initialize(xml)
22
- @xml = xml
23
- end
24
-
25
- def writeXML(hCitation)
26
-
27
- # classes used in MD_Metadata
28
- presFormClass = CI_PresentationFormCode.new(@xml)
29
- rPartyClass = CI_ResponsibleParty.new(@xml)
30
- dateClass = CI_Date.new(@xml)
31
- idClass = MD_Identifier.new(@xml)
32
-
33
- @xml.tag!('gmd:CI_Citation') do
34
-
35
- # citation - title - required
36
- s = hCitation[:citTitle]
37
- if s.nil?
38
- @xml.tag!('gmd:title',{'gco:nilReason'=>'missing'})
39
- else
40
- @xml.tag!('gmd:title') do
41
- @xml.tag!('gco:CharacterString',s)
42
- end
43
- end
44
-
45
- # citation - date - required
46
- aDate = hCitation[:citDate]
47
- if aDate.empty?
48
- @xml.tag!('gmd:date', {'gco:nilReason' => 'missing'})
49
- else
50
- aDate.each do |hDate|
51
- @xml.tag!('gmd:date') do
52
- dateClass.writeXML(hDate)
53
- end
54
- end
55
- end
56
-
57
- # citation - edition
58
- s = hCitation[:citEdition]
59
- if !s.nil?
60
- @xml.tag!('gmd:edition') do
61
- @xml.tag!('gco:CharacterString',s)
62
- end
63
- elsif $showAllTags
64
- @xml.tag!('gmd:edition')
65
- end
66
-
67
- # citation - resource identifiers - MD_Identifier
68
- # do not process ISBN and ISSN as MD_identifier(s)
69
- # ... these are processed separately in ISO 19115-2
70
- aResIDs = hCitation[:citResourceIds]
71
- if !aResIDs.empty?
72
- aResIDs.each do |hResID|
73
- if !hResID[:identifierType].nil?
74
- next if hResID[:identifierType].downcase == 'isbn'
75
- next if hResID[:identifierType].downcase == 'issn'
76
- end
77
- @xml.tag!('gmd:identifier') do
78
- idClass.writeXML(hResID)
79
- end
80
- end
81
- elsif $showAllTags
82
- @xml.tag!('gmd:identifier')
83
- end
84
-
85
- # citation - cited responsible party
86
- aResParty = hCitation[:citResponsibleParty]
87
- if !aResParty.empty?
88
- aResParty.each do |rParty|
89
- @xml.tag!('gmd:citedResponsibleParty') do
90
- rPartyClass.writeXML(rParty)
91
- end
92
- end
93
- elsif $showAllTags
94
- @xml.tag!('gmd:citedResponsibleParty')
95
- end
96
-
97
- # citation - presentation forms - CI_PresentationFormCode
98
- aPresForms = hCitation[:citResourceForms]
99
- if !aPresForms.empty?
100
- aPresForms.each do |presForm|
101
- @xml.tag!('gmd:presentationForm') do
102
- presFormClass.writeXML(presForm)
103
- end
104
- end
105
- elsif $showAllTags
106
- @xml.tag!('gmd:presentationForm')
107
- end
108
-
109
- # citation - ISBN
110
- needTag = true
111
- aResIDs = hCitation[:citResourceIds]
112
- if !aResIDs.empty?
113
- aResIDs.each do |hResID|
114
- if !hResID[:identifierType].nil?
115
- if hResID[:identifierType].downcase == 'isbn'
116
- s = hResID[:identifier]
117
- if !s.nil?
118
- @xml.tag!('gmd:ISBN') do
119
- @xml.tag!('gco:CharacterString',s)
120
- needTag = false
121
- end
122
- end
123
- end
124
- end
125
- end
126
- end
127
- if $showAllTags && needTag
128
- @xml.tag!('gmd:ISBN')
129
- end
130
-
131
- # citation - ISSN
132
- needTag = true
133
- aResIDs = hCitation[:citResourceIds]
134
- if !aResIDs.empty?
135
- aResIDs.each do |hResID|
136
- if !hResID[:identifierType].nil?
137
- if hResID[:identifierType].downcase == 'issn'
138
- s = hResID[:identifier]
139
- if !s.nil?
140
- @xml.tag!('gmd:ISSN') do
141
- @xml.tag!('gco:CharacterString',s)
142
- needTag = false
143
- end
144
- end
145
- end
146
- end
147
- end
148
- end
149
- if $showAllTags && needTag
150
- @xml.tag!('gmd:ISSN')
151
- end
152
-
153
- end
154
-
155
- end
156
-
20
+ module ADIWG
21
+ module Mdtranslator
22
+ module Writers
23
+ module Iso
24
+
25
+ class CI_Citation
26
+
27
+ def initialize(xml)
28
+ @xml = xml
29
+ end
30
+
31
+ def writeXML(hCitation)
32
+
33
+ # classes used
34
+ presFormClass = $WriterNS::CI_PresentationFormCode.new(@xml)
35
+ rPartyClass = $WriterNS::CI_ResponsibleParty.new(@xml)
36
+ dateClass = $WriterNS::CI_Date.new(@xml)
37
+ idClass = $WriterNS::MD_Identifier.new(@xml)
38
+
39
+ @xml.tag!('gmd:CI_Citation') do
40
+
41
+ # citation - title - required
42
+ s = hCitation[:citTitle]
43
+ if s.nil?
44
+ @xml.tag!('gmd:title', {'gco:nilReason' => 'missing'})
45
+ else
46
+ @xml.tag!('gmd:title') do
47
+ @xml.tag!('gco:CharacterString', s)
48
+ end
49
+ end
50
+
51
+ # citation - date - required
52
+ aDate = hCitation[:citDate]
53
+ if aDate.empty?
54
+ @xml.tag!('gmd:date', {'gco:nilReason' => 'missing'})
55
+ else
56
+ aDate.each do |hDate|
57
+ @xml.tag!('gmd:date') do
58
+ dateClass.writeXML(hDate)
59
+ end
60
+ end
61
+ end
62
+
63
+ # citation - edition
64
+ s = hCitation[:citEdition]
65
+ if !s.nil?
66
+ @xml.tag!('gmd:edition') do
67
+ @xml.tag!('gco:CharacterString', s)
68
+ end
69
+ elsif $showAllTags
70
+ @xml.tag!('gmd:edition')
71
+ end
72
+
73
+ # citation - resource identifiers - MD_Identifier
74
+ # do not process ISBN and ISSN as MD_identifier(s)
75
+ # ... these are processed separately in ISO 19115-2
76
+ aResIDs = hCitation[:citResourceIds]
77
+ if !aResIDs.empty?
78
+ aResIDs.each do |hResID|
79
+ if !hResID[:identifierType].nil?
80
+ next if hResID[:identifierType].downcase == 'isbn'
81
+ next if hResID[:identifierType].downcase == 'issn'
82
+ end
83
+ @xml.tag!('gmd:identifier') do
84
+ idClass.writeXML(hResID)
85
+ end
86
+ end
87
+ elsif $showAllTags
88
+ @xml.tag!('gmd:identifier')
89
+ end
90
+
91
+ # citation - cited responsible party
92
+ aResParty = hCitation[:citResponsibleParty]
93
+ if !aResParty.empty?
94
+ aResParty.each do |rParty|
95
+ @xml.tag!('gmd:citedResponsibleParty') do
96
+ rPartyClass.writeXML(rParty)
97
+ end
98
+ end
99
+ elsif $showAllTags
100
+ @xml.tag!('gmd:citedResponsibleParty')
101
+ end
102
+
103
+ # citation - presentation forms - CI_PresentationFormCode
104
+ aPresForms = hCitation[:citResourceForms]
105
+ if !aPresForms.empty?
106
+ aPresForms.each do |presForm|
107
+ @xml.tag!('gmd:presentationForm') do
108
+ presFormClass.writeXML(presForm)
109
+ end
110
+ end
111
+ elsif $showAllTags
112
+ @xml.tag!('gmd:presentationForm')
113
+ end
114
+
115
+ # citation - ISBN
116
+ needTag = true
117
+ aResIDs = hCitation[:citResourceIds]
118
+ if !aResIDs.empty?
119
+ aResIDs.each do |hResID|
120
+ if !hResID[:identifierType].nil?
121
+ if hResID[:identifierType].downcase == 'isbn'
122
+ s = hResID[:identifier]
123
+ if !s.nil?
124
+ @xml.tag!('gmd:ISBN') do
125
+ @xml.tag!('gco:CharacterString', s)
126
+ needTag = false
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end
132
+ end
133
+ if $showAllTags && needTag
134
+ @xml.tag!('gmd:ISBN')
135
+ end
136
+
137
+ # citation - ISSN
138
+ needTag = true
139
+ aResIDs = hCitation[:citResourceIds]
140
+ if !aResIDs.empty?
141
+ aResIDs.each do |hResID|
142
+ if !hResID[:identifierType].nil?
143
+ if hResID[:identifierType].downcase == 'issn'
144
+ s = hResID[:identifier]
145
+ if !s.nil?
146
+ @xml.tag!('gmd:ISSN') do
147
+ @xml.tag!('gco:CharacterString', s)
148
+ needTag = false
149
+ end
150
+ end
151
+ end
152
+ end
153
+ end
154
+ end
155
+ if $showAllTags && needTag
156
+ @xml.tag!('gmd:ISSN')
157
+ end
158
+
159
+ end
160
+
161
+ end
162
+
163
+ end
164
+
165
+ end
166
+ end
167
+ end
157
168
  end