adiwg-mdjson_schemas 1.1.3 → 2.0.0.pre.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (247) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/README.md +14 -3
  4. data/adiwg-json_schemas.gemspec +2 -2
  5. data/bower.json +0 -1
  6. data/examples/additionalDocumentation.json +9 -60
  7. data/examples/address.json +14 -10
  8. data/examples/allocation.json +12 -0
  9. data/examples/associatedResource.json +10 -118
  10. data/examples/attribute.json +27 -0
  11. data/examples/attributeGroup.json +17 -0
  12. data/examples/boundingBox.json +6 -0
  13. data/examples/citation.json +69 -127
  14. data/examples/computedBbox.json +399 -0
  15. data/examples/constraint.json +62 -0
  16. data/examples/contact.json +40 -207
  17. data/examples/coverageDescription.json +21 -0
  18. data/examples/date.json +8 -19
  19. data/examples/dictionary.json +58 -0
  20. data/examples/dimension.json +11 -0
  21. data/examples/distribution.json +26 -0
  22. data/examples/distributor.json +22 -142
  23. data/examples/domain.json +29 -0
  24. data/examples/domainItem.json +11 -0
  25. data/examples/duration.json +17 -0
  26. data/examples/entity.json +48 -0
  27. data/examples/entityAttribute.json +31 -0
  28. data/examples/entityForeignKey.json +17 -0
  29. data/examples/entityIndex.json +8 -0
  30. data/examples/extent.json +60 -0
  31. data/examples/featureCollection.json +58 -0
  32. data/examples/featureProperties.json +16 -0
  33. data/examples/format.json +7 -14
  34. data/examples/funding.json +33 -0
  35. data/examples/geoJson.json +185 -0
  36. data/examples/geographicExtent.json +22 -0
  37. data/examples/geometryCollection.json +14 -0
  38. data/examples/geometryFeature.json +12 -0
  39. data/examples/geometryObject.json +90 -0
  40. data/examples/georectifiedRepresentation.json +28 -0
  41. data/examples/georeferencableRepresentation.json +25 -0
  42. data/examples/gmlIdentifier.json +8 -0
  43. data/examples/graphic.json +33 -0
  44. data/examples/gridRepresentation.json +14 -0
  45. data/examples/identifier.json +9 -0
  46. data/examples/imageDescription.json +15 -0
  47. data/examples/keyword.json +14 -0
  48. data/examples/keywordObject.json +12 -0
  49. data/examples/legalConstraint.json +21 -0
  50. data/examples/lineage.json +21 -0
  51. data/examples/locale.json +12 -3
  52. data/examples/maintenance.json +38 -0
  53. data/examples/mdJson.json +99 -0
  54. data/examples/measure.json +5 -0
  55. data/examples/medium.json +16 -0
  56. data/examples/metadata.json +102 -0
  57. data/examples/metadataInfo.json +68 -101
  58. data/examples/onlineResource.json +13 -17
  59. data/examples/orderProcess.json +6 -0
  60. data/examples/party.json +21 -0
  61. data/examples/phone.json +9 -0
  62. data/examples/processStep.json +34 -0
  63. data/examples/releasability.json +28 -0
  64. data/examples/resourceInfo.json +230 -1256
  65. data/examples/responsibleParty.json +31 -0
  66. data/examples/schema.json +8 -0
  67. data/examples/scope.json +33 -0
  68. data/examples/scopeDescription.json +8 -0
  69. data/examples/securityConstraint.json +13 -0
  70. data/examples/series.json +9 -0
  71. data/examples/source.json +23 -0
  72. data/examples/spatialReference.json +34 -0
  73. data/examples/spatialRepresentation.json +59 -0
  74. data/examples/spatialResolution.json +11 -0
  75. data/examples/taxonomicClassification.json +59 -0
  76. data/examples/taxonomicSystem.json +13 -0
  77. data/examples/taxonomy.json +79 -188
  78. data/examples/temporalExtent.json +11 -0
  79. data/examples/timeInstant.json +13 -0
  80. data/examples/timeInterval.json +8 -0
  81. data/examples/timePeriod.json +26 -0
  82. data/examples/transferOption.json +36 -0
  83. data/examples/usage.json +48 -33
  84. data/examples/vectorObject.json +4 -0
  85. data/examples/vectorRepresentation.json +10 -0
  86. data/examples/verticalExtent.json +10 -17
  87. data/examples/voucher.json +12 -0
  88. data/lib/adiwg/mdjson_schemas/utils.rb +45 -15
  89. data/lib/adiwg/mdjson_schemas/validator.rb +6 -7
  90. data/lib/adiwg/mdjson_schemas/version.rb +1 -1
  91. data/lib/adiwg/mdjson_schemas.rb +4 -2
  92. data/schema/additionalDocumentation.json +29 -0
  93. data/schema/associatedResource.json +49 -0
  94. data/schema/attribute.json +157 -0
  95. data/schema/attributeGroup.json +29 -0
  96. data/schema/{schema/geojson/bbox.json → bbox.json} +2 -2
  97. data/schema/{schema/citation.json → citation.json} +73 -99
  98. data/schema/common.json +49 -0
  99. data/schema/{schema/resourceConstraint.json → constraint.json} +83 -13
  100. data/schema/contact.json +234 -0
  101. data/schema/coverageDescription.json +50 -0
  102. data/schema/dataDictionary.json +71 -0
  103. data/schema/distribution.json +35 -0
  104. data/schema/distributor.json +46 -0
  105. data/schema/domain.json +65 -0
  106. data/schema/entity.json +235 -0
  107. data/schema/extent.json +59 -0
  108. data/schema/format.json +37 -0
  109. data/schema/funding.json +67 -0
  110. data/schema/geographicExtent.json +87 -0
  111. data/schema/{schema/geojson/geojson.json → geojson.json} +16 -44
  112. data/schema/{schema/geojson/geometry.json → geometry.json} +2 -1
  113. data/schema/georectifiedRepresentation.json +89 -0
  114. data/schema/georeferencableRepresentation.json +49 -0
  115. data/schema/{schema/graphicOverview.json → graphic.json} +19 -6
  116. data/schema/{schema/gridInfo.json → gridRepresentation.json} +7 -13
  117. data/schema/identifier.json +47 -0
  118. data/schema/imageDescription.json +92 -0
  119. data/schema/{schema/keyword.json → keyword.json} +18 -4
  120. data/schema/{schema/dataQuality.json → lineage.json} +92 -57
  121. data/schema/{schema/maintInfo.json → maintInfo.json} +24 -6
  122. data/schema/measure.json +31 -0
  123. data/schema/medium.json +55 -0
  124. data/schema/metadata.json +77 -0
  125. data/schema/metadataInfo.json +112 -0
  126. data/schema/{schema/onlineResource.json → onlineResource.json} +1 -1
  127. data/schema/orderProcess.json +45 -0
  128. data/schema/releasability.json +42 -0
  129. data/schema/{schema/resourceInfo.json → resourceInfo.json} +112 -189
  130. data/schema/responsibility.json +56 -0
  131. data/schema/schema.json +16 -31
  132. data/schema/scope.json +55 -0
  133. data/schema/spatialReference.json +26 -0
  134. data/schema/spatialRepresentation.json +83 -0
  135. data/schema/spatialResolution.json +54 -0
  136. data/schema/taxonomy.json +178 -0
  137. data/schema/temporalExtent.json +42 -0
  138. data/schema/timeInstant.json +46 -0
  139. data/schema/timePeriod.json +126 -0
  140. data/schema/transferOption.json +61 -0
  141. data/schema/{schema/usage.json → usage.json} +34 -4
  142. data/schema/vectorRepresentation.json +51 -0
  143. data/schema/verticalExtent.json +37 -0
  144. data/test/helper.rb +32 -0
  145. data/test/tc_additionalDocumentation.rb +8 -0
  146. data/test/tc_address.rb +8 -0
  147. data/test/tc_associatedResource.rb +8 -0
  148. data/test/tc_attribute.rb +8 -0
  149. data/test/tc_attributeGroup.rb +8 -0
  150. data/test/tc_boundingBox.rb +8 -0
  151. data/test/tc_citation.rb +8 -0
  152. data/test/tc_constraint.rb +8 -0
  153. data/test/tc_contact.rb +8 -0
  154. data/test/tc_coverageDescription.rb +8 -0
  155. data/test/tc_dataDictionary.rb +8 -0
  156. data/test/tc_dimension.rb +8 -0
  157. data/test/tc_distribution.rb +8 -0
  158. data/test/tc_distributor.rb +8 -0
  159. data/test/tc_domain.rb +8 -0
  160. data/test/tc_domainItem.rb +8 -0
  161. data/test/tc_duration.rb +8 -0
  162. data/test/tc_entity.rb +20 -0
  163. data/test/tc_extent.rb +8 -0
  164. data/test/tc_featureCollection.rb +8 -0
  165. data/test/tc_featureProperties.rb +8 -0
  166. data/test/tc_format.rb +8 -0
  167. data/test/tc_funding.rb +8 -0
  168. data/test/tc_geographicElement.rb +12 -0
  169. data/test/tc_geographicExtent.rb +8 -0
  170. data/test/tc_geometryCollection.rb +8 -0
  171. data/test/tc_geometryFeature.rb +8 -0
  172. data/test/tc_geometryObject.rb +8 -0
  173. data/test/tc_georectifiedRepresentation.rb +8 -0
  174. data/test/tc_georeferencableRepresentation.rb +8 -0
  175. data/test/tc_graphic.rb +8 -0
  176. data/test/tc_gridRepresentation.rb +8 -0
  177. data/test/tc_identifier.rb +8 -0
  178. data/test/tc_imageDescription.rb +8 -0
  179. data/test/tc_jsonschema.rb +16 -0
  180. data/test/tc_keyword.rb +8 -0
  181. data/test/tc_lineage.rb +8 -0
  182. data/test/tc_maintInfo.rb +8 -0
  183. data/test/tc_measure.rb +8 -0
  184. data/test/tc_medium.rb +8 -0
  185. data/test/tc_metadata.rb +8 -0
  186. data/test/tc_metadataInfo.rb +8 -0
  187. data/test/tc_onlineResource.rb +8 -0
  188. data/test/tc_orderProcess.rb +8 -0
  189. data/test/tc_party.rb +8 -0
  190. data/test/tc_processStep.rb +8 -0
  191. data/test/tc_releasability.rb +8 -0
  192. data/test/tc_resourceInfo.rb +8 -0
  193. data/test/tc_responsibility.rb +8 -0
  194. data/test/tc_schema.rb +8 -0
  195. data/test/tc_scope.rb +8 -0
  196. data/test/tc_source.rb +8 -0
  197. data/test/tc_spatialReference.rb +8 -0
  198. data/test/tc_spatialRepresentation.rb +8 -0
  199. data/test/tc_spatialResolution.rb +8 -0
  200. data/test/tc_taxonomicClassification.rb +8 -0
  201. data/test/tc_taxonomicSystem.rb +8 -0
  202. data/test/tc_taxonomy.rb +8 -0
  203. data/test/tc_temporalExtent.rb +8 -0
  204. data/test/tc_timeInstant.rb +8 -0
  205. data/test/tc_timePeriod.rb +8 -0
  206. data/test/tc_transferOption.rb +8 -0
  207. data/test/tc_uri.rb +8 -0
  208. data/test/tc_usage.rb +8 -0
  209. data/test/tc_utils.rb +8 -11
  210. data/test/tc_vectorRepresentation.rb +13 -0
  211. data/test/tc_verticalExtent.rb +8 -0
  212. data/test/tc_voucher.rb +8 -0
  213. metadata +264 -57
  214. data/examples/contactRef.json +0 -12
  215. data/examples/coverageInfo.json +0 -148
  216. data/examples/dataDictionary.json +0 -549
  217. data/examples/dataQuality.json +0 -272
  218. data/examples/extent_linestring.json +0 -288
  219. data/examples/extent_point.json +0 -246
  220. data/examples/extent_polygon.json +0 -353
  221. data/examples/full_example.json +0 -3065
  222. data/examples/full_example2.json +0 -2325
  223. data/examples/geojson.json +0 -446
  224. data/examples/graphicOverview.json +0 -28
  225. data/examples/gridInfo.json +0 -23
  226. data/examples/hierarchyLevel.json +0 -90
  227. data/examples/keywords.json +0 -144
  228. data/examples/lcc_project_example.json +0 -326
  229. data/examples/legalConstraints.json +0 -17
  230. data/examples/maintInfo.json +0 -34
  231. data/examples/minimum_example.json +0 -35
  232. data/examples/resolution.json +0 -9
  233. data/examples/resourceMaintenance.json +0 -10
  234. data/examples/securityConstraints.json +0 -13
  235. data/examples/spatialRef.json +0 -14
  236. data/examples/temporalElement.json +0 -29
  237. data/schema/schema/contact.json +0 -262
  238. data/schema/schema/coverageInfo.json +0 -303
  239. data/schema/schema/dataDictionary.json +0 -335
  240. data/schema/schema/distributor.json +0 -216
  241. data/schema/schema/extent.json +0 -215
  242. data/schema/schema/geojson/crs.json +0 -99
  243. data/schema/schema/metadata.json +0 -188
  244. data/schema/schema/resolution.json +0 -51
  245. data/schema/schema/taxonomy.json +0 -122
  246. data/test/tc_schemas.rb +0 -243
  247. /data/schema/{schema/locale.json → locale.json} +0 -0
