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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb133f79461697e8f43a63ffb954558529f1c32d
4
- data.tar.gz: 8d3e5b49675cf8bd0232d2ff01a8935f9bd8bf0a
3
+ metadata.gz: 63b3cd8cb6f3159a54205fd2f0a115a4c24d3c8a
4
+ data.tar.gz: d534245c030a32263c4d1cff67e5d3f3dcdec1df
5
5
  SHA512:
6
- metadata.gz: 9274cdf2cbeb17c54e1f5592d0920d169ebb570a83abf83b896adb75e575393f4666a02332c2d215f44a360d521c2a1a47c01a24b50da93e6fb72e3bf26ea33c
7
- data.tar.gz: 77005bdc01f83d02b127def3d4e5a3a9542d98b098c574facaaa3c22eb0cb4ae367a4f3b4fe7e291fa6b692758715debd31bd3ff660b0fcfb19a16e680c3efa0
6
+ metadata.gz: a09bbde9b021a3e44144ef06b9859c023095abeba947c95ac7c5f68faf260f724fc10c129a6b3da3db19718f8fd254a5c8857874f9021162f409cd6ec9b1aea5
7
+ data.tar.gz: cb801a07e03ecb09af2d3c7ae32235f0b4183c125d8c8acf70a520776b8d4cf1bb3e9b5550a1e44fb58021af1a7c3f09653b834c03ecb950b175708c63ef7fa6
data/.travis.yml CHANGED
@@ -1,7 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.0
4
- - 2.0.0
5
- - 1.9.3
6
- - jruby-19mode
3
+ - 2.1
4
+ - 2.2
7
5
  - ruby-head
data/Rakefile CHANGED
@@ -3,7 +3,10 @@ require 'rake/testtask'
3
3
 
4
4
  Rake::TestTask.new do |t|
5
5
  t.libs << 'test'
6
- t.test_files = FileList['test/tc*.rb']
6
+ t.test_files = FileList[
7
+ 'test/readers/mdJson/v0_9/tc*.rb',
8
+ 'test/writers/iso19115_2/tc*.rb',
9
+ ]
7
10
  t.verbose = true
8
11
  end
9
12
 
@@ -19,14 +19,16 @@ Gem::Specification.new do |spec|
19
19
  spec.test_files = spec.files.grep(%r{^(tc|test|spec|features)/})
20
20
  spec.require_paths = ["lib"]
21
21
 
22
+ spec.required_ruby_version = '>= 2.1'
23
+
22
24
  spec.add_development_dependency "bundler", "~> 1"
23
- spec.add_development_dependency "rake", "~>10"
24
- spec.add_development_dependency "minitest", "~>5"
25
+ spec.add_development_dependency "rake", "~> 10"
26
+ spec.add_development_dependency "minitest", "~> 5"
25
27
 
26
- spec.add_runtime_dependency "json", "~>1.8"
27
- spec.add_runtime_dependency "builder", "~>3.2"
28
- spec.add_runtime_dependency "thor", "~>0.19"
29
- spec.add_runtime_dependency "uuidtools", "~>2.1"
30
- spec.add_runtime_dependency "json-schema", "~>2.4.0"
31
- spec.add_runtime_dependency "adiwg-json_schemas", "~>0.9.4"
28
+ spec.add_runtime_dependency "json", "~> 1.8"
29
+ spec.add_runtime_dependency "builder", "~> 3.2"
30
+ spec.add_runtime_dependency "thor", "~> 0.19"
31
+ spec.add_runtime_dependency "uuidtools", "~> 2.1"
32
+ spec.add_runtime_dependency "json-schema", "~> 2.4.0", "< 2.5.0"
33
+ spec.add_runtime_dependency "adiwg-json_schemas", "~> 0.9.4"
32
34
  end
data/bin/mdtranslator CHANGED
@@ -6,6 +6,8 @@
6
6
  # Stan Smith 2014-09-02 changed name to mdtranslator
7
7
  # Stan Smith 2014-09-21 coded cli to 0.8.0 api
8
8
  # Stan Smith 2014-10-09 added version command to the CLI
9
+ # Stan Smith 2014-12-29 changed default reader from adiwgJson to mdJson
10
+ # Stan Smith 2015-01-15 changed translate method to use keyword arguments
9
11
 
10
12
  require 'thor'
11
13
  require 'adiwg-mdtranslator'
@@ -48,8 +50,12 @@ class Mdtranslator < Thor
48
50
  end
49
51
 
50
52
  # call mdtranslator
51
- mdReturn = ADIWG::Mdtranslator.translate(fileObj, options[:reader], options[:writer],
52
- options[:validate], options[:showAllTags])
53
+ mdReturn = ADIWG::Mdtranslator.translate(
54
+ file: fileObj,
55
+ reader: options[:reader],
56
+ writer: options[:writer],
57
+ validate: options[:validate],
58
+ showAllTags: options[:showAllTags])
53
59
 
54
60
  # determine return content and type of return ...
55
61
  if mdReturn[:readerStructurePass] && mdReturn[:readerValidationPass]
