adiwg-mdtranslator 2.9.2 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -2
  3. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +8 -8
  4. data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +179 -160
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_albers.rb +1 -2
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_azimuthEquidistant.rb +1 -2
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equidistantConic.rb +1 -2
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_equirectangular.rb +1 -2
  9. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_generalVertical.rb +1 -2
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_gnomonic.rb +1 -2
  11. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertConic.rb +1 -2
  12. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_lambertEqualArea.rb +1 -2
  13. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_mercator.rb +1 -2
  14. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_millerCylinder.rb +1 -2
  15. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_modifiedAlaska.rb +1 -2
  16. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_obliqueMercator.rb +1 -2
  17. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_orthographic.rb +1 -2
  18. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polarStereo.rb +1 -2
  19. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_polyconic.rb +1 -2
  20. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_robinson.rb +1 -2
  21. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_sinusoidal.rb +1 -2
  22. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_spaceOblique.rb +1 -2
  23. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_stereographic.rb +1 -2
  24. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_transverseMercator.rb +1 -2
  25. data/lib/adiwg/mdtranslator/readers/fgdc/modules/mapProjections/projection_vanDerGrinten.rb +1 -2
  26. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +16 -4
  27. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_citation.rb +14 -1
  28. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_codeSet.rb +8 -2
  29. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_contact.rb +36 -8
  30. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_date.rb +2 -2
  31. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_dateTime.rb +2 -2
  32. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_digitalForm.rb +8 -2
  33. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_distribution.rb +8 -2
  34. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entity.rb +12 -3
  35. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityAttribute.rb +5 -0
  36. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityOverview.rb +4 -1
  37. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_enumerated.rb +12 -3
  38. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +2 -2
  39. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geodeticReference.rb +13 -4
  40. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geographicResolution.rb +13 -4
  41. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_geologicAge.rb +6 -0
  42. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_horizontalReference.rb +3 -3
  43. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +58 -12
  44. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_keyword.rb +36 -0
  45. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_lineage.rb +8 -2
  46. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +1 -1
  47. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapCoordinateInfo.rb +51 -12
  48. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapGridSystem.rb +46 -9
  49. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapLocalPlanar.rb +8 -2
  50. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_mapProjection.rb +4 -1
  51. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_metadataInfo.rb +10 -4
  52. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_methodology.rb +4 -1
  53. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_offlineOption.rb +16 -4
  54. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_onlineOption.rb +13 -4
  55. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_orderProcess.rb +9 -1
  56. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_pointVector.rb +21 -4
  57. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_process.rb +8 -1
  58. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_publication.rb +8 -2
  59. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_quality.rb +14 -3
  60. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +8 -2
  61. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_raster.rb +12 -3
  62. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_security.rb +12 -3
  63. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_series.rb +8 -2
  64. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_source.rb +20 -5
  65. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_spatialDomain.rb +32 -8
  66. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +8 -2
  67. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonSystem.rb +20 -5
  68. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonomy.rb +8 -2
  69. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_transferInfo.rb +4 -1
  70. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalAltitude.rb +12 -3
  71. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_verticalDepth.rb +9 -0
  72. data/lib/adiwg/mdtranslator/readers/fgdc/version.rb +2 -1
  73. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +10 -10
  74. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +13 -16
  75. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_additionalDocumentation.rb +55 -55
  76. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_address.rb +85 -85
  77. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +8 -8
  78. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_associatedResource.rb +91 -92
  79. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attribute.rb +212 -212
  80. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_attributeGroup.rb +43 -43
  81. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_bearingDistanceResolution.rb +8 -8
  82. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_boundingBox.rb +11 -11
  83. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_citation.rb +17 -17
  84. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_constraint.rb +26 -13
  85. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contact.rb +13 -12
  86. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coordinateResolution.rb +8 -5
  87. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_coverageDescription.rb +77 -77
  88. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataDictionary.rb +9 -7
  89. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_date.rb +54 -54
  90. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dateTime.rb +35 -35
  91. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dimension.rb +70 -70
  92. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distribution.rb +15 -4
  93. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distributor.rb +53 -53
  94. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domain.rb +5 -5
  95. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domainItem.rb +5 -5
  96. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_duration.rb +92 -91
  97. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entity.rb +10 -10
  98. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +28 -18
  99. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityForeignKey.rb +58 -59
  100. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityIndex.rb +52 -53
  101. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_extent.rb +70 -56
  102. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_featureCollection.rb +64 -63
  103. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_format.rb +6 -6
  104. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_funding.rb +9 -6
  105. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geoJson.rb +47 -47
  106. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geodetic.rb +7 -7
  107. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicExtent.rb +12 -7
  108. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geographicResolution.rb +6 -5
  109. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geologicAge.rb +6 -6
  110. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryCollection.rb +63 -63
  111. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryFeature.rb +84 -84
  112. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryObject.rb +50 -49
  113. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_geometryProperties.rb +57 -57
  114. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +115 -100
  115. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georeferenceableRepresentation.rb +85 -82
  116. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gmlIdentifier.rb +46 -46
  117. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_graphic.rb +78 -78
  118. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_gridRepresentation.rb +61 -56
  119. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_identifier.rb +72 -72
  120. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_imageDescription.rb +106 -107
  121. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keyword.rb +4 -4
  122. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_keywordObject.rb +46 -46
  123. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_legalConstraint.rb +55 -51
  124. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_lineage.rb +87 -83
  125. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_locale.rb +46 -46
  126. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_maintenance.rb +73 -74
  127. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +11 -5
  128. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_measure.rb +56 -55
  129. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_medium.rb +88 -88
  130. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +106 -105
  131. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataInfo.rb +4 -3
  132. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataRepository.rb +4 -4
  133. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_obliqueLinePoint.rb +7 -4
  134. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_onlineResource.rb +60 -61
  135. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_orderProcess.rb +47 -47
  136. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_party.rb +57 -57
  137. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_phone.rb +49 -51
  138. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_processStep.rb +6 -6
  139. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +31 -30
  140. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_referenceSystemParameters.rb +16 -2
  141. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_releasability.rb +53 -47
  142. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +15 -13
  143. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceType.rb +46 -46
  144. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceUsage.rb +95 -95
  145. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_responsibleParty.rb +67 -67
  146. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_schema.rb +47 -46
  147. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scope.rb +47 -47
  148. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_scopeDescription.rb +68 -63
  149. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_securityConstraint.rb +50 -50
  150. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_series.rb +38 -38
  151. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +8 -8
  152. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialReference.rb +6 -5
  153. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialRepresentation.rb +77 -75
  154. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +8 -14
  155. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +71 -72
  156. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicSystem.rb +46 -45
  157. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +118 -116
  158. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_temporalExtent.rb +48 -46
  159. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInstant.rb +8 -8
  160. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timeInterval.rb +50 -50
  161. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +21 -14
  162. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +86 -75
  163. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_valueRange.rb +4 -4
  164. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorObject.rb +45 -45
  165. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_vectorRepresentation.rb +45 -33
  166. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalDatum.rb +28 -6
  167. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_verticalExtent.rb +59 -59
  168. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_voucher.rb +43 -43
  169. data/lib/adiwg/mdtranslator/readers/mdReaders.rb +6 -2
  170. data/lib/adiwg/mdtranslator/version.rb +9 -1
  171. data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +3 -3
  172. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureConstraint.rb +50 -46
  173. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +53 -43
  174. data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +3 -1
  175. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +1 -1
  176. data/lib/adiwg/mdtranslator/writers/mdWriters.rb +58 -58
  177. data/lib/adiwg/mdtranslator.rb +177 -165
  178. data/lib/adiwg/mdtranslator_cli.rb +8 -3
  179. metadata +2 -2
