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
@@ -1,36 +0,0 @@
1
- # unpack additional doucmentation
2
- # Reader - ADIwg JSON V1 to internal data structure
3
-
4
- # History:
5
- # Stan Smith 2014-11-06 original script
6
-
7
- require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
8
-
9
- module Md_AdditionalDocumentation
10
-
11
- def self.unpack(hAddDoc)
12
-
13
- # instance classes needed in script
14
- intMetadataClass = InternalMetadata.new
15
- intAddDoc = intMetadataClass.newAssociatedResource
16
-
17
- # associated resource - resource type
18
- if hAddDoc.has_key?('resourceType')
19
- s = hAddDoc['resourceType']
20
- if s != ''
21
- intAddDoc[:resourceType] = s
22
- end
23
- end
24
-
25
- # associated resource - resource citation
26
- if hAddDoc.has_key?('citation')
27
- hCitation = hAddDoc['citation']
28
- unless hCitation.empty?
29
- intAddDoc[:citation] = Md_Citation.unpack(hCitation)
30
- end
31
- end
32
-
33
- return intAddDoc
34
- end
35
-
36
- end
@@ -1,71 +0,0 @@
1
- # unpack address
2
- # Reader - ADIwg JSON V1 to internal data structure
3
-
4
- # History:
5
- # Stan Smith 2013-10-21 original script
6
-
7
- module Md_Address
8
-
9
- def self.unpack(hConAddress)
10
-
11
- # instance classes needed in script
12
- intMetadataClass = InternalMetadata.new
13
- intAdd = nil
14
-
15
- unless hConAddress.empty?
16
- intAdd = intMetadataClass.newAddress
17
-
18
- # address - delivery point
19
- if hConAddress.has_key?('deliveryPoint')
20
- dPoint = hConAddress['deliveryPoint']
21
- dPoint.each do |addLine|
22
- intAdd[:deliveryPoints] << addLine
23
- end
24
- end
25
-
26
- # address - city
27
- if hConAddress.has_key?('city')
28
- s = hConAddress['city']
29
- if s != ''
30
- intAdd[:city] = s
31
- end
32
- end
33
-
34
- # address - admin area
35
- if hConAddress.has_key?('administrativeArea')
36
- s = hConAddress['administrativeArea']
37
- if s != ''
38
- intAdd[:adminArea] = s
39
- end
40
- end
41
-
42
- # address - postal code
43
- if hConAddress.has_key?('postalCode')
44
- s = hConAddress['postalCode']
45
- if s != ''
46
- intAdd[:postalCode] = s
47
- end
48
- end
49
-
50
- # address - country
51
- if hConAddress.has_key?('country')
52
- s = hConAddress['country']
53
- if s != ''
54
- intAdd[:country] = s
55
- end
56
- end
57
-
58
- # address - email
59
- if hConAddress.has_key?('electronicMailAddress')
60
- eMailList = hConAddress['electronicMailAddress']
61
- eMailList.each do |email|
62
- intAdd[:eMailList] << email
63
- end
64
- end
65
-
66
- end
67
-
68
- return intAdd
69
- end
70
-
71
- end
@@ -1,66 +0,0 @@
1
- # unpack associated resource
2
- # Reader - ADIwg JSON V1 to internal data structure
3
-
4
- # History:
5
- # Stan Smith 2014-05-02 original script
6
- # Stan Smith 2014-05-28 added resource identifier section
7
- # Stan Smith 2014-06-02 added resource metadata citation section
8
- # Stan Smith 2014-07-08 resolve require statements using Mdtranslator.reader_module
9
- # Stan Smith 2014-08-18 moved resourceIdentifier to citation module schema 0.6.0
10
- # Stan Smith 2014-11-06 changed resourceType to initiative type for 0.9.0
11
- # Stan Smith 2014-11-06 added resourceType for 0.9.0
12
-
13
- require ADIWG::Mdtranslator.reader_module('module_citation', $response[:readerVersionUsed])
14
-
15
- module Md_AssociatedResource
16
-
17
- def self.unpack(hAssocRes)
18
-
19
- # instance classes needed in script
20
- intMetadataClass = InternalMetadata.new
21
- intAssocRes = intMetadataClass.newAssociatedResource
22
-
23
- # associated resource - association type
24
- if hAssocRes.has_key?('associationType')
25
- s = hAssocRes['associationType']
26
- if s != ''
27
- intAssocRes[:associationType] = s
28
- end
29
- end
30
-
31
- # associated resource - initiative type
32
- if hAssocRes.has_key?('initiativeType')
33
- s = hAssocRes['initiativeType']
34
- if s != ''
35
- intAssocRes[:initiativeType] = s
36
- end
37
- end
38
-
39
- # associated resource - resource type
40
- if hAssocRes.has_key?('resourceType')
41
- s = hAssocRes['resourceType']
42
- if s != ''
43
- intAssocRes[:resourceType] = s
44
- end
45
- end
46
-
47
- # associated resource - resource citation
48
- if hAssocRes.has_key?('resourceCitation')
49
- hCitation = hAssocRes['resourceCitation']
50
- unless hCitation.empty?
51
- intAssocRes[:resourceCitation] = Md_Citation.unpack(hCitation)
52
- end
53
- end
54
-
55
- # associated resource - metadata citation
56
- if hAssocRes.has_key?('metadataCitation')
57
- hCitation = hAssocRes['metadataCitation']
58
- unless hCitation.empty?
59
- intAssocRes[:metadataCitation] = Md_Citation.unpack(hCitation)
60
- end
61
- end
62
-
63
- return intAssocRes
64
- end
65
-
66
- end
@@ -1,51 +0,0 @@
1
- # unpack bounding box
2
- # Reader - ADIwg JSON V1 to internal data structure
3
-
4
- # History:
5
- # Stan Smith 2013-11-07 original script
6
- # Stan Smith 2014-04-28 reorganized for json schema 0.3.0
7
-
8
- module Md_BoundingBox
9
-
10
- def self.unpack(aBBox)
11
-
12
- # instance classes needed in script
13
- intMetadataClass = InternalMetadata.new
14
- intGeometry = intMetadataClass.newGeometry
15
- intGeometry[:geoType] = 'BoundingBox'
16
-
17
- # unpack GeoJSON bounding box elements
18
- intBBox = intMetadataClass.newBoundingBox
19
- west = aBBox[0]
20
- south = aBBox[1]
21
- east = aBBox[2]
22
- north = aBBox[3]
23
-
24
- # validate coordinates if easting +/-180 and northing +/-90
25
- valid = false
26
- if (180 >= west) && (west >= -180)
27
- if (90 >= south) && (south >= -90)
28
- if (180 >= east) && (east >= -180)
29
- if (90 >= north) &&(north >= -90)
30
- valid = true
31
- end
32
- end
33
- end
34
- end
35
-
36
- # build internal geo element if valid
37
- if valid
38
- intBBox[:westLong] = west
39
- intBBox[:eastLong] = east
40
- intBBox[:southLat] = south
41
- intBBox[:northLat] = north
42
- intGeometry[:geometry] = intBBox
43
-
44
- return intGeometry
45
- else
46
- return nil
47
- end
48
-
49
- end
50
-
51
- end
@@ -1,52 +0,0 @@
1
- # unpack browse graphic
2
- # Reader - ADIwg JSON V1 to internal data structure
3
-
4
- # History:
5
- # Stan Smith 2013-10-17 original script
6
- # Stan Smith 2013-11-27 modified to process single browse graphic rather than array
7
- # Stan Smith 2014-04-28 modified attribute names to match json schema 0.3.0
8
-
9
- module Md_BrowseGraphic
10
-
11
- def self.unpack(hBgraphic)
12
-
13
- # instance classes needed in script
14
- intMetadataClass = InternalMetadata.new
15
- intBGraphic = intMetadataClass.newBrowseGraphic
16
-
17
- # graphic - file name
18
- if hBgraphic.has_key?('fileName')
19
- s = hBgraphic['fileName']
20
- if s != ''
21
- intBGraphic[:bGName] = s
22
- end
23
- end
24
-
25
- # graphic - file description
26
- if hBgraphic.has_key?('fileDescription')
27
- s = hBgraphic['fileDescription']
28
- if s != ''
29
- intBGraphic[:bGDescription] = s
30
- end
31
- end
32
-
33
- # graphic - file type
34
- if hBgraphic.has_key?('fileType')
35
- s = hBgraphic['fileType']
36
- if s != ''
37
- intBGraphic[:bGType] = s
38
- end
39
- end
40
-
41
- # graphic - web link
42
- if hBgraphic.has_key?('fileUri')
43
- s = hBgraphic['fileUri']
44
- if s != ''
45
- intBGraphic[:bGURI] = s
46
- end
47
- end
48
-
49
- return intBGraphic
50
- end
51
-
52
- end
@@ -1,104 +0,0 @@
1
- # unpack citation
2
- # Reader - ADIwg JSON V1 to internal data structure
3
-
4
- # History:
5
- # Stan Smith 2013-08-26 original script
6
- # Stan Smith 2014-04-25 modified to support json schema 0.3.0
7
- # Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
8
- # Stan Smith 2014-08-18 changed additionalIdentifier section to identifier schema 0.6.0
9
-
10
- require ADIWG::Mdtranslator.reader_module('module_dateTime', $response[:readerVersionUsed])
11
- require ADIWG::Mdtranslator.reader_module('module_responsibleParty', $response[:readerVersionUsed])
12
- require ADIWG::Mdtranslator.reader_module('module_onlineResource', $response[:readerVersionUsed])
13
- require ADIWG::Mdtranslator.reader_module('module_resourceIdentifier', $response[:readerVersionUsed])
14
-
15
- module Md_Citation
16
-
17
- def self.unpack(hCitation)
18
-
19
- # instance classes needed in script
20
- intMetadataClass = InternalMetadata.new
21
- intCitation = intMetadataClass.newCitation
22
-
23
- # citation - title
24
- if hCitation.has_key?('title')
25
- s = hCitation['title']
26
- if s != ''
27
- intCitation[:citTitle] = s
28
- end
29
- end
30
-
31
- # citation - date
32
- if hCitation.has_key?('date')
33
- aCitDates = hCitation['date']
34
- unless aCitDates.empty?
35
- aCitDates.each do |hCitDate|
36
- if hCitDate.has_key?('date')
37
- s = hCitDate['date']
38
- if s != ''
39
- intDateTime = Md_DateTime.unpack(s)
40
- if hCitDate.has_key?('dateType')
41
- s = hCitDate['dateType']
42
- if s != ''
43
- intDateTime[:dateType] = s
44
- end
45
- end
46
- intCitation[:citDate] << intDateTime
47
- end
48
- end
49
- end
50
- end
51
- end
52
-
53
- # citation - edition
54
- if hCitation.has_key?('edition')
55
- s = hCitation['edition']
56
- if s != ''
57
- intCitation[:citEdition] = s
58
- end
59
- end
60
-
61
- # citation - responsible party
62
- if hCitation.has_key?('responsibleParty')
63
- aRParty = hCitation['responsibleParty']
64
- unless aRParty.empty?
65
- aRParty.each do |hRParty|
66
- intCitation[:citResponsibleParty] << Md_ResponsibleParty.unpack(hRParty)
67
- end
68
- end
69
- end
70
-
71
- # citation - presentation form
72
- if hCitation.has_key?('presentationForm')
73
- aPForms = hCitation['presentationForm']
74
- unless aPForms.empty?
75
- aPForms.each do |pForm|
76
- intCitation[:citResourceForms] << pForm
77
- end
78
- end
79
- end
80
-
81
- # citation - resource identifiers
82
- if hCitation.has_key?('identifier')
83
- aResIds = hCitation['identifier']
84
- aResIds.each do |hIdentifier|
85
- unless hIdentifier.empty?
86
- intCitation[:citResourceIds] << Md_ResourceIdentifier.unpack(hIdentifier)
87
- end
88
- end
89
- end
90
-
91
- # citation - online resources
92
- if hCitation.has_key?('onlineResource')
93
- aOlRes = hCitation['onlineResource']
94
- aOlRes.each do |hOlRes|
95
- unless hOlRes.empty?
96
- intCitation[:citOlResources] << Md_OnlineResource.unpack(hOlRes)
97
- end
98
- end
99
- end
100
-
101
- return intCitation
102
- end
103
-
104
- end
@@ -1,121 +0,0 @@
1
- # unpack contacts
2
- # Reader - ADIwg JSON V1 to internal data structure
3
-
4
- # History:
5
- # Stan Smith 2013-08-20 original script
6
- # Stan Smith 2013-09-25 moved onlineResource to new module
7
- # Stan Smith 2013-10-21 moved address to new module
8
- # Stan Smith 2014-04-23 modify for json schema version 0.3.0
9
- # Stan Smith 2014-04-24 split default contacts to a separate method
10
- # Stan Smith 2014-05-14 combine phone service types
11
- # Stan Smith 2014-07-03 added module_path method to support versioning
12
-
13
- require ADIWG::Mdtranslator.reader_module('module_address', $response[:readerVersionUsed])
14
- require ADIWG::Mdtranslator.reader_module('module_onlineResource', $response[:readerVersionUsed])
15
- require ADIWG::Mdtranslator.reader_module('module_phone', $response[:readerVersionUsed])
16
-
17
- module Md_Contact
18
-
19
- def self.unpack(hContact)
20
-
21
- # instance classes needed in script
22
- intMetadataClass = InternalMetadata.new
23
- intCont = intMetadataClass.newContact
24
-
25
- # contact ID
26
- if hContact.has_key?('contactId')
27
- s = hContact['contactId']
28
- if s != ''
29
- intCont[:contactId] = s
30
- end
31
- end
32
-
33
- # individual name
34
- if hContact.has_key?('individualName')
35
- s = hContact['individualName']
36
- if s != ''
37
- intCont[:indName] = s
38
- end
39
- end
40
-
41
- # organization name
42
- if hContact.has_key?('organizationName')
43
- s = hContact['organizationName']
44
- if s != ''
45
- intCont[:orgName] = s
46
- end
47
- end
48
-
49
- # position name
50
- if hContact.has_key?('positionName')
51
- s = hContact['positionName']
52
- if s != ''
53
- intCont[:position] = s
54
- end
55
- end
56
-
57
- # online resources
58
- if hContact.has_key?('onlineResource')
59
- aOlRes = hContact['onlineResource']
60
- aOlRes.each do |hOlRes|
61
- unless hOlRes.empty?
62
- intCont[:onlineRes] << Md_OnlineResource.unpack(hOlRes)
63
- end
64
- end
65
- end
66
-
67
- # contact instructions
68
- if hContact.has_key?('contactInstructions')
69
- s = hContact['contactInstructions']
70
- if s != ''
71
- intCont[:contactInstructions] = s
72
- end
73
- end
74
-
75
- # phones - all service types
76
- if hContact.has_key?('phoneBook')
77
- aPhones = hContact['phoneBook']
78
- aPhones.each do |hPhone|
79
- intCont[:phones].concat(Md_Phone.unpack(hPhone))
80
- end
81
- end
82
-
83
- # address
84
- if hContact.has_key?('address')
85
- conAddress = hContact['address']
86
- intCont[:address] = Md_Address.unpack(conAddress)
87
- end
88
-
89
- return intCont
90
-
91
- end
92
-
93
- def self.setDefaultContacts()
94
-
95
- # add default contacts
96
- intMetadataClass = InternalMetadata.new
97
- aDefContacts = Array.new
98
-
99
- # contact to support biological extensions
100
- intCont = intMetadataClass.newContact
101
- intCont[:contactId] = 'ADIwgBio'
102
- intCont[:orgName] = 'National Biological Information Infrastructure (NBII)'
103
- aDefContacts << intCont
104
-
105
- # contact to support doi (digital object identifier)
106
- intCont = intMetadataClass.newContact
107
- intCont[:contactId] = 'ADIwgDOI'
108
- intCont[:orgName] = 'International DOI Foundation (IDF)'
109
-
110
- intOlRes = intMetadataClass.newOnlineResource
111
- intOlRes[:olResURI] = 'http://www.doi.org'
112
- intCont[:onlineRes] << intOlRes
113
-
114
- aDefContacts << intCont
115
-
116
- return aDefContacts
117
-
118
- end
119
-
120
-
121
- end