@@ -1,122 +0,0 @@
1
- {
2
- "id": "taxonomy.json#",
3
- "$schema": "http://json-schema.org/draft-04/schema#",
4
- "type": "object",
5
- "description": "Information on the taxa (1 or more) included in the data set, including keywords, taxonomic system and coverage information, and taxonomic classification system.",
6
- "example": "../../examples/full_example.json#/metadata/resourceInfo/taxonomy",
7
- "translation": {
8
- "ISO 19115-2": ["MD_TaxonSys"],
9
- "FGDC CSDGM": ["idinfo > taxonomy"]
10
- },
11
- "required": ["classificationSystem", "taxonomicProcedure", "taxonClass"],
12
- "additionalProperties": true,
13
- "properties": {
14
- "classificationSystem": {
15
- "type": "array",
16
- "description": "Information (citation) about the taxonomic classification system or authority used.",
17
- "translation": {
18
- "ISO 19115-2": ["MD_TaxonSys > classSys > CI_Citation"],
19
- "FGDC CSDGM": ["idinfo > taxonomy > taxonsys > classsys"]
20
- },
21
- "minItems": 1,
22
- "items": {
23
- "$ref": "citation.json"
24
- }
25
- },
26
- "taxonGeneralScope": {
27
- "type": "string",
28
- "description": "Description of the range of taxa addressed in the data set or collection. For example, \"all vascular plants were identified to family or species, mosses and lichens were identified as moss or lichen\".",
29
- "translation": {
30
- "ISO 19115-2": ["MD_TaxonSys > taxongen"]
31
- }
32
- },
33
- "observer": {
34
- "type": "array",
35
- "description": "Information about the individual(s) responsible for the identification(s) of the specimens or sightings. etc.",
36
- "translation": {
37
- "ISO 19115-2": ["MD_TaxonSys > obs > CI_ResponsibleParty"]
38
- },
39
- "items": {
40
- "$ref": "contact.json#/definitions/contactRef"
41
- }
42
- },
43
- "taxonomicProcedure": {
44
- "type": "string",
45
- "description": "Description of the methods used for taxonomic identification. Could include specimen processing, comparison with museum materials, keys, and key characters, chemical or genetic analyses, etc.",
46
- "translation": {
47
- "ISO 19115-2": ["MD_TaxonSys > taxonpro"],
48
- "FGDC CSDGM": ["idinfo > taxonomy > taxonsys > taxonpro"]
49
- }
50
- },
51
- "voucher": {
52
- "type": "object",
53
- "description": "Information on the types of specimen, the repository, and the individuals who identified the vouchers.",
54
- "example": "../../examples/full_example.json#/metadata/resourceInfo/taxonomy",
55
- "translation": {
56
- "ISO 19115-2": ["MD_TaxonSys > voucher > MD_Vouchers"],
57
- "FGDC CSDGM": ["idinfo > taxonomy > taxonsys > vouchers"]
58
- },
59
- "required": ["specimen", "repository"],
60
- "properties": {
61
- "specimen": {
62
- "type": "string",
63
- "description": "Word or phrase describing the type of specimen collected (e.g. 'herbarium specimens', 'blood samples', 'photographs', 'individuals', or 'batches').",
64
- "translation": {
65
- "ISO 19115-2": ["MD_Vouchers > specimen"],
66
- "FGDC CSDGM": ["idinfo > taxonomy > taxonsys > vouchers > specimens"]
67
- }
68
- },
69
- "repository": {
70
- "description": "Information about the curator or contact person and/or agency responsible for the specimens.",
71
- "example": "../../examples/full_example.json#/metadata/resourceInfo/taxonomy/voucher",
72
- "translation": {
73
- "ISO 19115-2": ["MD_Vouchers > reposit > CI_ResponsibleParty"],
74
- "FGDC CSDGM": ["idinfo > taxonomy > taxonsys > vouchers > reposit"]
75
- },
76
- "$ref": "contact.json#/definitions/contactRef"
77
- }
78
- }
79
- },
80
- "taxonClass": {
81
- "type": "array",
82
- "description": "Information about the range of taxa addressed in the data set or collection. It is recommended that one provide information starting from the taxonomic rank of kingdom, to a level which reflects the data set or collection being documented. The levels of Kingdom, Division/Phylum, class, Order, Family, Genus, and Species should be included as ranks as appropriate.",
83
- "translation": {
84
- "ISO 19115-2": ["MD_TaxonSys > taxonCl > MD_TaxonCl"],
85
- "FGDC CSDGM": ["idinfo > taxonomy > taxoncl"]
86
- },
87
- "minItems": 1,
88
- "items": {
89
- "type": "object",
90
- "example": "../../examples/full_example.json#/metadata/resourceInfo/taxonomy",
91
- "required": ["taxonRank", "taxonValue"],
92
- "additionalProperties": true,
93
- "properties": {
94
- "taxonRank": {
95
- "type": "string",
96
- "description": "Name of the taxonomic rank for which the taxonValue is provided. Example: \"Kingdom\", \"Division\", \"Phylum\", \"Subphylum\", \"SuperClass\", \"Class\", \"SubClass\", \"InfraClass\", \"Superorder\", \"Order\", \"Suborder\", \"Infraorder\", \"Superfamily\", \"Family\", \"Subfamily\", \"Tribe\", \"Subtribe\", \"Genus\", \"Species\".",
97
- "translation": {
98
- "ISO 19115-2": [" MD_TaxonCl > taxonrn"],
99
- "FGDC CSDGM": ["idinfo > taxonomy > taxoncl > taxonrn"]
100
- }
101
- },
102
- "taxonValue": {
103
- "type": "string",
104
- "description": "Taxonomic rank value of the taxon being described.",
105
- "translation": {
106
- "ISO 19115-2": ["MD_TaxonCl > taxonrv"],
107
- "FGDC CSDGM": ["idinfo > taxonomy > taxoncl > taxonrv"]
108
- }
109
- },
110
- "common": {
111
- "type": "string",
112
- "description": "Specification of applicable common names. These common names may be general descriptions of a group of organisms if appropriate (e.g. insects, vertebrate, grasses, waterfowl, vascular plants, etc.).",
113
- "translation": {
114
- "ISO 19115-2": ["MD_TaxonCl > common"],
115
- "FGDC CSDGM": ["idinfo > taxonomy > taxoncl > common"]
116
- }
117
- }
118
- }
119
- }
120
- }
121
- }
122
- }
data/test/tc_schemas.rb DELETED
@@ -1,243 +0,0 @@
1
- =begin
2
- * Description: Test Validation of examples schemas and templates
3
- * Author: Josh Bradley, Stan Smith
4
- * Date: 2014-05-02
5
- * License: Public Domain
6
- =end
7
-
8
- require 'minitest/autorun'
9
- require 'json'
10
- require 'json-schema'
11
- require File.join(File.dirname(__FILE__),'..','lib', 'adiwg-mdjson_schemas.rb')
12
-
13
- #json-schema patch
14
- require File.join(File.dirname(__FILE__),'..','lib', 'adiwg', 'mdjson_schemas', 'validator.rb')
15
-
16
- class TestExamples < Minitest::Test
17
-
18
- @@dir = File.join(File.dirname(__FILE__),'..','schema/')
19
- @@ex = File.join(File.dirname(__FILE__),'..','examples/')
20
- @@schema = File.join(File.dirname(__FILE__),'..','schema','schema.json')
21
-
22
- def load_json( filename )
23
- JSON.load File.new( filename )
24
- end
25
-
26
- def test_schemas
27
- #Validate the schemas themselves
28
- #puts "\nValidating schemas, Please wait... \n"
29
- schemas = `git ls-files #{@@dir}`.split($/)
30
- errors = Array.new
31
-
32
- schemas.each do |schema|
33
- error = JSON::Validator.fully_validate(File.join(File.dirname(__FILE__), 'draft-04.json'), schema)
34
- errors += error
35
- end
36
-
37
- assert(errors.empty?, errors.join("\n"))
38
- end
39
-
40
- def test_data_template
41
- errors = JSON::Validator.fully_validate(@@schema, @@dir + '../templates/mdJson_template.json', :strict => false)
42
- assert(errors.empty?, errors.join("\n"))
43
- end
44
-
45
- def test_full_example
46
- errors = JSON::Validator.fully_validate(@@schema , @@ex + 'full_example.json')
47
- assert(errors.empty?, errors.join("\n"))
48
- end
49
-
50
- def test_full_example2
51
- errors = JSON::Validator.fully_validate(@@schema , @@ex + 'full_example2.json')
52
- assert(errors.empty?, errors.join("\n"))
53
- end
54
-
55
- def test_minimum_example
56
- errors = JSON::Validator.fully_validate(@@schema , @@ex + 'minimum_example.json')
57
- assert(errors.empty?, errors.join("\n"))
58
- end
59
-
60
- def test_lcc_example
61
- errors = JSON::Validator.fully_validate(@@schema , @@ex + 'lcc_project_example.json')
62
- assert(errors.empty?, errors.join("\n"))
63
- end
64
-
65
- def test_contact
66
- errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', load_json(@@ex + 'contact.json')[0], :fragment => "#/definitions/individual",:strict => true)
67
- assert(errors.empty?, errors.join("\n"))
68
-
69
- errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'contact.json')
70
- assert(errors.empty?, errors.join("\n"))
71
- end
72
-
73
- def test_locale
74
- errors = JSON::Validator.fully_validate(@@dir + 'schema/locale.json', @@ex + 'locale.json', :strict => true)
75
- assert(errors.empty?, errors.join("\n"))
76
- end
77
-
78
- def test_gridInfo
79
- errors = JSON::Validator.fully_validate(@@dir + 'schema/gridInfo.json', @@ex + 'gridInfo.json', :strict => true)
80
- assert(errors.empty?, errors.join("\n"))
81
- end
82
-
83
- def test_coverageInfo
84
- errors = JSON::Validator.fully_validate(@@dir + 'schema/coverageInfo.json', load_json(@@ex + 'coverageInfo.json')[0], :strict => true)
85
- assert(errors.empty?, errors.join("\n"))
86
-
87
- errors = JSON::Validator.fully_validate(@@dir + 'schema/coverageInfo.json', @@ex + 'coverageInfo.json', :list => true)
88
- assert(errors.empty?, errors.join("\n"))
89
- end
90
-
91
- def test_citation
92
- errors = JSON::Validator.fully_validate(@@dir + 'schema/citation.json', @@ex + 'citation.json', :list => true)
93
- assert(errors.empty?, errors.join("\n"))
94
- end
95
-
96
- def test_dictionary
97
- errors = JSON::Validator.fully_validate(@@dir + 'schema/dataDictionary.json', @@ex + 'dataDictionary.json', :list => true)
98
- assert(errors.empty?, errors.join("\n"))
99
- end
100
-
101
- def test_taxonomy
102
- errors = JSON::Validator.fully_validate(@@dir + 'schema/taxonomy.json', @@ex + 'taxonomy.json', :list => true)
103
- assert(errors.empty?, errors.join("\n"))
104
- end
105
-
106
- def test_usage
107
- errors = JSON::Validator.fully_validate(@@dir + 'schema/usage.json', @@ex + 'usage.json', :list => true)
108
- assert(errors.empty?, errors.join("\n"))
109
- end
110
-
111
- def test_resolution
112
- errors = JSON::Validator.fully_validate(@@dir + 'schema/resolution.json', @@ex + 'resolution.json', :list => true)
113
- assert(errors.empty?, errors.join("\n"))
114
- end
115
-
116
- def test_graphicOverview
117
- errors = JSON::Validator.fully_validate(@@dir + 'schema/graphicOverview.json', @@ex + 'graphicOverview.json', :list => true)
118
- assert(errors.empty?, errors.join("\n"))
119
- end
120
-
121
- def test_resourceInfo
122
- errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceInfo.json', @@ex + 'resourceInfo.json', :list => true)
123
- assert(errors.empty?, errors.join("\n"))
124
- end
125
-
126
- def test_metadataInfo
127
- errors = JSON::Validator.fully_validate(@@dir + 'schema/metadata.json', @@ex + 'metadataInfo.json', :fragment => "#/properties/metadataInfo", :list => true)
128
- assert(errors.empty?, errors.join("\n"))
129
- end
130
-
131
- def test_onlineResource
132
- errors = JSON::Validator.fully_validate(@@dir + 'schema/onlineResource.json', @@ex + 'onlineResource.json', :list => true)
133
- assert(errors.empty?, errors.join("\n"))
134
- end
135
-
136
- def test_resourceConstraint
137
- errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceConstraint.json', @@ex + 'legalConstraints.json', :fragment => "#/definitions/legalConstraint", :list => true)
138
- assert(errors.empty?, errors.join("\n"))
139
-
140
- errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceConstraint.json', @@ex + 'securityConstraints.json', :fragment => "#/definitions/securityConstraint", :list => true)
141
- assert(errors.empty?, errors.join("\n"))
142
-
143
- errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceConstraint.json', ["not for suitable for navigation", "draft version", "not intended for general use"], :fragment => "#/definitions/useLimitation", :list => true)
144
- assert(errors.empty?, errors.join("\n"))
145
- end
146
-
147
- def test_date
148
- errors = JSON::Validator.fully_validate(@@schema, @@ex + 'date.json', :fragment => "#/definitions/date", :list => true)
149
- assert(errors.empty?, errors.join("\n"))
150
- end
151
-
152
- def test_spatialRef
153
- errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceInfo.json', @@ex + 'spatialRef.json', :fragment => "#/properties/spatialReferenceSystem", :list => false)
154
- assert(errors.empty?, errors.join("\n"))
155
- end
156
-
157
- def test_contactRef
158
- errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'contactRef.json', :fragment => "#/definitions/contactRef", :list => true)
159
- assert(errors.empty?, errors.join("\n"))
160
- end
161
-
162
- def test_keywords
163
- errors = JSON::Validator.fully_validate(@@dir + 'schema/keyword.json', @@ex + 'keywords.json', :list => true)
164
- assert(errors.empty?, errors.join("\n"))
165
- end
166
-
167
- def test_distributor
168
- errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', load_json(@@ex + 'distributor.json')[0], :strict => true)
169
- assert(errors.empty?, errors.join("\n"))
170
-
171
- errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', @@ex + 'distributor.json', :list => true)
172
- assert(errors.empty?, errors.join("\n"))
173
- end
174
-
175
- def test_format
176
- errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', load_json(@@ex + 'format.json')[0],:fragment => "#/definitions/format", :strict => true)
177
- assert(errors.empty?, errors.join("\n"))
178
-
179
- errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', @@ex + 'format.json', :fragment => "#/definitions/format", :list => true)
180
- assert(errors.empty?, errors.join("\n"))
181
- end
182
-
183
- def test_geojson
184
- errors = JSON::Validator.fully_validate(@@dir + 'schema/geojson/geojson.json', @@ex + 'geojson.json', :list => true)
185
- assert(errors.empty?, errors.join("\n"))
186
- end
187
-
188
- def test_extent_linestring
189
- errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_linestring.json', :list => true)
190
- assert(errors.empty?, errors.join("\n"))
191
- end
192
-
193
- def test_extent_point
194
- errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_point.json', :list => true)
195
- assert(errors.empty?, errors.join("\n"))
196
- end
197
-
198
- def test_extent_polygon
199
- errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_polygon.json', :list => true)
200
- assert(errors.empty?, errors.join("\n"))
201
- end
202
-
203
- def test_extent_temporal
204
- errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'temporalElement.json', :fragment => "#/definitions/temporalElement", :list => true)
205
- assert(errors.empty?, errors.join("\n"))
206
- end
207
-
208
- def test_extent_vertical
209
- errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'verticalExtent.json', :fragment => "#/definitions/verticalExtent", :list => true)
210
- assert(errors.empty?, errors.join("\n"))
211
- end
212
-
213
- def test_maintInfo
214
- errors = JSON::Validator.fully_validate(@@dir + 'schema/maintInfo.json', @@ex + 'maintInfo.json', :list => true)
215
- errors = errors + JSON::Validator.fully_validate(@@dir + 'schema/maintInfo.json', @@ex + 'resourceMaintenance.json', :list => true)
216
- assert(errors.empty?, errors.join("\n"))
217
- end
218
-
219
- def test_dataQuality
220
- errors = JSON::Validator.fully_validate(@@dir + 'schema/dataQuality.json', @@ex + 'dataQuality.json', :list => true)
221
- assert(errors.empty?, errors.join("\n"))
222
- end
223
-
224
- def test_uri
225
- errors = JSON::Validator.fully_validate(@@schema, @@ex + 'uri.json', :fragment => "#/definitions/uri", :list => true)
226
- assert(errors.empty?, errors.join("\n"))
227
- end
228
-
229
- def test_additionalDocumentation
230
- errors = JSON::Validator.fully_validate(@@dir + 'schema/metadata.json', @@ex + 'additionalDocumentation.json', :fragment => "#/properties/additionalDocumentation", :list => false)
231
- assert(errors.empty?, errors.join("\n"))
232
- end
233
-
234
- def test_associatedResource
235
- errors = JSON::Validator.fully_validate(@@dir + 'schema/metadata.json', @@ex + 'associatedResource.json', :fragment => "#/properties/associatedResource", :list => false)
236
- assert(errors.empty?, errors.join("\n"))
237
- end
238
-
239
- def test_address
240
- errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'address.json', :fragment => "#/definitions/address", :list => true)
241
- assert(errors.empty?, errors.join("\n"))
242
- end
243
- end
File without changes