@@ -11,160 +11,85 @@
11
11
  # Stan Smith 2014-09-26 added processing of minor release numbers
12
12
  # Stan Smith 2014-10-10 added method to return path to readers and writers
13
13
  # Stan Smith 2014-10-11 added methods to return content of readme files
14
- # Stan Smith 2014-12-01 changed adiwgJson ot mdJson
14
+ # Stan Smith 2014-12-01 changed adiwgJson to mdJson
15
15
  # Stan Smith 2014-12-01 added writer iso19110 (feature catalogue)
16
16
  # Stan Smith 2014-12-01 added translator version to $response
17
17
  # Stan Smith 2014-12-02 organized shared class/code/units folders for 19115-2, 19110
18
+ # Stan Smith 2014-12-11 refactored to handle namespacing readers and writers
19
+ # Stan Smith 2015-01-15 changed translate() to keyword parameter list
18
20
 
19
21
  # add main directories to load_path
20
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'mdtranslator'))
21
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'mdtranslator/internal'))
22
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'mdtranslator/readers'))
23
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'mdtranslator/writers'))
22
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'mdtranslator/internal'))
24
23
 
25
- require 'version'
26
- require 'internal_metadata_obj'
24
+ require 'adiwg/mdtranslator/version'
27
25
 
28
- module ADIWG
29
-
30
- module Mdtranslator
31
-
32
- def self.translate(file, reader, writer, validate, showAllTags)
33
-
34
- $showAllTags = showAllTags
35
-
36
- # load and return this hash
37
- $response = {
38
- readerFormat: nil,
39
- readerStructurePass: nil,
40
- readerStructureMessages: [],
41
- readerRequested: reader,
42
- readerFound: nil,
43
- readerVersionFound: nil,
44
- readerVersionUsed: nil,
45
- readerValidationLevel: validate,
46
- readerValidationPass: nil,
47
- readerValidationMessages: [],
48
- writerName: writer,
49
- writerVersion: ADIWG::Mdtranslator::VERSION,
50
- writerFormat: nil,
51
- writerPass: nil,
52
- writerMessages: [],
53
- writerOutput: nil
54
- }
55
-
56
- case reader
57
-
58
- # ADIwg mdJson JSON schema
59
- when 'mdJson'
60
- require 'mdJson/mdJson_validator'
61
-
62
- # validate adiwgJson file
63
- MdJsonValidation.validate(file)
64
- if $response[:readerStructurePass] && $response[:readerValidationPass]
65
- # initiate the reader
66
- require 'mdJson/mdJson_reader'
67
- readerClass = MdJsonReader.new
68
- internalObj = readerClass.unpack(file)
69
- else
70
- return $response
71
- end
72
-
73
- # reader name not provided or not supported
74
- else
75
- $response[:readerValidationPass] = false
76
- $response[:readerValidationMessages] << 'Reader name is missing or not supported.'
77
- return $response
78
-
79
- end
80
-
81
- case writer
82
-
83
- # ISO 19110 standard for feature catalogue used to describe tabular data dictionaries
84
- when 'iso19110'
85
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'mdtranslator/writers/iso/codelists'))
86
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'mdtranslator/writers/iso/classes'))
87
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'mdtranslator/writers/iso/units'))
88
- require 'iso19110/iso19110_writer'
89
-
90
- # set the format of the output file based on the writer specified
91
- $response[:writerFormat] = 'xml'
92
-
93
- writerClass = Iso19110Writer.new
26
+ # additional require statements to support rails
27
+ # ... these modules contain methods called by rails endpoints
28
+ # ... by default rails does not resolve namespaces beyond this point
29
+ require 'adiwg/mdtranslator/readers/mdReaders'
30
+ require 'adiwg/mdtranslator/writers/mdWriters'
94
31
 