@@ -65,38 +65,59 @@ module ADIWG
65
65
  hIntExtent[:geographicExtents] << hIntGeoExtent
66
66
  hIntExtent[:description] = 'FGDC spatial domain'
67
67
 
68
- # spatial domain bio (descgeog) - geographic description
68
+ # spatial domain bio (descgeog) - geographic description (required)
69
69
  description = xDomain.xpath('./descgeog').text
70
70
  unless description.empty?
71
71
  hIntGeoExtent[:description] = description
72
72
  end
73
+ if description.empty?
74
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO geographic description is missing'
75
+ end
73
76
 
74
- # spatial domain 1.5.1 (bounding) - bounding box
77
+ # spatial domain 1.5.1 (bounding) - bounding box (required)
75
78
  xBbox = xDomain.xpath('./bounding')
76
79
  unless xBbox.empty?
77
80
  hBbox = intMetadataClass.newBoundingBox
78
81
 
79
- # bounding box 1.5.1.1 (westbc) - west coordinate
82
+ # bounding box 1.5.1.1 (westbc) - west coordinate (required)
80
83
  hBbox[:westLongitude] = xBbox.xpath('./westbc').text.to_f
84
+ if hBbox[:westLongitude].nil?
85
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bounding box west boundary is missing'
86
+ end
81
87
 
