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
@@ -0,0 +1,328 @@
1
+ # unpack data identification
2
+ # Reader - ADIwg JSON V1 to internal data structure
3
+
4
+ # History:
5
+ # Stan Smith 2013-08-22 original script
6
+ # Stan Smith 2013-11-04 extents
7
+ # Stan Smith 2013-11-14 legal constraints
8
+ # Stan Smith 2013-11-20 taxonomy
9
+ # Stan Smith 2013-11-25 resource specific usage
10
+ # Stan Smith 2013-11-26 spatial resolution
11
+ # Stan Smith 2014-04-25 revised to support json schema version 0.3.0
12
+ # Stan Smith 2014-05-28 added resource identifier to citation json schema 0.5.0
13
+ # Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
14
+ # Stan Smith 2014-08-18 moved resourceIdentifier to citation module schema 0.6.0
15
+ # Stan Smith 2014-09-03 added spatial reference system module for 0.7.0
16
+ # Stan Smith 2014-10-29 added support for resource time period
17
+ # Stan Smith 2014-11-06 added resourceType for 0.9.0
18
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
19
+
20
+ require $ReaderNS.readerModule('module_citation')
21
+ require $ReaderNS.readerModule('module_resourceIdentifier')
22
+ require $ReaderNS.readerModule('module_responsibleParty')
23
+ require $ReaderNS.readerModule('module_resourceFormat')
24
+ require $ReaderNS.readerModule('module_descriptiveKeyword')
25
+ require $ReaderNS.readerModule('module_resourceMaintenance')
26
+ require $ReaderNS.readerModule('module_resourceSpecificUsage')
27
+ require $ReaderNS.readerModule('module_browseGraphic')
28
+ require $ReaderNS.readerModule('module_legalConstraint')
29
+ require $ReaderNS.readerModule('module_securityConstraint')
30
+ require $ReaderNS.readerModule('module_taxonomy')
31
+ require $ReaderNS.readerModule('module_resolution')
32
+ require $ReaderNS.readerModule('module_extent')
33
+ require $ReaderNS.readerModule('module_dataQuality')
34
+ require $ReaderNS.readerModule('module_spatialReference')
35
+ require $ReaderNS.readerModule('module_timePeriod')
36
+
37
+ module ADIWG
38
+ module Mdtranslator
39
+ module Readers
40
+ module MdJson
41
+
42
+ module ResourceInfo
43
+
44
+ def self.unpack(hResourceInfo)
45
+
46
+ # instance classes needed in script
47
+ intMetadataClass = InternalMetadata.new
48
+ intResInfo = intMetadataClass.newResourceInfo
49
+
50
+ # resource information - resource type
51
+ if hResourceInfo.has_key?('resourceType')
52
+ s = hResourceInfo['resourceType']
53
+ if s != ''
54
+ intResInfo[:resourceType] = s
55
+ end
56
+ end
57
+
58
+ # resource information - citation
59
+ if hResourceInfo.has_key?('citation')
60
+ hCitation = hResourceInfo['citation']
61
+ unless hCitation.empty?
62
+ intResInfo[:citation] = $ReaderNS::Citation.unpack(hCitation)
63
+ end
64
+ end
65
+
66
+ # resource information - resource time period
67
+ if hResourceInfo.has_key?('resourceTimePeriod')
68
+ hResPeriod = hResourceInfo['resourceTimePeriod']
69
+ unless hResPeriod.empty?
70
+ intResInfo[:timePeriod] = $ReaderNS::TimePeriod.unpack(hResPeriod)
71
+ end
72
+ end
73
+
74
+ # resource information - point of contact
75
+ if hResourceInfo.has_key?('pointOfContact')
76
+ aPOC = hResourceInfo['pointOfContact']
77
+ unless aPOC.empty?
78
+ aPOC.each do |rParty|
79
+ intResInfo[:pointsOfContact] << $ReaderNS::ResponsibleParty.unpack(rParty)
80
+ end
81
+ end
82
+ end
83
+
84
+ # resource information - abstract
85
+ if hResourceInfo.has_key?('abstract')
86
+ s = hResourceInfo['abstract']
87
+ if s != ''
88
+ intResInfo[:abstract] = s
89
+ end
90
+ end
91
+
92
+ # resource information - short abstract
93
+ if hResourceInfo.has_key?('shortAbstract')
94
+ s = hResourceInfo['shortAbstract']
95
+ if s != ''
96
+ intResInfo[:shortAbstract] = s
97
+ end
98
+ end
99
+
100
+ # resource information - status
101
+ if hResourceInfo.has_key?('status')
102
+ s = hResourceInfo['status']
103
+ if s != ''
104
+ intResInfo[:status] = s
105
+ end
106
+ end
107
+
108
+ # resource information - has mappable location
109
+ if hResourceInfo.has_key?('hasMapLocation')
110
+ s = hResourceInfo['hasMapLocation']
111
+ if s != ''
112
+ intResInfo[:hasMapLocation?] = s
113
+ end
114
+ end
115
+
116
+ # resource information - has data available
117
+ if hResourceInfo.has_key?('hasDataAvailable')
118
+ s = hResourceInfo['hasDataAvailable']
119
+ if s != ''
120
+ intResInfo[:hasDataAvailable?] = s
121
+ end
122
+ end
123
+
124
+ # resource information - language
125
+ if hResourceInfo.has_key?('language')
126
+ aLanguage = hResourceInfo['language']
127
+ unless aLanguage.empty?
128
+ aLanguage.each do |language|
129
+ intResInfo[:resourceLanguages] << language
130
+ end
131
+ end
132
+ end
133
+
134
+ # resource information - purpose
135
+ if hResourceInfo.has_key?('purpose')
136
+ s = hResourceInfo['purpose']
137
+ if s != ''
138
+ intResInfo[:purpose] = s
139
+ end
140
+ end
141
+
142
+ # resource information - credit
143
+ if hResourceInfo.has_key?('credit')
144
+ aCredits = hResourceInfo['credit']
145
+ unless aCredits.empty?
146
+ aCredits.each do |credit|
147
+ intResInfo[:credits] << credit
148
+ end
149
+ end
150
+ end
151
+
152
+ # resource information - topic category
153
+ if hResourceInfo.has_key?('topicCategory')
154
+ aTopics = hResourceInfo['topicCategory']
155
+ unless aTopics.empty?
156
+ aTopics.each do |topic|
157
+ intResInfo[:topicCategories] << topic
158
+ end
159
+ end
160
+ end
161
+
162
+ # resource information - environment description
163
+ if hResourceInfo.has_key?('environmentDescription')
164
+ s = hResourceInfo['environmentDescription']
165
+ if s != ''
166
+ intResInfo[:environmentDescription] = s
167
+ end
168
+ end
169
+
170
+ # resource information - resource format
171
+ if hResourceInfo.has_key?('resourceNativeFormat')
172
+ aResFormat = hResourceInfo['resourceNativeFormat']
173
+ unless aResFormat.empty?
174
+ aResFormat.each do |hResFormat|
175
+ intResInfo[:resourceFormats] << $ReaderNS::ResourceFormat.unpack(hResFormat)
176
+ end
177
+ end
178
+ end
179
+
180
+ # resource information - descriptive keywords
181
+ if hResourceInfo.has_key?('keyword')
182
+ aDesKeywords = hResourceInfo['keyword']
183
+ unless aDesKeywords.empty?
184
+ aDesKeywords.each do |hDesKeyword|
185
+ intResInfo[:descriptiveKeywords] << $ReaderNS::DescriptiveKeyword.unpack(hDesKeyword)
186
+ end
187
+ end
188
+ end
189
+
190
+ # resource information - resource maintenance
191
+ if hResourceInfo.has_key?('resourceMaintenance')
192
+ aResMaint = hResourceInfo['resourceMaintenance']
193
+ unless aResMaint.empty?
194
+ aResMaint.each do |hResource|
195
+ intResInfo[:resourceMaint] << $ReaderNS::ResourceMaintenance.unpack(hResource)
196
+ end
197
+ end
198
+ end
199
+
200
+ # resource information - resource specific usage
201
+ if hResourceInfo.has_key?('resourceSpecificUsage')
202
+ aResUses = hResourceInfo['resourceSpecificUsage']
203
+ unless aResUses.empty?
204
+ aResUses.each do |hUsage|
205
+ intResInfo[:resourceUses] << $ReaderNS::ResourceSpecificUsage.unpack(hUsage)
206
+ end
207
+ end
208
+ end
209
+
210
+ # resource information - graphic overview
211
+ if hResourceInfo.has_key?('graphicOverview')
212
+ aBrowseGraph = hResourceInfo['graphicOverview']
213
+ unless aBrowseGraph.empty?
214
+ aBrowseGraph.each do |hBGraphic|
215
+ intResInfo[:graphicOverview] << $ReaderNS::BrowseGraphic.unpack(hBGraphic)
216
+ end
217
+ end
218
+ end
219
+
220
+ # resource information - use constraints
221
+ if hResourceInfo.has_key?('constraint')
222
+ hConstraint = hResourceInfo['constraint']
223
+
224
+ # resource information - resource constraints - use
225
+ if hConstraint.has_key?('useLimitation')
226
+ aUseLimits = hConstraint['useLimitation']
227
+ unless aUseLimits.empty?
228
+ aUseLimits.each do |useLimit|
229
+ intResInfo[:useConstraints] << useLimit
230
+ end
231
+ end
232
+ end
233
+
234
+ # resource information - resource constraints - legal
235
+ if hConstraint.has_key?('legalConstraint')
236
+ aLegalCons = hConstraint['legalConstraint']
237
+ unless aLegalCons.empty?
238
+ aLegalCons.each do |hLegalCon|
239
+ intResInfo[:legalConstraints] << $ReaderNS::LegalConstraints.unpack(hLegalCon)
240
+ end
241
+ end
242
+ end
243
+
244
+ # resource information - resource constraints - security
245
+ if hConstraint.has_key?('securityConstraint')
246
+ aSecurityCons = hConstraint['securityConstraint']
247
+ unless aSecurityCons.empty?
248
+ aSecurityCons.each do |hSecurityCon|
249
+ intResInfo[:securityConstraints] << $ReaderNS::SecurityConstraints.unpack(hSecurityCon)
250
+ end
251
+ end
252
+ end
253
+
254
+ end
255
+
256
+ # resource information - taxonomy
257
+ if hResourceInfo.has_key?('taxonomy')
258
+ hTaxonomy = hResourceInfo['taxonomy']
259
+ unless hTaxonomy.empty?
260
+ intResInfo[:taxonomy] = $ReaderNS::Taxonomy.unpack(hTaxonomy)
261
+ end
262
+ end
263
+
264
+ # resource information - spatial reference systems
265
+ if hResourceInfo.has_key?('spatialReferenceSystem')
266
+ hSpatialRef = hResourceInfo['spatialReferenceSystem']
267
+ unless hSpatialRef.empty?
268
+ intResInfo[:spatialReferenceSystem] = $ReaderNS::SpatialReferenceSystem.unpack(hSpatialRef)
269
+ end
270
+ end
271
+
272
+ # resource information - spatial representation type
273
+ if hResourceInfo.has_key?('spatialRepresentation')
274
+ aSpatialType = hResourceInfo['spatialRepresentation']
275
+ unless aSpatialType.empty?
276
+ aSpatialType.each do |spType|
277
+ intResInfo[:spatialRepresentationTypes] << spType
278
+ end
279
+ end
280
+ end
281
+
282
+ # resource information - spatial resolution
283
+ if hResourceInfo.has_key?('spatialResolution')
284
+ aSpRes = hResourceInfo['spatialResolution']
285
+ unless aSpRes.empty?
286
+ aSpRes.each do |hResolution|
287
+ intResInfo[:spatialResolutions] << $ReaderNS::Resolution.unpack(hResolution)
288
+ end
289
+ end
290
+ end
291
+
292
+ # resource information - extent
293
+ if hResourceInfo.has_key?('extent')
294
+ aExtents = hResourceInfo['extent']
295
+ unless aExtents.empty?
296
+ aExtents.each do |hExtent|
297
+ intResInfo[:extents] << $ReaderNS::Extent.unpack(hExtent)
298
+ end
299
+ end
300
+ end
301
+
302
+ # resource information - data quality information
303
+ if hResourceInfo.has_key?('dataQualityInfo')
304
+ aDataQual = hResourceInfo['dataQualityInfo']
305
+ unless aDataQual.empty?
306
+ aDataQual.each do |hDQ|
307
+ intResInfo[:dataQualityInfo] << $ReaderNS::DataQuality.unpack(hDQ)
308
+ end
309
+ end
310
+ end
311
+
312
+ # resource information - supplemental info
313
+ if hResourceInfo.has_key?('supplementalInfo')
314
+ s = hResourceInfo['supplementalInfo']
315
+ if s != ''
316
+ intResInfo[:supplementalInfo] = s
317
+ end
318
+ end
319
+
320
+ return intResInfo
321
+ end
322
+
323
+ end
324
+
325
+ end
326
+ end
327
+ end
328
+ end
@@ -0,0 +1,61 @@
1
+ # unpack resource maintenance
2
+ # Reader - ADIwg JSON V1 to internal data structure
3
+
4
+ # History:
5
+ # Stan Smith 2013-10-31 original script
6
+ # Stan Smith 2013-12-18 made note an array
7
+ # Stan Smith 2013-12-18 added contact
8
+ # Stan Smith 2014-04-24 modified for json schema 0.3.0
9
+ # Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
10
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
11
+
12
+ require $ReaderNS.readerModule('module_responsibleParty')
13
+
14
+ module ADIWG
15
+ module Mdtranslator
16
+ module Readers
17
+ module MdJson
18
+
19
+ module ResourceMaintenance
20
+
21
+ def self.unpack(hResource)
22
+
23
+ # instance classes needed in script
24
+ intMetadataClass = InternalMetadata.new
25
+ intResMaint = intMetadataClass.newResourceMaint
26
+
27
+ # resource maintenance - frequency code
28
+ if hResource.has_key?('maintenanceFrequency')
29
+ s = hResource['maintenanceFrequency']
30
+ if s != ''
31
+ intResMaint[:maintFreq] = s
32
+ end
33
+ end
34
+
35
+ # resource maintenance - maintenance note
36
+ if hResource.has_key?('maintenanceNote')
37
+ aNotes = hResource['maintenanceNote']
38
+ unless aNotes.empty?
39
+ intResMaint[:maintNotes] = aNotes
40
+ end
41
+ end
42
+
43
+ # resource maintenance - contact
44
+ if hResource.has_key?('maintenanceContact')
45
+ aContact = hResource['maintenanceContact']
46
+ unless aContact.empty?
47
+ aContact.each do |hContact|
48
+ intResMaint[:maintContacts] << $ReaderNS::ResponsibleParty.unpack(hContact)
49
+ end
50
+ end
51
+ end
52
+
53
+ return intResMaint
54
+ end
55
+
56
+ end
57
+
58
+ end
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,61 @@
1
+ # unpack resource specific usage
2
+ # Reader - ADIwg JSON V1 to internal data structure
3
+
4
+ # History:
5
+ # Stan Smith 2013-11-25 original script
6
+ # Stan Smith 2013-11-27 modified to process a single resource usage
7
+ # Stan Smith 2014-04-28 modified attribute names to match json schema 0.3.0
8
+ # Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
9
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
10
+
11
+ require $ReaderNS.readerModule('module_responsibleParty')
12
+
13
+ module ADIWG
14
+ module Mdtranslator
15
+ module Readers
16
+ module MdJson
17
+
18
+ module ResourceSpecificUsage
19
+
20
+ def self.unpack(hUsage)
21
+
22
+ # instance classes needed in script
23
+ intMetadataClass = InternalMetadata.new
24
+ intUsage = intMetadataClass.newDataUsage
25
+
26
+ # resource specific usage - specific usage
27
+ if hUsage.has_key?('specificUsage')
28
+ s = hUsage['specificUsage']
29
+ if s != ''
30
+ intUsage[:specificUsage] = s
31
+ end
32
+ end
33
+
34
+ # resource specific usage - user determined limitations
35
+ if hUsage.has_key?('userDeterminedLimitation')
36
+ s = hUsage['userDeterminedLimitation']
37
+ if s != ''
38
+ intUsage[:userLimits] = s
39
+ end
40
+ end
41
+
42
+ # taxonomy - repository - responsible party
43
+ if hUsage.has_key?('userContactInfo')
44
+ aContacts = hUsage['userContactInfo']
45
+ unless aContacts.empty?
46
+ aContacts.each do |hContact|
47
+ intUsage[:userContacts] << $ReaderNS::ResponsibleParty.unpack(hContact)
48
+ end
49
+ end
50
+ end
51
+
52
+ return intUsage
53
+
54
+ end
55
+
56
+ end
57
+
58
+ end
59
+ end
60
+ end
61
+ end