95
- # initiate the writer
96
- $response[:writerOutput] = writerClass.writeXML(internalObj)
97
- if $response[:writerMessages].length > 0
98
- $response[:writerPass] = false
99
- else
100
- $response[:writerPass] = true
101
- end
102
-
103
- # ISO 19115-2:2009 standard for geospatial metadata
104
- when 'iso19115_2'
105
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'mdtranslator/writers/iso/codelists'))
106
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__),'mdtranslator/writers/iso/classes'))
107
- require 'iso19115_2/iso19115_2_writer'
108
-
109
- # set the format of the output file based on the writer specified
110
- $response[:writerFormat] = 'xml'
111
-
112
- writerClass = Iso191152Writer.new
113
-
114
- # initiate the writer
115
- $response[:writerOutput] = writerClass.writeXML(internalObj)
116
- if $response[:writerMessages].length > 0
117
- $response[:writerPass] = false
118
- else
119
- $response[:writerPass] = true
120
- end
121
-
122
- # writer name is missing or not supported
123
- else
124
- $response[:writerPass] = false
125
- $response[:writerMessages] << 'Writer name is missing or not supported.'
126
-
127
- end
128
-
129
- return $response
130
-
131
- end
132
-
133
- def self.reader_module(moduleName, version)
134
- dir = File.join($response[:readerFound], 'modules_' + version)
135
- file = File.join(dir, moduleName)
136
- return file
137
- end
138
-
139
- # return path to readers and writers
140
- def self.path_to_resources
141
- File.join(File.dirname(File.expand_path(__FILE__)),'mdtranslator')
142
- end
143
-
144
- # return reader readme text
145
- def self.get_reader_readme(reader)
146
- readmeText = 'No text found'
147
- path = File.join(path_to_resources, 'readers', reader, 'readme.md')
148
- if File.exist?(path)
149
- file = File.open(path, 'r')
150
- readmeText = file.read
151
- file.close
152
- end
153
- return readmeText
154
- end
155
-
156
- # return writer readme text
157
- def self.get_writer_readme(writer)
158
- readmeText = 'No text found'
159
- path = File.join(path_to_resources, 'writers', writer, 'readme.md')
160
- if File.exist?(path)
161
- file = File.open(path, 'r')
162
- readmeText = file.read
163
- file.close
164
- end
165
- return readmeText
166
- end
167
-
168
- end
32
+ module ADIWG
33
+ module Mdtranslator
34
+
35
+ def self.translate(file:, reader:, validate: 'normal', writer: nil, showAllTags: false)
36
+
37
+ $showAllTags = showAllTags
38
+
39
+ # load and return this hash
40
+ $response = {
41
+ readerFormat: nil,
42
+ readerStructurePass: nil,
43
+ readerStructureMessages: [],
44
+ readerRequested: reader,
45
+ readerFound: nil,
46
+ readerVersionFound: nil,
47
+ readerVersionUsed: nil,
48
+ readerValidationLevel: validate,
49
+ readerValidationPass: nil,
50
+ readerValidationMessages: [],
51
+ readerExecutionPass: nil,
52
+ readerExecutionMessages: [],
53
+ writerName: writer,
54
+ writerVersion: nil,
55
+ writerFormat: nil,
56
+ writerPass: nil,
57
+ writerMessages: [],
58
+ writerOutput: nil
59
+ }
60
+
61
+ # handle readers
62
+ if reader.nil? || reader == ''
63
+ $response[:readerValidationPass] = false
64
+ $response[:readerValidationMessages] << 'Reader name is missing.'
65
+ $response[:readerExecutionPass] = false
66
+ $response[:readerExecutionMessages] << 'Reader failed to complete.'
67
+ return $response
68
+ else
69
+ require File.join(File.dirname(__FILE__), 'mdtranslator/readers/mdReaders')
70
+ intObj = ADIWG::Mdtranslator::Readers.handleReader(file)
71
+
72
+ if intObj
73
+ $response[:readerExecutionPass] = true
74
+ else
75
+ $response[:readerExecutionPass] = false
76
+ $response[:readerExecutionMessages] << 'Reader failed to complete.'
77
+ return $response
78
+ end
79
+ end
80
+
81
+ # handle writers
82
+ if writer
83
+ require File.join(File.dirname(__FILE__), 'mdtranslator/writers/mdWriters')
84
+ ADIWG::Mdtranslator::Writers.handleWriter(intObj)
85
+ else
86
+ $response[:writerPass] = false
87
+ $response[:writerMessages] << 'Writer name is missing.'
88
+ end
89
+ return $response
90
+
91
+ end
92
+
93
+ end
169
94
 
170
95
  end
@@ -30,7 +30,7 @@
30
30
  # Stan Smith 2013-11-20 modified citation
31
31
  # Stan Smith 2013-12-16 added phone book
32
32
  # Stan Smith 2014-04-23 added protocol and doi to online resource
33
- # Stan Smith 2014-04-24 added jsonVersion to newBase
33
+ # Stan Smith 2014-04-24 added schema to newBase
34
34
  # Stan Smith 2014-04-24 renamed newDataId to newResourceInfo
35
35
  # Stan Smith 2014-04-24 reorganized newMetadata, newResourceInfo
36
36
  # Stan Smith 2014-04-24 added newMetadataInfo
@@ -49,543 +49,543 @@
49
49
 
50
50
  class InternalMetadata
51
51
 