82
- # bounding box 1.5.1.2 (eastbc) - east coordinate
88
+ # bounding box 1.5.1.2 (eastbc) - east coordinate (required)
83
89
  hBbox[:eastLongitude] = xBbox.xpath('./eastbc').text.to_f
90
+ if hBbox[:eastLongitude].nil?
91
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bounding box east boundary is missing'
92
+ end
84
93
 
85
- # bounding box 1.5.1.3 (northbc) - north coordinate
94
+ # bounding box 1.5.1.3 (northbc) - north coordinate (required)
86
95
  hBbox[:northLatitude] = xBbox.xpath('./northbc').text.to_f
96
+ if hBbox[:northLatitude].nil?
97
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bounding box north boundary is missing'
98
+ end
87
99
 
88
- # bounding box 1.5.1.4 (southbc) - south coordinate
100
+ # bounding box 1.5.1.4 (southbc) - south coordinate (required)
89
101
  hBbox[:southLatitude] = xBbox.xpath('./southbc').text.to_f
102
+ if hBbox[:southLatitude].nil?
103
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bounding box south boundary is missing'
104
+ end
90
105
 
91
106
  # bounding box bio (boundalt) - altitude
92
107
  xAltitude = xBbox.xpath('./boundalt')
93
108
  unless xAltitude.empty?
94
109
 
95
- # bounding box bio (altmin) - minimum altitude
110
+ # bounding box bio (altmin) - minimum altitude (required)
96
111
  hBbox[:minimumAltitude] = xAltitude.xpath('./altmin').text.to_f
112
+ if hBbox[:minimumAltitude].nil?
113
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO bounding box minimum altitude is missing'
114
+ end
97
115
 
98
- # bounding box bio (altmax) - maximum altitude
116
+ # bounding box bio (altmax) - maximum altitude (required)
99
117
  hBbox[:maximumAltitude] = xAltitude.xpath('./altmax').text.to_f
118
+ if hBbox[:maximumAltitude].nil?
119
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO bounding box maximum altitude is missing'
120
+ end
100
121
 
101
122
  # bounding box bio (altunit) - altitude unit of measure
102
123
  hBbox[:unitsOfAltitude] = xAltitude.xpath('./altunit').text
@@ -105,6 +126,9 @@ module ADIWG
105
126
 
106
127
  hIntGeoExtent[:boundingBox] = hBbox
107
128
  end
129
+ if xBbox.empty?
130
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: bounding box is missing'
131
+ end
108
132
 
109
133
  # spatial domain 1.5.2 (dsgpoly) - data set geographic polygon []
110
134
  axPoly = xDomain.xpath('//dsgpoly')
@@ -21,19 +21,25 @@ module ADIWG
21
21
  intMetadataClass = InternalMetadata.new
22
22
  hTaxonClass = intMetadataClass.newTaxonClass
23
23
 
24
- # taxonomy bio.4.1 (taxonrn) - taxon rank name
24
+ # taxonomy bio.4.1 (taxonrn) - taxon rank name (required)
25
25
  # -> resourceInfo.taxonomy.taxonClass.taxonRank
26
26
  rankName = xTaxonClass.xpath('./taxonrn').text
27
27
  unless rankName.empty?
28
28
  hTaxonClass[:taxonRank] = rankName
29
29
  end
30
+ if rankName.empty?
31
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxon classification rank name is missing'
32
+ end
30
33
 
31
- # taxonomy bio.4.2 (taxonrv) - taxon rank value
34
+ # taxonomy bio.4.2 (taxonrv) - taxon rank value (required)
32
35
  # -> resourceInfo.taxonomy.taxonClass.taxonValue
33
36
  rankValue = xTaxonClass.xpath('./taxonrv').text
34
37
  unless rankValue.empty?
35
38
  hTaxonClass[:taxonValue] = rankValue
36
39
  end
40
+ if rankValue.empty?
41
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxon classification rank value is missing'
42
+ end
37
43
 
38
44
  # taxonomy bio.4.3 (common) - taxon common name []
39
45
  # -> resourceInfo.taxonomy.taxonClass.commonNames
@@ -21,7 +21,7 @@ module ADIWG
21
21
  # instance classes needed in script
22
22
  intMetadataClass = InternalMetadata.new
23
23
 
24
- # taxonomy bio.2.1 (classsys) - taxonomic classification authority []
24
+ # taxonomy bio.2.1 (classsys) - taxonomic classification authority [] (required)
25
25
  # -> resourceInfo.taxonomy.taxonSystem
26
26
  axTaxClass = xSystem.xpath('./classsys')
