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
@@ -3,11 +3,11 @@
3
3
  "$schema": "http://json-schema.org/draft-04/schema#",
4
4
  "type": "object",
5
5
  "description": "Description of ways in which the resource is currently or has been used.",
6
- "example": "../../examples/full_example.json#/metadata/resourceInfo/resourceSpecificUsage/0",
6
+ "example": "",
7
7
  "translation": {
8
8
  "ISO 19115-2": ["MD_Usage"]
9
9
  },
10
- "required": ["specificUsage", "userContactInfo"],
10
+ "required": ["specificUsage"],
11
11
  "additionalProperties": true,
12
12
  "properties": {
13
13
  "specificUsage": {
@@ -17,6 +17,14 @@
17
17
  "ISO 19115-2": ["MD_Usage > specific usage"]
18
18
  }
19
19
  },
20
+ "temporalExtent": {
21
+ "type": "array",
22
+ "description": "Date and time of the first use or range of uses of the resource and/or resource series.",
23
+ "translation": {},
24
+ "items": {
25
+ "$ref": "./temporalExtent.json#"
26
+ }
27
+ },
20
28
  "userDeterminedLimitation": {
21
29
  "type": "string",
22
30
  "description": "A brief description of applications, determined by the user, for which the resource is not suitable.",
@@ -24,6 +32,28 @@
24
32
  "ISO 19115-2": ["MD_Usage > userDeterminedLimitations"]
25
33
  }
26
34
  },
35
+ "limitationResponse": {
36
+ "type": "array",
37
+ "description": "Response to the user-determined limitations.",
38
+ "translation": {},
39
+ "items": {
40
+ "type": "string"
41
+ }
42
+ },
43
+ "documentedIssue": {
44
+ "$ref": "./citation.json#",
45
+ "description": "Citation of a description of known issues associated with the resource along with proposed solutions if available.",
46
+ "example": ""
47
+ },
48
+ "additionalDocumentation": {
49
+ "type": "array",
50
+ "description": "Publications that describe usage of data.",
51
+ "example": "",
52
+ "translation": {},
53
+ "items": {
54
+ "$ref": "./citation.json#"
55
+ }
56
+ },
27
57
  "userContactInfo": {
28
58
  "type": "array",
29
59
  "description": "Identification of the persons and/or organizations that are using the resource.",
@@ -32,8 +62,8 @@
32
62
  },
33
63
  "uniqueItems": true,
34
64
  "items": {
35
- "$ref": "contact.json#/definitions/contactRef"
65
+ "$ref": "./responsibility.json#"
36
66
  }
37
67
  }
38
68
  }