52
- # initialize attribute values - nil
53
- # initialize arrays - []
54
- # initialize hashes - {}
55
-
56
- def initialize
57
- end
58
-
59
- def newBase
60
- intObj = {
61
- jsonVersion: {
62
- name: nil,
63
- version: nil
64
- },
65
- contacts: [],
66
- metadata: {},
67
- dataDictionary: {}
68
- }
69
- end
70
-
71
- def newDateTime
72
- intObj = {
73
- dateTime: nil,
74
- dateType: nil,
75
- dateResolution: nil
76
- }
77
- end
78
-
79
- def newContact
80
- intObj = {
81
- contactId: nil,
82
- indName: nil,
83
- orgName: nil,
84
- position: nil,
85
- phones: [],
86
- address: {},
87
- onlineRes: [],
88
- contactInstructions: nil
89
- }
90
- end
91
-
92
- def newPhone
93
- intObj = {
94
- phoneServiceType: nil,
95
- phoneName: nil,
96
- phoneNumber: nil
97
- }
98
- end
99
-
100
- def newAddress
101
- intObj = {
102
- deliveryPoints: [],
103
- city: nil,
104
- adminArea: nil,
105
- postalCode: nil,
106
- country: nil,
107
- eMailList: []
108
- }
109
- end
110
-
111
- def newMetadata
112
- intObj = {
113
- metadataInfo: {},
114
- resourceInfo: {},
115
- distributorInfo: [],
116
- associatedResources: [],
117
- additionalDocuments: []
118
- }
119
- end
120
-
121
- def newMetadataInfo
122
- intObj = {
123
- metadataId: {},
124
- parentMetadata: {},
125
- metadataCustodians: [],
126
- metadataCreateDate: {},
127
- metadataUpdateDate: {},
128
- metadataURI: nil,
129
- metadataStatus: nil,
130
- maintInfo: {},
131
- extensions: []
132
- }
133
- end
134
-
135
- def newRespParty
136
- intObj = {
137
- contactId: nil,
138
- roleName: nil
139
- }
140
- end
141
-
142
- def newOnlineResource
143
- intObj = {
144
- olResURI: nil,
145
- olResProtocol: nil,
146
- olResName: nil,
147
- olResDesc: nil,
148
- olResFunction: nil
149
- }
150
- end
151
-
152
- def newResourceInfo
153
- intObj = {
154
- resourceType: nil,
155
- citation: {},
156
- timePeriod: {},
157
- abstract: nil,
158
- shortAbstract: nil,
159
- hasMapLocation?: nil,
160
- hasDataAvailable?: nil,
161
- purpose: nil,
162
- credits: [],
163
- status: nil,
164
- pointsOfContact: [],
165
- resourceMaint: [],
166
- graphicOverview: [],
167
- resourceFormats: [],
168
- resourceLanguages: [],
169
- descriptiveKeywords: [],
170
- resourceUses: [],
171
- useConstraints: [],
172
- legalConstraints: [],
173
- securityConstraints: [],
174
- taxonomy: {},
175
- spatialReferenceSystem: {},
176
- spatialRepresentationTypes: [],
177
- spatialResolutions: [],
178
- topicCategories: [],
179
- environmentDescription: nil,
180
- extents: [],
181
- dataQualityInfo: [],
182
- supplementalInfo: nil
183
- }
184
- end
185
-
186
- def newCitation
187
- intObj = {
188
- citTitle: nil,
189
- citDate: [],
190
- citEdition: nil,
191
- citResourceIds: [],
192
- citResponsibleParty: [],
193
- citResourceForms: [],
194
- citOlResources: []
195
- }
196
- end
197
-
198
- def newResourceId
199
- intObj = {
200
- identifier: nil,
201
- identifierType: nil,
202
- identifierCitation: {}
203
- }
204
- end
205
-
206
- def newResourceFormat
207
- intObj = {
208
- formatName: nil,
209
- formatVersion: nil
210
- }
211
- end
212
-
213
- def newResourceMaint
214
- intObj = {
215
- maintFreq: nil,
216
- maintNotes: [],
217
- maintContacts: []
218
- }
219
- end
220
-
221
- def newKeyword
222
- intObj = {
223
- keyword: [],
224
- keywordType: nil,
225
- keyTheCitation: {}
226
- }
227
- end
228
-
229
- def newLegalCon
230
- intObj = {
231
- accessCons: [],
232
- useCons: [],
233
- otherCons: []
234
- }
235
- end
236
-
237
- def newSecurityCon
238
- intObj = {
239
- classification: nil,
240
- userNote: nil,
241
- classSystem: nil,
242
- handlingDesc: nil
243
- }
244
- end
245
-
246
- def newDistributor
247
- intObj = {
248
- distContact: {},
249
- distOrderProc: [],
250
- distFormat: [],
251
- distTransOption: []
252
- }
253
- end
254
-
255
- def newDistOrder
256
- intObj = {
257
- fees: nil,
258
- plannedDateTime: {},
259
- orderInstructions: nil,
260
- turnaround: nil
261
- }
262
- end
263
-
264
- def newDigitalTransOption
265
- intObj = {
266
- online: [],
267
- offline: {}
268
- }
269
- end
270
-
271
- def newMedium
272
- intObj = {
273
- mediumName: nil,
274
- mediumFormat: nil,
275
- mediumNote: nil
276
- }
277
- end
278
-
279
- def newBrowseGraphic
280
- intObj = {
281
- bGName: nil,
282
- bGDescription: nil,
283
- bGType: nil,
284
- bGURI: nil
285
- }
286
- end
287
-
288
- def newSpatialReferenceSystem
289
- intObj = {
290
- sRNames: [],
291
- sREPSGs: [],
292
- sRWKTs: []
293
- }
294
- end
295
-
296
- def newExtent
297
- intObj = {
298
- extDesc: nil,
299
- extGeoElements: [],
300
- extIdElements: [],
301
- extTempElements: [],
302
- extVertElements: []
303
- }
304
- end
305
-
306
- def newGeoElement
307
- intObj = {
308
- elementId: nil,
309
- elementIncludeData: nil,
310
- elementName: nil,
311
- elementDescription: nil,
312
- temporalElements: [],
313
- verticalElements: [],
314
- elementIdentifiers: [],
315
- elementScope: nil,
316
- elementAcquisition: nil,
317
- elementSrs: {},
318
- elementGeometry: {}
319
- }
320
- end
321
-
322
- def newSRS
323
- intObj = {
324
- srsName: nil,
325
- srsHref: nil,
326
- sysType: nil
327
- }
328
- end
329
-
330
- def newGeometry
331
- intObj = {
332
- geoType: nil,
333
- geometry: {},
334
- dimension: nil
335
- }
336
- end
337
-
338
- def newBoundingBox
339
- intObj = {
340
- westLong: nil,
341
- eastLong: nil,
342
- southLat: nil,
343
- northLat: nil
344
- }
345
- end
346
-
347
- def newPolygonSet
348
- intObj = {
349
- exteriorRing: {},
350
- exclusionRings: []
351
- }
352
- end
353
-
354
- def newTemporalElement
355
- intObj = {
356
- date: {},
357
- timeInstant: {},
358
- timePeriod: {}
359
- }
360
- end
361
-
362
- def newTimeInstant
363
- intObj = {
364
- timeId: nil,
365
- description: nil,
366
- timePosition: {}
367
- }
368
- end
369
-
370
- def newTimePeriod
371
- intObj = {
372
- timeId: nil,
373
- description: nil,
374
- beginTime: {},
375
- endTime: {}
376
- }
377
- end
378
-
379
- def newVerticalElement
380
- intObj = {
381
- minValue: nil,
382
- maxValue: nil,
383
- crsURI: nil,
384
- crsTitle: nil
385
- }
386
- end
387
-
388
- def newLegalConstraint
389
- intObj = {
390
- accessCodes: [],
391
- useCodes: [],
392
- otherCons: []
393
- }
394
- end
395
-
396
- def newSecurityConstraint
397
- intObj = {
398
- classCode: nil,
399
- userNote: nil,
400
- classSystem: nil,
401
- handlingDesc: nil
402
- }
403
- end
404
-
405
- def newDataUsage
406
- intObj = {
407
- specificUsage: nil,
408
- userLimits: nil,
409
- userContacts: []
410
- }
411
- end
412
-
413
- def newTaxonSystem
414
- intObj = {
415
- taxClassSys: [],
416
- taxGeneralScope: nil,
417
- taxObservers: [],
418
- taxIdProcedures: nil,
419
- taxVoucher: {},
420
- taxClasses: []
421
- }
422
- end
423
-
424
- def newTaxonVoucher
425
- intObj = {
426
- specimen: nil,
427
- repository: {}
428
- }
429
- end
430
-
431
- def newTaxonClass
432
- intObj = {
433
- commonName: nil,
434
- taxRankName: nil,
435
- taxRankValue: nil
436
- }
437
- end
438
-
439
- def newResolution
440
- intObj = {
441
- equivalentScale: nil,
442
- distance: nil,
443
- distanceUOM: nil
444
- }
445
- end
446
-
447
- def newDataQuality
448
- intObj = {
449
- dataScope: nil,
450
- dataLineage: {}
451
- }
452
- end
453
-
454
- def newLineage
455
- intObj = {
456
- statement: nil,
457
- processSteps: [],
458
- dataSources: []
459
- }
460
- end
461
-
462
- def newDataProcessStep
463
- intObj = {
464
- stepId: nil,
465
- stepDescription: nil,
466
- stepRationale: nil,
467
- stepDateTime: {},
468
- stepProcessors: []
469
- }
470
- end
471
-
472
- def newDataSource
473
- intObj = {
474
- sourceDescription: nil,
475
- sourceCitation: {},
476
- sourceSteps: []
477
- }
478
- end
479
-
480
- def newMetadataExtension
481
- intObj = {
482
- onLineResource: {},
483
- extName: nil,
484
- extShortName: nil,
485
- extDefinition: nil,
486
- obligation: nil,
487
- dataType: nil,
488
- maxOccurrence: nil,
489
- parentEntities: [],
490
- rule: nil,
491
- rationales: [],
492
- extSources: []
493
- }
494
- end
495
-
496
- def newAssociatedResource
497
- intObj = {
498
- associationType: nil,
499
- initiativeType: nil,
500
- resourceType: nil,
501
- resourceCitation: {},
502
- metadataCitation: {}
503
- }
504
- end
505
-
506
- def newAdditionalDocumentation
507
- intObj = {
508
- resourceType: nil,
509
- citation: {}
510
- }
511
- end
512
-
513
- def newDataDictionary
514
- intObj = {
515
- dictionaryInfo: {},
516
- domains: [],
517
- entities: []
518
- }
519
- end
520
-
521
- def newDictionaryInfo
522
- intObj = {
523
- dictCitation: {},
524
- dictDescription: nil,
525
- dictResourceType: nil,
526
- dictLanguage: nil
527
- }
528
- end
529
-
530
- def newDictionaryDomain
531
- intObj = {
532
- domainId: nil,
533
- domainName: nil,
534
- domainCode: nil,
535
- domainDescription: nil,
536
- domainItems: []
537
- }
538
- end
539
-
540
- def newDomainItem
541
- intObj = {
542
- itemName: nil,
543
- itemValue: nil,
544
- itemDefinition: nil
545
- }
546
- end
547
-
548
- def newEntity
549
- intObj = {
550
- entityId: nil,
551
- entityName: nil,
552
- entityCode: nil,
553
- entityDefinition: nil,
554
- primaryKey: [],
555
- indexes: [],
556
- attributes: [],
557
- foreignKeys: []
558
- }
559
- end
560
-
561
- def newEntityIndex
562
- intObj = {
563
- indexCode: nil,
52
+ # initialize attribute values - nil
53
+ # initialize arrays - []
54
+ # initialize hashes - {}
55
+
56
+ def initialize
57
+ end
58
+
59
+ def newBase
60
+ intObj = {
61
+ schema: {
62
+ name: nil,
63
+ version: nil
64
+ },
65
+ contacts: [],
66
+ metadata: {},
67
+ dataDictionary: {}
68
+ }
69
+ end
70
+
71
+ def newDateTime
72
+ intObj = {
73
+ dateTime: nil,
74
+ dateType: nil,
75
+ dateResolution: nil
76
+ }
77
+ end
78
+
79
+ def newContact
80
+ intObj = {
81
+ contactId: nil,
82
+ indName: nil,
83
+ orgName: nil,
84
+ position: nil,
85
+ phones: [],
86
+ address: {},
87
+ onlineRes: [],
88
+ contactInstructions: nil
89
+ }
90
+ end
91
+
92
+ def newPhone
93
+ intObj = {
94
+ phoneServiceType: nil,
95
+ phoneName: nil,
96
+ phoneNumber: nil
97
+ }
98
+ end
99
+
100
+ def newAddress
101
+ intObj = {
102
+ deliveryPoints: [],
103
+ city: nil,
104
+ adminArea: nil,
105
+ postalCode: nil,
106
+ country: nil,
107
+ eMailList: []
108
+ }
109
+ end
110
+
111
+ def newMetadata
112
+ intObj = {
113
+ metadataInfo: {},
114
+ resourceInfo: {},
115
+ distributorInfo: [],
116
+ associatedResources: [],
117
+ additionalDocuments: []
118
+ }
119
+ end
120
+
121
+ def newMetadataInfo
122
+ intObj = {
123
+ metadataId: {},
124
+ parentMetadata: {},
125
+ metadataCustodians: [],
126
+ metadataCreateDate: {},
127
+ metadataUpdateDate: {},
128
+ metadataURI: nil,
129
+ metadataStatus: nil,
130
+ maintInfo: {},
131
+ extensions: []
132
+ }
133
+ end
134
+
135
+ def newRespParty
136
+ intObj = {
137
+ contactId: nil,
138
+ roleName: nil
139
+ }
140
+ end
141
+
142
+ def newOnlineResource
143
+ intObj = {
144
+ olResURI: nil,
145
+ olResProtocol: nil,
146
+ olResName: nil,
147
+ olResDesc: nil,
148
+ olResFunction: nil
149
+ }
150
+ end
151
+
152
+ def newResourceInfo
153
+ intObj = {
154
+ resourceType: nil,
155
+ citation: {},
156
+ timePeriod: {},
157
+ abstract: nil,
158
+ shortAbstract: nil,
159
+ hasMapLocation?: nil,
160
+ hasDataAvailable?: nil,
161
+ purpose: nil,
162
+ credits: [],
163
+ status: nil,
164
+ pointsOfContact: [],
165
+ resourceMaint: [],
166
+ graphicOverview: [],
167
+ resourceFormats: [],
168
+ resourceLanguages: [],
169
+ descriptiveKeywords: [],
170
+ resourceUses: [],
171
+ useConstraints: [],
172
+ legalConstraints: [],
173
+ securityConstraints: [],
174
+ taxonomy: {},
175
+ spatialReferenceSystem: {},
176
+ spatialRepresentationTypes: [],
177
+ spatialResolutions: [],
178
+ topicCategories: [],
179
+ environmentDescription: nil,
180
+ extents: [],
181
+ dataQualityInfo: [],
182
+ supplementalInfo: nil
183
+ }
184
+ end
185
+
186
+ def newCitation
187
+ intObj = {
188
+ citTitle: nil,
189
+ citDate: [],
190
+ citEdition: nil,
191
+ citResourceIds: [],
192
+ citResponsibleParty: [],
193
+ citResourceForms: [],
194
+ citOlResources: []
195
+ }
196
+ end
197
+
198
+ def newResourceId
199
+ intObj = {
200
+ identifier: nil,
201
+ identifierType: nil,
202
+ identifierCitation: {}
203
+ }
204
+ end
205
+
206
+ def newResourceFormat
207
+ intObj = {
208
+ formatName: nil,
209
+ formatVersion: nil
210
+ }
211
+ end
212
+
213
+ def newResourceMaint
214
+ intObj = {
215
+ maintFreq: nil,
216
+ maintNotes: [],
217
+ maintContacts: []
218
+ }
219
+ end
220
+
221
+ def newKeyword
222
+ intObj = {
223
+ keyword: [],
224
+ keywordType: nil,
225
+ keyTheCitation: {}
226
+ }
227
+ end
228
+
229
+ def newLegalCon
230
+ intObj = {
231
+ accessCons: [],
232
+ useCons: [],
233
+ otherCons: []
234
+ }
235
+ end
236
+
237
+ def newSecurityCon
238
+ intObj = {
239
+ classification: nil,
240
+ userNote: nil,
241
+ classSystem: nil,
242
+ handlingDesc: nil
243
+ }
244
+ end
245
+
246
+ def newDistributor
247
+ intObj = {
248
+ distContact: {},
249
+ distOrderProc: [],
250
+ distFormat: [],
251
+ distTransOption: []
252
+ }
253
+ end
254
+
255
+ def newDistOrder
256
+ intObj = {
257
+ fees: nil,
258
+ plannedDateTime: {},
259
+ orderInstructions: nil,
260
+ turnaround: nil
261
+ }
262
+ end
263
+
264
+ def newDigitalTransOption
265
+ intObj = {
266
+ online: [],
267
+ offline: {}
268
+ }
269
+ end
270
+
271
+ def newMedium
272
+ intObj = {
273
+ mediumName: nil,
274
+ mediumFormat: nil,
275
+ mediumNote: nil
276
+ }
277
+ end
278
+
279
+ def newBrowseGraphic
280
+ intObj = {
281
+ bGName: nil,
282
+ bGDescription: nil,
283
+ bGType: nil,
284
+ bGURI: nil
285
+ }
286
+ end
287
+
288
+ def newSpatialReferenceSystem
289
+ intObj = {
290
+ sRNames: [],
291
+ sREPSGs: [],
292
+ sRWKTs: []
293
+ }
294
+ end
295
+
296
+ def newExtent
297
+ intObj = {
298
+ extDesc: nil,
299
+ extGeoElements: [],
300
+ extIdElements: [],
301
+ extTempElements: [],
302
+ extVertElements: []
303
+ }
304
+ end
305
+
306
+ def newGeoElement
307
+ intObj = {
308
+ elementId: nil,
309
+ elementIncludeData: nil,
310
+ elementName: nil,
311
+ elementDescription: nil,
312
+ temporalElements: [],
313
+ verticalElements: [],
314
+ elementIdentifiers: [],
315
+ elementScope: nil,
316
+ elementAcquisition: nil,
317
+ elementSrs: {},
318
+ elementGeometry: {}
319
+ }
320
+ end
321
+
322
+ def newSRS
323
+ intObj = {
324
+ srsName: nil,
325
+ srsHref: nil,
326
+ sysType: nil
327
+ }
328
+ end
329
+
330
+ def newGeometry
331
+ intObj = {
332
+ geoType: nil,
333
+ geometry: {},
334
+ dimension: nil
335
+ }
336
+ end
337
+
338
+ def newBoundingBox
339
+ intObj = {
340
+ westLong: nil,
341
+ eastLong: nil,
342
+ southLat: nil,
343
+ northLat: nil
344
+ }
345
+ end
346
+
347
+ def newPolygonSet
348
+ intObj = {
349
+ exteriorRing: {},
350
+ exclusionRings: []
351
+ }
352
+ end
353
+
354
+ def newTemporalElement
355
+ intObj = {
356
+ date: {},
357
+ timeInstant: {},
358
+ timePeriod: {}
359
+ }
360
+ end
361
+
362
+ def newTimeInstant
363
+ intObj = {
364
+ timeId: nil,
365
+ description: nil,
366
+ timePosition: {}
367
+ }
368
+ end
369
+
370
+ def newTimePeriod
371
+ intObj = {
372
+ timeId: nil,
373
+ description: nil,
374
+ beginTime: {},
375
+ endTime: {}
376
+ }
377
+ end
378
+
379
+ def newVerticalElement
380
+ intObj = {
381
+ minValue: nil,
382
+ maxValue: nil,
383
+ crsURI: nil,
384
+ crsTitle: nil
385
+ }
386
+ end
387
+
388
+ def newLegalConstraint
389
+ intObj = {
390
+ accessCodes: [],
391
+ useCodes: [],
392
+ otherCons: []
393
+ }
394
+ end
395
+
396
+ def newSecurityConstraint
397
+ intObj = {
398
+ classCode: nil,
399
+ userNote: nil,
400
+ classSystem: nil,
401
+ handlingDesc: nil
402
+ }
403
+ end
404
+
405
+ def newDataUsage
406
+ intObj = {
407
+ specificUsage: nil,
408
+ userLimits: nil,
409
+ userContacts: []
410
+ }
411
+ end
412
+
413
+ def newTaxonSystem
414
+ intObj = {
415
+ taxClassSys: [],
416
+ taxGeneralScope: nil,
417
+ taxObservers: [],
418
+ taxIdProcedures: nil,
419
+ taxVoucher: {},
420
+ taxClasses: []
421
+ }
422
+ end
423
+
424
+ def newTaxonVoucher
425
+ intObj = {
426
+ specimen: nil,
427
+ repository: {}
428
+ }
429
+ end
430
+
431
+ def newTaxonClass
432
+ intObj = {
433
+ commonName: nil,
434
+ taxRankName: nil,
435
+ taxRankValue: nil
436
+ }
437
+ end
438
+
439
+ def newResolution
440
+ intObj = {
441
+ equivalentScale: nil,
442
+ distance: nil,
443
+ distanceUOM: nil
444
+ }
445
+ end
446
+
447
+ def newDataQuality
448
+ intObj = {
449
+ dataScope: nil,
450
+ dataLineage: {}
451
+ }
452
+ end
453
+
454
+ def newLineage
455
+ intObj = {
456
+ statement: nil,
457
+ processSteps: [],
458
+ dataSources: []
459
+ }
460
+ end
461
+
462
+ def newDataProcessStep
463
+ intObj = {
464
+ stepId: nil,
465
+ stepDescription: nil,
466
+ stepRationale: nil,
467
+ stepDateTime: {},
468
+ stepProcessors: []
469
+ }
470
+ end
471
+
472
+ def newDataSource
473
+ intObj = {
474
+ sourceDescription: nil,
475
+ sourceCitation: {},
476
+ sourceSteps: []
477
+ }
478
+ end
479
+
480
+ def newMetadataExtension
481
+ intObj = {
482
+ onLineResource: {},
483
+ extName: nil,
484
+ extShortName: nil,
485
+ extDefinition: nil,
486
+ obligation: nil,
487
+ dataType: nil,
488
+ maxOccurrence: nil,
489
+ parentEntities: [],
490
+ rule: nil,
491
+ rationales: [],
492
+ extSources: []
493
+ }
494
+ end
495
+
496
+ def newAssociatedResource
497
+ intObj = {
498
+ associationType: nil,
499
+ initiativeType: nil,
500
+ resourceType: nil,
501
+ resourceCitation: {},
502
+ metadataCitation: {}
503
+ }
504
+ end
505
+
506
+ def newAdditionalDocumentation
507
+ intObj = {
508
+ resourceType: nil,
509
+ citation: {}
510
+ }
511
+ end
512
+
513
+ def newDataDictionary
514
+ intObj = {
515
+ dictionaryInfo: {},
516
+ domains: [],
517
+ entities: []
518
+ }
519
+ end
520
+
521
+ def newDictionaryInfo
522
+ intObj = {
523
+ dictCitation: {},
524
+ dictDescription: nil,
525
+ dictResourceType: nil,
526
+ dictLanguage: nil
527
+ }
528
+ end
529
+
530
+ def newDictionaryDomain
531
+ intObj = {
532
+ domainId: nil,
533
+ domainName: nil,
534
+ domainCode: nil,
535
+ domainDescription: nil,
536
+ domainItems: []
537
+ }
538
+ end
539
+
540
+ def newDomainItem
541
+ intObj = {
542
+ itemName: nil,
543
+ itemValue: nil,
544
+ itemDefinition: nil
545
+ }
546
+ end
547
+
548
+ def newEntity
549
+ intObj = {
550
+ entityId: nil,
551
+ entityName: nil,
552
+ entityCode: nil,
553
+ entityDefinition: nil,
554
+ primaryKey: [],
555
+ indexes: [],
556
+ attributes: [],
557
+ foreignKeys: []
558
+ }
559
+ end
560
+
561
+ def newEntityIndex
562
+ intObj = {
563
+ indexCode: nil,
564
564
  duplicate: false,
565
- attributeNames: []
566
- }
567
- end
568
-
569
- def newEntityAttribute
570
- intObj = {
571
- attributeName: nil,
572
- attributeCode: nil,
573
- attributeDefinition: nil,
574
- dataType: nil,
575
- allowNull: true,
576
- unitOfMeasure: nil,
577
- domainId: nil,
578
- minValue: nil,
579
- maxValue: nil
580
- }
581
- end
582
-
583
- def newEntityForeignKey
584
- intObj = {
585
- fkLocalAttributes: [],
586
- fkReferencedEntity: nil,
587
- fkReferencedAttributes: []
588
- }
589
- end
565
+ attributeNames: []
566
+ }
567
+ end
568
+
569
+ def newEntityAttribute
570
+ intObj = {
571
+ attributeName: nil,
572
+ attributeCode: nil,
573
+ attributeDefinition: nil,
574
+ dataType: nil,
575
+ allowNull: true,
576
+ unitOfMeasure: nil,
577
+ domainId: nil,
578
+ minValue: nil,
579
+ maxValue: nil
580
+ }
581
+ end
582
+
583
+ def newEntityForeignKey
584
+ intObj = {
585
+ fkLocalAttributes: [],
586
+ fkReferencedEntity: nil,
587
+ fkReferencedAttributes: []
588
+ }
589
+ end
590
590
 
591
591
  end