27
27
  unless axTaxClass.empty?
@@ -29,7 +29,7 @@ module ADIWG
29
29
 
30
30
  hTaxonSystem = intMetadataClass.newTaxonSystem
31
31
 
32
- # taxonomy bio.2.1.1 (classcit) - taxonomic classification citation {citation}
32
+ # taxonomy bio.2.1.1 (classcit) - taxonomic classification citation {citation} (required)
33
33
  # -> resourceInfo.taxonomy.taxonSystem.citation
34
34
  xCitation = xTaxClass.xpath('./classcit')
35
35
  unless xCitation.empty?
@@ -38,6 +38,9 @@ module ADIWG
38
38
  hTaxonSystem[:citation] = hCitation
39
39
  end
40
40
  end
41
+ if xCitation.empty?
42
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy classification system citation missing'
43
+ end
41
44
 
42
45
  # taxonomy bio.2.1.2 (classmod) - taxonomic classification modifications
43
46
  # -> resourceInfo.taxonomy.taxonSystem.modifications
@@ -50,6 +53,9 @@ module ADIWG
50
53
 
51
54
  end
52
55
  end
56
+ if axTaxClass.empty?
57
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy classification system is missing'
58
+ end
53
59
 
54
60
  # taxonomy bio.2.2 (idref) - taxonomic identification reference [] {identifier}
55
61
  # -> resourceInfo.taxonomy.idReferences.authority
@@ -79,12 +85,15 @@ module ADIWG
79
85
  end
80
86
  end
81
87
 
82
- # taxonomy bio.2.4 (taxonpro) - taxonomic procedures
88
+ # taxonomy bio.2.4 (taxonpro) - taxonomic procedures (required)
83
89
  # -> resourceInfo.taxonomy.idProcedure
84
90
  procedures = xSystem.xpath('./taxonpro').text
85
91
  unless procedures.empty?
86
92
  hTaxonomy[:idProcedure] = procedures
87
93
  end
94
+ if procedures.empty?
95
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy classification procedures are missing'
96
+ end
88
97
 
89
98
  # taxonomy bio.2.5 (taxoncom) - taxonomic completeness
90
99
  # -> resourceInfo.taxonomy.idCompleteness
@@ -101,14 +110,17 @@ module ADIWG
101
110
 
102
111
  hVoucher = intMetadataClass.newTaxonVoucher
103
112
 
104
- # taxonomy bio.2.6.1 (specimen) - specimen
113
+ # taxonomy bio.2.6.1 (specimen) - specimen (required)
105
114
  # -> resourceInfo.taxonomy.vouchers.specimen
106
115
  specimen = xVoucher.xpath('./specimen').text
107
116
  unless specimen.empty?
108
117
  hVoucher[:specimen] = specimen
109
118
  end
119
+ if procedures.empty?
120
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy voucher specimen is missing'
121
+ end
110
122
 
111
- # taxonomy bio.2.6.2 (reposit) - repository {contact}
123
+ # taxonomy bio.2.6.2 (reposit) - repository {contact} (required)
112
124
  # -> resourceInfo.taxonomy.vouchers.repository
113
125
  xRepository = xVoucher.xpath('./reposit')
114
126
  unless xRepository.empty?
@@ -118,6 +130,9 @@ module ADIWG
118
130
  hVoucher[:repository] = hResponsibility
119
131
  end
120
132
  end
133
+ if xRepository.empty?
134
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy voucher repository is missing'
135
+ end
121
136
 
122
137
  hTaxonomy[:vouchers] << hVoucher
123
138
 
@@ -23,7 +23,7 @@ module ADIWG
23
23
  intMetadataClass = InternalMetadata.new
24
24
  hTaxonomy = intMetadataClass.newTaxonomy
25
25
 
26
- # taxonomy bio.1 (keywtax) - taxonomic keywords [] {keyword}
26
+ # taxonomy bio.1 (keywtax) - taxonomic keywords [] {keyword} (required)
27
27
  # -> resourceInfo.keywords
28
28
  axKeywords = xTaxonomy.xpath('./keywtax')
29
29
  unless axKeywords.empty?
@@ -31,6 +31,9 @@ module ADIWG
31
31
  Keyword.unpack(xKeyword, hResourceInfo, hResponseObj)
32
32
  end
33
33
  end
34
+ if axKeywords.empty?
35
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy keywords are missing'
36
+ end
34
37
 
35
38
  # taxonomy bio.2 (taxonsys) - taxonomic system
36
39
  xSystem = xTaxonomy.xpath('./taxonsys')