39
- }
69
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "id" : "vectorRepresentation.json#",
4
+ "type" : "object",
5
+ "description" : "Information about the vector spatial objects in the resource",
6
+ "minProperties" : 1,
7
+ "additionalProperties" : true,
8
+ "properties" : {
9
+ "topologyLevel": {
10
+ "type" : "string",
11
+ "description" : "Identifies the degree of complexity of the spatial relationships",
12
+ "example": "",
13
+ "translation": {},
14
+ "minLength" : 1
15
+ },
16
+ "vectorObject": {
17
+ "type" : "array",
18
+ "description" : "Information about the geometric objects used in the resource",
19
+ "example": "",
20
+ "translation": {},
21
+ "items" : {
22
+ "$ref": "#/definitions/vectorObject"
23
+ }
24
+ }
25
+ },
26
+ "definitions" : {
27
+ "vectorObject": {
28
+ "type" : "object",
29
+ "description" : "Information about the geometric objects used in the resource.",
30
+ "example": "",
31
+ "translation": {},
32
+ "required" : ["objectType"],
33
+ "additionalProperties" : true,
34
+ "properties" : {
35
+ "objectType": {
36
+ "type" : "string",
37
+ "description" : "Name of point or vector objects used to locate zero-, one-, two-, or three-dimensional spatial locations in the resource.",
38
+ "example": "",
39
+ "translation": {},
40
+ "minLength" : 1
41
+ },
42
+ "objectCount": {
43
+ "type" : "integer",
44
+ "description" : "The total number of point or vector objects occurring in the dataset.",
45
+ "example": "",
46
+ "translation": {}
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "id": "verticalExtent.json#",
4
+
5
+ "type": "object",
6
+ "description": "Vertical element of an extent.",
7
+ "translation": {
8
+ "ISO 19115-2": ["EX_Extent > verticalElement > EX_VerticalExtent "]
9
+ },
10
+ "additionalProperties": true,
11
+ "required": ["minValue", "maxValue", "crsId"],
12
+ "properties": {
13
+ "description": {
14
+ "type": "string",
15
+ "description": "A brief description providing relevant information about the verticalExtent."
16
+ },
17
+ "minValue": {
18
+ "type": "number",
19
+ "description": "Lowest vertical extent contained in the resource.",
20
+ "translation": {
21
+ "ISO 19115-2": ["EX_VerticalExtent > minimumValue > Real "]
22
+ }
23
+ },
24
+ "maxValue": {
25
+ "type": "number",
26
+ "description": "Highest vertical extent contained in the resource.",
27
+ "translation": {
28
+ "ISO 19115-2": ["EX_VerticalExtent > maximumValue > Real "]
29
+ }
30
+ },
31
+ "crsId": {
32
+ "$ref": "./spatialReference.json#",
33
+ "description": "Identifies the vertical coordinate reference system used for the minimum and maximum values.",
34
+ "example": ""
35
+ }
36
+ }
37
+ }
data/test/helper.rb ADDED
@@ -0,0 +1,32 @@
1
+ # * Description: Base helper class for tests of examples schemas and templates.
2
+ # Any tests should inherit from this class.
3
+ # * Author: Josh Bradley
4
+ # * License: Public Domain
5
+
6
+ require 'minitest/autorun'
7
+ require 'json'
8
+ require 'json-schema'
9
+ require File.join(File.dirname(__FILE__), '..', 'lib', 'adiwg-mdjson_schemas.rb')
10
+
11
+ class TestHelper < Minitest::Test
12
+ @@dir = File.join(File.dirname(__FILE__), '..', '/')
13
+
14
+ @@example = File.join(File.dirname(__FILE__), '..', 'examples/')
15
+
16
+ @@schema = File.join(File.dirname(__FILE__), '..', 'schema', 'schema.json')
17
+
18
+ @@strict = false
19
+
20
+ def self.load_json(filename)
21
+ JSON.load File.new(filename)
22
+ end
23
+
24
+ schemas = `git ls-files #{@@dir}/schema`.split($/)
25
+
26
+ schemas.each do |schema|
27
+ name = File.basename(schema)
28
+ jschema = JSON::Schema.new(TestHelper.load_json(schema), Addressable::URI.parse(name))
29
+
30
+ JSON::Validator.add_schema(jschema)
31
+ end
32
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestAdditionalDocumentation < TestHelper
4
+ def test_additionalDocumentation
5
+ errors = JSON::Validator.fully_validate('additionalDocumentation.json', @@example + 'additionalDocumentation.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestAddress < TestHelper
4
+ def test_address
5
+ errors = JSON::Validator.fully_validate('contact.json', @@example + 'address.json', :fragment => "#/definitions/address", strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestAssociatedResource < TestHelper
4
+ def test_associatedResource
5
+ errors = JSON::Validator.fully_validate('associatedResource.json', @@example + 'associatedResource.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestAttribute < TestHelper
4
+ def test_attribute
5
+ errors = JSON::Validator.fully_validate('attribute.json', @@example + 'attribute.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestAttributeGroup < TestHelper
4
+ def test_attributeGroup
5
+ errors = JSON::Validator.fully_validate('attributeGroup.json', @@example + 'attributeGroup.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestBoundingBox < TestHelper
4
+ def test_boundingBox
5
+ errors = JSON::Validator.fully_validate('geographicExtent.json', @@example + 'boundingBox.json', fragment:'#/definitions/boundingBox', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestCitation < TestHelper
4
+ def test_citation
5
+ errors = JSON::Validator.fully_validate('citation.json', @@example + 'citation.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestConstraint < TestHelper
4
+ def test_constraint
5
+ errors = JSON::Validator.fully_validate('constraint.json', @@example + 'constraint.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestContact < TestHelper
4
+ def test_contact
5
+ errors = JSON::Validator.fully_validate('contact.json', @@example + 'contact.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestCoverageDescription < TestHelper
4
+ def test_coverageDescription
5
+ errors = JSON::Validator.fully_validate('coverageDescription.json', @@example + 'coverageDescription.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestDataDictionary < TestHelper
4
+ def test_dataDictionary
5
+ errors = JSON::Validator.fully_validate('dataDictionary.json', @@example + 'dictionary.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestDimension < TestHelper
4
+ def test_dimension
5
+ errors = JSON::Validator.fully_validate('gridRepresentation.json', @@example + 'dimension.json', :fragment => "#/definitions/dimension", strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestDistribution < TestHelper
4
+ def test_distribution
5
+ errors = JSON::Validator.fully_validate('distribution.json', @@example + 'distribution.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestDistributor < TestHelper
4
+ def test_distributor
5
+ errors = JSON::Validator.fully_validate('distributor.json', @@example + 'distributor.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
data/test/tc_domain.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestDomain < TestHelper
4
+ def test_domain
5
+ errors = JSON::Validator.fully_validate('domain.json', @@example + 'domain.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestDomainItem < TestHelper
4
+ def test_domain
5
+ errors = JSON::Validator.fully_validate('domain.json', @@example + 'domainItem.json', fragment: '#/definitions/domainItem', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestDuration < TestHelper
4
+ def test_duration
5
+ errors = JSON::Validator.fully_validate('timePeriod.json', @@example + 'duration.json', :fragment => "#/definitions/duration", strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
data/test/tc_entity.rb ADDED
@@ -0,0 +1,20 @@
1
+ require 'helper.rb'
2
+
3
+ class TestEntity < TestHelper
4
+ def test_entity
5
+ errors = JSON::Validator.fully_validate('entity.json', @@example + 'entity.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ def test_index
9
+ errors = JSON::Validator.fully_validate('entity.json', @@example + 'entityIndex.json', fragment:'#/definitions/index', strict: @@strict, list: true)
10
+ assert(errors.empty?, errors.join("\n"))
11
+ end
12
+ def test_foreignKey
13
+ errors = JSON::Validator.fully_validate('entity.json', @@example + 'entityForeignKey.json', fragment:'#/definitions/foreignKey', strict: @@strict, list: true)
14
+ assert(errors.empty?, errors.join("\n"))
15
+ end
16
+ def test_attribute
17
+ errors = JSON::Validator.fully_validate('entity.json', @@example + 'entityAttribute.json', fragment:'#/definitions/attribute', strict: @@strict, list: true)
18
+ assert(errors.empty?, errors.join("\n"))
19
+ end
20
+ end
data/test/tc_extent.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestExtent < TestHelper
4
+ def test_extent
5
+ errors = JSON::Validator.fully_validate('extent.json', @@example + 'extent.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestFeatureCollection < TestHelper
4
+ def test_featureCollection
5
+ errors = JSON::Validator.fully_validate('geojson.json', @@example + 'featureCollection.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestFeatureProperties < TestHelper
4
+ def test_featureProperties
5
+ errors = JSON::Validator.fully_validate('geojson.json', @@example + 'featureProperties.json', fragment:'#/definitions/featureProperties', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
data/test/tc_format.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestFormat < TestHelper
4
+ def test_format
5
+ errors = JSON::Validator.fully_validate('format.json', @@example + 'format.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestFunding < TestHelper
4
+ def test_funding
5
+ errors = JSON::Validator.fully_validate('funding.json', @@example + 'funding.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,12 @@
1
+ require 'helper.rb'
2
+
3
+ class TestGeographicElement < TestHelper
4
+ def test_geographicElement
5
+ errors = JSON::Validator.fully_validate('geographicExtent.json', @@example + 'geoJson.json', fragment:'#/definitions/geographicElement', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ def test_geoJson
9
+ errors = JSON::Validator.fully_validate('geojson.json', @@example + 'geoJson.json', strict: @@strict, list: true)
10
+ assert(errors.empty?, errors.join("\n"))
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestGeographicExtent < TestHelper
4
+ def test_geographicExtent
5
+ errors = JSON::Validator.fully_validate('geographicExtent.json', @@example + 'geographicExtent.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestGeometryCollection < TestHelper
4
+ def test_geometryCollection
5
+ errors = JSON::Validator.fully_validate('geojson.json', @@example + 'geometryCollection.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestGeometryFeature < TestHelper
4
+ def test_geometryFeature
5
+ errors = JSON::Validator.fully_validate('geojson.json', @@example + 'geometryFeature.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestGeometryObject < TestHelper
4
+ def test_geometryObject
5
+ errors = JSON::Validator.fully_validate('geometry.json', @@example + 'geometryObject.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestGeorectifiedRepresentation < TestHelper
4
+ def test_georectifiedRepresentation
5
+ errors = JSON::Validator.fully_validate('georectifiedRepresentation.json', @@example + 'georectifiedRepresentation.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestGeoreferencableRepresentation < TestHelper
4
+ def test_georeferencableRepresentation
5
+ errors = JSON::Validator.fully_validate('georeferencableRepresentation.json', @@example + 'georeferencableRepresentation.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestGraphic < TestHelper
4
+ def test_graphic
5
+ errors = JSON::Validator.fully_validate('graphic.json', @@example + 'graphic.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestGridRepresentation < TestHelper
4
+ def test_gridRepresentation
5
+ errors = JSON::Validator.fully_validate('gridRepresentation.json', @@example + 'gridRepresentation.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class Testidentifier < TestHelper
4
+ def test_identifier
5
+ errors = JSON::Validator.fully_validate('identifier.json', @@example + 'identifier.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestImageDescription < TestHelper
4
+ def test_imageDescription
5
+ errors = JSON::Validator.fully_validate('imageDescription.json', @@example + 'imageDescription.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,16 @@
1
+ require 'helper.rb'
2
+
3
+ class TestSchema < TestHelper
4
+ def test_schemas
5
+ # Validate the schemas themselves
6
+ schemas = `git ls-files #{@@dir}/schema`.split($/)
7
+ errors = []
8
+
9
+ schemas.each do |schema|
10
+ error = JSON::Validator.fully_validate(File.join(File.dirname(__FILE__), 'draft-04.json'), schema)
11
+ errors += error
12
+ end
13
+
14
+ assert(errors.empty?, errors.join("\n"))
15
+ end
16
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestKeyword < TestHelper
4
+ def test_keyword
5
+ errors = JSON::Validator.fully_validate('keyword.json', @@example + 'keyword.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestLineage < TestHelper
4
+ def test_lineage
5
+ errors = JSON::Validator.fully_validate('lineage.json', @@example + 'lineage.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestMaintInfo < TestHelper
4
+ def test_maintInfo
5
+ errors = JSON::Validator.fully_validate('maintInfo.json', @@example + 'maintenance.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestMeasure < TestHelper
4
+ def test_measure
5
+ errors = JSON::Validator.fully_validate('measure.json', @@example + 'measure.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
data/test/tc_medium.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestMedium < TestHelper
4
+ def test_medium
5
+ errors = JSON::Validator.fully_validate('medium.json', @@example + 'medium.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestMetadata < TestHelper
4
+ def test_metadata
5
+ errors = JSON::Validator.fully_validate('metadata.json', @@example + 'metadata.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestMetadataInfo < TestHelper
4
+ def test_metadataInfo
5
+ errors = JSON::Validator.fully_validate('metadataInfo.json', @@example + 'metadataInfo.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'helper.rb'
2
+
3
+ class TestOnlineResource < TestHelper
4
+ def test_online_resource
5
+ errors = JSON::Validator.fully_validate('onlineResource.json', @@example + 'onlineResource.json', strict: @@strict, list: true)
6
+ assert(errors.empty?, errors.join("\n"))
7
+ end
8
+ end