@@ -45,7 +48,7 @@ module ADIWG
45
48
  hTaxonomy[:generalScope] = general
46
49
  end
47
50
 
48
- # taxonomy bio.4 (taxoncl) - taxonomic classification
51
+ # taxonomy bio.4 (taxoncl) - taxonomic classification (required)
49
52
  # -> resourceInfo.taxonomy.taxonClass
50
53
  xTaxClass = xTaxonomy.xpath('./taxoncl')
51
54
  unless xTaxClass.empty?
@@ -54,6 +57,9 @@ module ADIWG
54
57
  hTaxonomy[:taxonClass] = hTaxonClass
55
58
  end
56
59
  end
60
+ if xTaxClass.empty?
61
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: BIO taxonomy classification is missing'
62
+ end
57
63
 
58
64
  return hTaxonomy
59
65
 
@@ -31,7 +31,7 @@ module ADIWG
31
31
  hFormat[:technicalPrerequisite] = techPre
32
32
  end
33
33
 
34
- # distribution 6.4.2.1.1 (formname) - format name
34
+ # distribution 6.4.2.1.1 (formname) - format name (required)
35
35
  # -> transferOption.distributionFormat.formatSpecification.title
36
36
  # -> transferOption.distributionFormat.formatSpecification.identifier[].identifier
37
37
  formName = xTranInfo.xpath('./formname').text
@@ -39,6 +39,9 @@ module ADIWG
39
39
  hSpecification[:title] = formName
40
40
  hSpecification[:identifiers][0][:identifier] = formName
41
41
  end
42
+ if formName.empty?
43
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: distribution transfer format name is missing'
44
+ end
42
45
 
43
46
  # distribution 6.4.2.1.2 (formvern) - format version number
44
47
  # -> transferOption.distributionFormat.formatSpecification.edition
@@ -22,12 +22,15 @@ module ADIWG
22
22
 
23
23
  hDatum[:isDepthSystem] = false
24
24
 
25
- # altitude datum 4.2.1.1 (altdatum) - altitude datum name
25
+ # altitude datum 4.2.1.1 (altdatum) - altitude datum name (required)
26
26
  # -> referenceSystemParameters.verticalDatum.datumName
27
27
  datumName = xAltSys.xpath('./altdatum').text
28
28
  unless datumName.empty?
29
29
  hDatum[:datumName] = datumName
30
30
  end
31
+ if datumName.empty?
32
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: vertical altitude datum name is missing'
33
+ end
31
34
 
32
35
  # altitude datum 4.2.1.2 (altres) - altitude resolution []
33
36
  # -> referenceSystemParameters.verticalDatum.verticalResolution
@@ -36,19 +39,25 @@ module ADIWG
36
39
  hDatum[:verticalResolution] = altRes.to_f
37
40
  end
38
41
 
39
- # altitude datum 4.2.1.3 (altunits) - altitude distance units
42
+ # altitude datum 4.2.1.3 (altunits) - altitude distance units (required)
40
43
  # -> referenceSystemParameters.verticalDatum.unitOfMeasure
41
44
  altUnits = xAltSys.xpath('./altunits').text
42
45
  unless altUnits.empty?
43
46
  hDatum[:unitOfMeasure] = altUnits
44
47
  end
48
+ if altUnits.empty?
49
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: vertical altitude distance units are missing'
50
+ end
45
51
 
46
- # altitude datum 4.2.1.4 (altenc) - altitude encoding method
52
+ # altitude datum 4.2.1.4 (altenc) - altitude encoding method (required)
47
53
  # -> referenceSystemParameters.verticalDatum.encodingMethod
48
54
  altEncode = xAltSys.xpath('./altenc').text
49
55
  unless altEncode.empty?
50
56
  hDatum[:encodingMethod] = altEncode
51
57
  end
58
+ if altEncode.empty?
59
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: vertical altitude encoding method is missing'
60
+ end
52
61
 
53
62
  hParamSet = intMetadataClass.newReferenceSystemParameterSet
54
63
  hRefSystem = intMetadataClass.newSpatialReferenceSystem
@@ -27,6 +27,9 @@ module ADIWG
27
27
  unless datumName.empty?
28
28
  hDatum[:datumName] = datumName
29
29
  end
30
+ if datumName.empty?
31
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: vertical depth datum name is missing'
32
+ end
30
33
 
31
34
  # depth datum 4.2.2.2 (depthres) - depth resolution [] (take first)
32
35
  # -> referenceSystemParameters.verticalDatum.verticalResolution
@@ -41,6 +44,9 @@ module ADIWG
41
44
  unless depthUnits.empty?
42
45
  hDatum[:unitOfMeasure] = depthUnits
43
46
  end
47
+ if depthUnits.empty?
48
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: vertical depth distance units are missing'
49
+ end
44
50
 
45
51
  # depth datum 4.2.2.4 (depthem) - depth encoding method
46
52
  # -> referenceSystemParameters.verticalDatum.encodingMethod
@@ -48,6 +54,9 @@ module ADIWG
48
54
  unless depthEncode.empty?
49
55
  hDatum[:encodingMethod] = depthEncode
50
56
  end
57
+ if depthEncode.empty?
58
+ hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: vertical depth encoding method is missing'
59
+ end
51
60
 
52
61
  hParamSet = intMetadataClass.newReferenceSystemParameterSet
53
62
  hRefSystem = intMetadataClass.newSpatialReferenceSystem
@@ -1,13 +1,14 @@
1
1
  # adiwg mdTranslator / readers / fgdc
2
2
 
3
3
  # version 1 history
4
+ # 1.0.1 2018-02-15 add messaging
4
5
  # 1.0.0 2017-07-11 version 1 FGDC CSDGM
5
6
 
6
7
  module ADIWG
7
8
  module Mdtranslator
8
9
  module Readers
9
10
  module Fgdc
10
- VERSION = "1.0.0"
11
+ VERSION = "1.0.1"
11
12
  end
12
13
  end
13
14
  end
@@ -36,7 +36,7 @@ module ADIWG
36
36
  begin
37
37
  hMdJson = JSON.parse(file)
38
38
  rescue JSON::JSONError => err
39
- hResponseObj[:readerStructureMessages] << 'Parsing mdJson Failed - see following message(s):\n'
39
+ hResponseObj[:readerStructureMessages] << 'ERROR: mdJson reader: Parsing mdJson Failed - see following message(s):\n'
40
40
  hResponseObj[:readerStructureMessages] << err.to_s.slice(0, 300)
41
41
  hResponseObj[:readerStructurePass] = false
42
42
  return {}
@@ -44,45 +44,45 @@ module ADIWG
44
44
 
45
45
  # file must contain an mdJson object
46
46
  if hMdJson.empty?
47
- hResponseObj[:readerStructureMessages] << 'mdJson object is empty'
47
+ hResponseObj[:readerStructureMessages] << 'ERROR: mdJson reader: object is empty'
48
48
  hResponseObj[:readerStructurePass] = false
49
49
  return {}
50
50
  end
51
51
 
52
52
  # schema - (required)
53
53
  unless hMdJson.has_key?('schema')
54
- hResponseObj[:readerStructureMessages] << 'mdJson is missing schema object'
54
+ hResponseObj[:readerStructureMessages] << 'ERROR: mdJson reader: schema definition is missing '
55
55
  hResponseObj[:readerStructurePass] = false
56
56
  return {}
57
57
  end
58
58
 
59
59
  # schema - name (required) (must = 'mdJson')
60
60
  unless hMdJson['schema'].has_key?('name')
61
- hResponseObj[:readerStructureMessages] << 'mdJson schema:name attribute is missing'
61
+ hResponseObj[:readerStructureMessages] << 'ERROR: mdJson reader: schema element is missing'
62
62
  hResponseObj[:readerStructurePass] = false
63
63
  return {}
64
64
  end
65
65
  schemaName = hMdJson['schema']['name']
66
66
  if schemaName.nil? || schemaName == ''
67
- hResponseObj[:readerStructureMessages] << 'mdJson schema name is missing'
67
+ hResponseObj[:readerStructureMessages] << 'ERROR: mdJson reader: schema name is missing'
68
68
  hResponseObj[:readerStructurePass] = false
69
69
  return {}
70
70
  end
71
71
  unless schemaName.downcase == 'mdjson'
72
- hResponseObj[:readerStructureMessages] << "mdJson schema name is '#{schemaName}', should be mdJson"
72
+ hResponseObj[:readerStructureMessages] << "ERROR: mdJson reader: schema name is '#{schemaName}', should be mdJson"
73
73
  hResponseObj[:readerStructurePass] = false
74
74
  return {}
75
75
  end
76
76
 
77
77
  # schema - version (required)
78
78
  unless hMdJson['schema'].has_key?('version')
79
- hResponseObj[:readerStructureMessages] << 'mdJson schema:version attribute is missing'
79
+ hResponseObj[:readerStructureMessages] << 'ERROR: mdJson reader: schema version element is missing'
80
80
  hResponseObj[:readerStructurePass] = false
81
81
  return {}
82
82
  end
83
83
  requestedVersion = hMdJson['schema']['version']
84
84
  if requestedVersion.nil? || requestedVersion == ''
85
- hResponseObj[:readerStructureMessages] << 'mdJson schema version is missing'
85
+ hResponseObj[:readerStructureMessages] << 'ERROR: mdJson reader: schema version is missing'
86
86
  hResponseObj[:readerStructurePass] = false
87
87
  return {}
88
88
  end
@@ -101,8 +101,8 @@ module ADIWG
101
101
  end
102
102
  unless approved
103
103
  approvedVersion = aCurVersion[0] + '.0.0'
104
- hResponseObj[:readerStructureMessages] << "mdJson schema version '#{requestedVersion}' is not supported"
105
- hResponseObj[:readerStructureMessages] << "mdJson versions '#{approvedVersion}' to '#{currentVersion}' are supported"
104
+ hResponseObj[:readerStructureMessages] << "ERROR: mdJson reader: schema version '#{requestedVersion}' is not supported"
105
+ hResponseObj[:readerStructureMessages] << "... mdTranslator supports mdJson schema version '#{approvedVersion}' through '#{currentVersion}'"
106
106
  hResponseObj[:readerStructurePass] = false
107
107
  return {}
108
108
  end
@@ -1,17 +1,16 @@
1
1
  # Get minor version of ADIwg mdJson 2.x
2
2
 
3
3
  # History:
4
- # Stan Smith 2017-02-22 refactor for mdJson/mdTranslator 2.0
5
- # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
6
- # Stan Smith 2014-12-11 added namespace
7
- # Stan Smith 2014-12-03 changed class name to MdJsonValidation from AdiwgJsonValidation
8
- # Stan Smith 2014-12-01 changed adiwgJson to mdJson in version name check
9
- # Stan Smith 2014-09-26 added processing of minor release numbers
10
- # Stan Smith 2014-08-21 parsed json-schema validation message to readable text
11
- # Stan Smith 2014-07-21 added json structure validation method
4
+ # Stan Smith 2017-02-22 refactor for mdJson/mdTranslator 2.0
5
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
6
+ # Stan Smith 2014-12-11 added namespace
7
+ # Stan Smith 2014-12-03 changed class name to MdJsonValidation from AdiwgJsonValidation
8
+ # Stan Smith 2014-12-01 changed adiwgJson to mdJson in version name check
9
+ # Stan Smith 2014-09-26 added processing of minor release numbers
10
+ # Stan Smith 2014-08-21 parsed json-schema validation message to readable text
11
+ # Stan Smith 2014-07-21 added json structure validation method
12
12
  # Stan Smith 2014-07-09 original script
13
13
 
14
-
15
14
  require 'json'
16
15
  require 'json-schema'
17
16
  require 'adiwg-mdjson_schemas'
@@ -35,17 +34,17 @@ module ADIWG
35
34
  aErrors = []
36
35
  aErrors = JSON::Validator.fully_validate('schema.json', file, :strict => bStrict)
37
36
 
38
- if aErrors.length > 0
39
- responseObj[:readerValidationPass] = false
40
- responseObj[:readerValidationMessages] << 'mdJson schema validation Failed - see following message(s):\n'
37
+ unless aErrors.empty?
38
+ responseObj[:readerValidationMessages] << 'ERROR: mdJson reader: schema validation Failed - see following message(s)'
41
39
  responseObj[:readerValidationMessages] << aErrors
40
+ responseObj[:readerValidationPass] = false
42
41
  return
43
42
  end
44
43
 
45
44
  rescue JSON::Schema::ValidationError
46
- responseObj[:readerValidationPass] = false
47
- responseObj[:readerValidationMessages] << 'mdJson schema validation Failed - see following message(s):\n'
45
+ responseObj[:readerValidationMessages] << 'ERROR: mdJson reader: schema validation Failed - see following message(s)'
48
46
  responseObj[:readerValidationMessages] << $!.message
47
+ responseObj[:readerValidationPass] = false
49
48
  return
50
49
  end
51
50
 
@@ -55,5 +54,3 @@ module ADIWG
55
54
  end
56
55
  end
57
56
  end
58
-
59
-
@@ -2,76 +2,76 @@
2
2
  # Reader - ADIwg JSON to internal data structure
3
3
 
4
4
  # History:
5
- # Stan Smith 2016-10-17 refactored for mdJson 2.0
6
- # Stan Smith 2015-07-14 refactored to remove global namespace constants
7
- # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
8
- # Stan Smith 2014-12-30 added return if empty input
9
- # ... found & fixed error of method using associatedResource object instead of
10
- # ... additionalDocumentation object
11
- # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
5
+ # Stan Smith 2018-02-18 refactored error and warning messaging
6
+ # Stan Smith 2016-10-17 refactored for mdJson 2.0
7
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
8
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
9
+ # Stan Smith 2014-12-30 added return if empty input
10
+ # ... found & fixed error of method using associatedResource object instead of
11
+ # ... additionalDocumentation object
12
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
12
13
  # Stan Smith 2014-11-06 original script
13
14
 
14
15
  require_relative 'module_citation'
15
16
 
16
17
  module ADIWG
17
- module Mdtranslator
18
- module Readers
19
- module MdJson
18
+ module Mdtranslator
19
+ module Readers
20
+ module MdJson
20
21
 
21
- module AdditionalDocumentation
22
+ module AdditionalDocumentation
22
23
 
23
- def self.unpack(hAddDoc, responseObj)
24
+ def self.unpack(hAddDoc, responseObj)
24
25
 
25
- # return nil object if input is empty
26
- if hAddDoc.empty?
27
- responseObj[:readerExecutionMessages] << 'Additional Documentation object is empty'
28
- responseObj[:readerExecutionPass] = false
29
- return nil
30
- end
26
+ # return nil object if input is empty
27
+ if hAddDoc.empty?
28
+ responseObj[:readerExecutionMessages] << 'WARNING: mdJson reader: additional documentation object is empty'
29
+ return nil
30
+ end
31
31
 
32
- # instance classes needed in script
33
- intMetadataClass = InternalMetadata.new
34
- intAddDoc = intMetadataClass.newAdditionalDocumentation
32
+ # instance classes needed in script
33
+ intMetadataClass = InternalMetadata.new
34
+ intAddDoc = intMetadataClass.newAdditionalDocumentation
35
35
 
36
- # additional documentation - resource type [] (required) {resourceType}
37
- if hAddDoc.has_key?('resourceType')
38
- hAddDoc['resourceType'].each do |item|
39
- unless item.empty?
40
- hReturn = ResourceType.unpack(item, responseObj)
41
- unless hReturn.nil?
42
- intAddDoc[:resourceTypes] << hReturn
43
- end
44
- end
45
- end
46
- end
47
- if intAddDoc[:resourceTypes].empty?
48
- responseObj[:readerExecutionMessages] << 'Additional Documentation is missing resourceType'
49
- responseObj[:readerExecutionPass] = false
50
- return nil
36
+ # additional documentation - resource type [] (required) {resourceType}
37
+ if hAddDoc.has_key?('resourceType')
38
+ hAddDoc['resourceType'].each do |item|
39
+ unless item.empty?
40
+ hReturn = ResourceType.unpack(item, responseObj)
41
+ unless hReturn.nil?
42
+ intAddDoc[:resourceTypes] << hReturn
43
+ end
51
44
  end
45
+ end
46
+ end
47
+ if intAddDoc[:resourceTypes].empty?
48
+ responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: additional documentation is missing resource type'
49
+ responseObj[:readerExecutionPass] = false
50
+ return nil
51
+ end
52
52
 
53
- # additional documentation - citation [] (required)
54
- if hAddDoc.has_key?('citation')
55
- hAddDoc['citation'].each do |item|
56
- hDoc = Citation.unpack(item, responseObj)
57
- unless hDoc.nil?
58
- intAddDoc[:citation] << hDoc
59
- end
60
- end
61
- end
62
- if intAddDoc[:citation].empty?
63
- responseObj[:readerExecutionMessages] << 'Additional Documentation is missing citation'
64
- responseObj[:readerExecutionPass] = false
65
- return nil
53
+ # additional documentation - citation [] (required)
54
+ if hAddDoc.has_key?('citation')
55
+ hAddDoc['citation'].each do |item|
56
+ hDoc = Citation.unpack(item, responseObj)
57
+ unless hDoc.nil?
58
+ intAddDoc[:citation] << hDoc
66
59
  end
60
+ end
61
+ end
62
+ if intAddDoc[:citation].empty?
63
+ responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: additional documentation is missing citation'
64
+ responseObj[:readerExecutionPass] = false
65
+ return nil
66
+ end
67
67
 
68
- return intAddDoc
68
+ return intAddDoc
69
69
 
70
- end
71
-
72
- end
70
+ end
73
71
 
74
72
  end
75
- end
76
- end
73
+
74
+ end
75
+ end
76
+ end
77
77
  end