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.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/README.md +14 -3
- data/adiwg-json_schemas.gemspec +2 -2
- data/bower.json +0 -1
- data/examples/additionalDocumentation.json +9 -60
- data/examples/address.json +14 -10
- data/examples/allocation.json +12 -0
- data/examples/associatedResource.json +10 -118
- data/examples/attribute.json +27 -0
- data/examples/attributeGroup.json +17 -0
- data/examples/boundingBox.json +6 -0
- data/examples/citation.json +69 -127
- data/examples/computedBbox.json +399 -0
- data/examples/constraint.json +62 -0
- data/examples/contact.json +40 -207
- data/examples/coverageDescription.json +21 -0
- data/examples/date.json +8 -19
- data/examples/dictionary.json +58 -0
- data/examples/dimension.json +11 -0
- data/examples/distribution.json +26 -0
- data/examples/distributor.json +22 -142
- data/examples/domain.json +29 -0
- data/examples/domainItem.json +11 -0
- data/examples/duration.json +17 -0
- data/examples/entity.json +48 -0
- data/examples/entityAttribute.json +31 -0
- data/examples/entityForeignKey.json +17 -0
- data/examples/entityIndex.json +8 -0
- data/examples/extent.json +60 -0
- data/examples/featureCollection.json +58 -0
- data/examples/featureProperties.json +16 -0
- data/examples/format.json +7 -14
- data/examples/funding.json +33 -0
- data/examples/geoJson.json +185 -0
- data/examples/geographicExtent.json +22 -0
- data/examples/geometryCollection.json +14 -0
- data/examples/geometryFeature.json +12 -0
- data/examples/geometryObject.json +90 -0
- data/examples/georectifiedRepresentation.json +28 -0
- data/examples/georeferencableRepresentation.json +25 -0
- data/examples/gmlIdentifier.json +8 -0
- data/examples/graphic.json +33 -0
- data/examples/gridRepresentation.json +14 -0
- data/examples/identifier.json +9 -0
- data/examples/imageDescription.json +15 -0
- data/examples/keyword.json +14 -0
- data/examples/keywordObject.json +12 -0
- data/examples/legalConstraint.json +21 -0
- data/examples/lineage.json +21 -0
- data/examples/locale.json +12 -3
- data/examples/maintenance.json +38 -0
- data/examples/mdJson.json +99 -0
- data/examples/measure.json +5 -0
- data/examples/medium.json +16 -0
- data/examples/metadata.json +102 -0
- data/examples/metadataInfo.json +68 -101
- data/examples/onlineResource.json +13 -17
- data/examples/orderProcess.json +6 -0
- data/examples/party.json +21 -0
- data/examples/phone.json +9 -0
- data/examples/processStep.json +34 -0
- data/examples/releasability.json +28 -0
- data/examples/resourceInfo.json +230 -1256
- data/examples/responsibleParty.json +31 -0
- data/examples/schema.json +8 -0
- data/examples/scope.json +33 -0
- data/examples/scopeDescription.json +8 -0
- data/examples/securityConstraint.json +13 -0
- data/examples/series.json +9 -0
- data/examples/source.json +23 -0
- data/examples/spatialReference.json +34 -0
- data/examples/spatialRepresentation.json +59 -0
- data/examples/spatialResolution.json +11 -0
- data/examples/taxonomicClassification.json +59 -0
- data/examples/taxonomicSystem.json +13 -0
- data/examples/taxonomy.json +79 -188
- data/examples/temporalExtent.json +11 -0
- data/examples/timeInstant.json +13 -0
- data/examples/timeInterval.json +8 -0
- data/examples/timePeriod.json +26 -0
- data/examples/transferOption.json +36 -0
- data/examples/usage.json +48 -33
- data/examples/vectorObject.json +4 -0
- data/examples/vectorRepresentation.json +10 -0
- data/examples/verticalExtent.json +10 -17
- data/examples/voucher.json +12 -0
- data/lib/adiwg/mdjson_schemas/utils.rb +45 -15
- data/lib/adiwg/mdjson_schemas/validator.rb +6 -7
- data/lib/adiwg/mdjson_schemas/version.rb +1 -1
- data/lib/adiwg/mdjson_schemas.rb +4 -2
- data/schema/additionalDocumentation.json +29 -0
- data/schema/associatedResource.json +49 -0
- data/schema/attribute.json +157 -0
- data/schema/attributeGroup.json +29 -0
- data/schema/{schema/geojson/bbox.json → bbox.json} +2 -2
- data/schema/{schema/citation.json → citation.json} +73 -99
- data/schema/common.json +49 -0
- data/schema/{schema/resourceConstraint.json → constraint.json} +83 -13
- data/schema/contact.json +234 -0
- data/schema/coverageDescription.json +50 -0
- data/schema/dataDictionary.json +71 -0
- data/schema/distribution.json +35 -0
- data/schema/distributor.json +46 -0
- data/schema/domain.json +65 -0
- data/schema/entity.json +235 -0
- data/schema/extent.json +59 -0
- data/schema/format.json +37 -0
- data/schema/funding.json +67 -0
- data/schema/geographicExtent.json +87 -0
- data/schema/{schema/geojson/geojson.json → geojson.json} +16 -44
- data/schema/{schema/geojson/geometry.json → geometry.json} +2 -1
- data/schema/georectifiedRepresentation.json +89 -0
- data/schema/georeferencableRepresentation.json +49 -0
- data/schema/{schema/graphicOverview.json → graphic.json} +19 -6
- data/schema/{schema/gridInfo.json → gridRepresentation.json} +7 -13
- data/schema/identifier.json +47 -0
- data/schema/imageDescription.json +92 -0
- data/schema/{schema/keyword.json → keyword.json} +18 -4
- data/schema/{schema/dataQuality.json → lineage.json} +92 -57
- data/schema/{schema/maintInfo.json → maintInfo.json} +24 -6
- data/schema/measure.json +31 -0
- data/schema/medium.json +55 -0
- data/schema/metadata.json +77 -0
- data/schema/metadataInfo.json +112 -0
- data/schema/{schema/onlineResource.json → onlineResource.json} +1 -1
- data/schema/orderProcess.json +45 -0
- data/schema/releasability.json +42 -0
- data/schema/{schema/resourceInfo.json → resourceInfo.json} +112 -189
- data/schema/responsibility.json +56 -0
- data/schema/schema.json +16 -31
- data/schema/scope.json +55 -0
- data/schema/spatialReference.json +26 -0
- data/schema/spatialRepresentation.json +83 -0
- data/schema/spatialResolution.json +54 -0
- data/schema/taxonomy.json +178 -0
- data/schema/temporalExtent.json +42 -0
- data/schema/timeInstant.json +46 -0
- data/schema/timePeriod.json +126 -0
- data/schema/transferOption.json +61 -0
- data/schema/{schema/usage.json → usage.json} +34 -4
- data/schema/vectorRepresentation.json +51 -0
- data/schema/verticalExtent.json +37 -0
- data/test/helper.rb +32 -0
- data/test/tc_additionalDocumentation.rb +8 -0
- data/test/tc_address.rb +8 -0
- data/test/tc_associatedResource.rb +8 -0
- data/test/tc_attribute.rb +8 -0
- data/test/tc_attributeGroup.rb +8 -0
- data/test/tc_boundingBox.rb +8 -0
- data/test/tc_citation.rb +8 -0
- data/test/tc_constraint.rb +8 -0
- data/test/tc_contact.rb +8 -0
- data/test/tc_coverageDescription.rb +8 -0
- data/test/tc_dataDictionary.rb +8 -0
- data/test/tc_dimension.rb +8 -0
- data/test/tc_distribution.rb +8 -0
- data/test/tc_distributor.rb +8 -0
- data/test/tc_domain.rb +8 -0
- data/test/tc_domainItem.rb +8 -0
- data/test/tc_duration.rb +8 -0
- data/test/tc_entity.rb +20 -0
- data/test/tc_extent.rb +8 -0
- data/test/tc_featureCollection.rb +8 -0
- data/test/tc_featureProperties.rb +8 -0
- data/test/tc_format.rb +8 -0
- data/test/tc_funding.rb +8 -0
- data/test/tc_geographicElement.rb +12 -0
- data/test/tc_geographicExtent.rb +8 -0
- data/test/tc_geometryCollection.rb +8 -0
- data/test/tc_geometryFeature.rb +8 -0
- data/test/tc_geometryObject.rb +8 -0
- data/test/tc_georectifiedRepresentation.rb +8 -0
- data/test/tc_georeferencableRepresentation.rb +8 -0
- data/test/tc_graphic.rb +8 -0
- data/test/tc_gridRepresentation.rb +8 -0
- data/test/tc_identifier.rb +8 -0
- data/test/tc_imageDescription.rb +8 -0
- data/test/tc_jsonschema.rb +16 -0
- data/test/tc_keyword.rb +8 -0
- data/test/tc_lineage.rb +8 -0
- data/test/tc_maintInfo.rb +8 -0
- data/test/tc_measure.rb +8 -0
- data/test/tc_medium.rb +8 -0
- data/test/tc_metadata.rb +8 -0
- data/test/tc_metadataInfo.rb +8 -0
- data/test/tc_onlineResource.rb +8 -0
- data/test/tc_orderProcess.rb +8 -0
- data/test/tc_party.rb +8 -0
- data/test/tc_processStep.rb +8 -0
- data/test/tc_releasability.rb +8 -0
- data/test/tc_resourceInfo.rb +8 -0
- data/test/tc_responsibility.rb +8 -0
- data/test/tc_schema.rb +8 -0
- data/test/tc_scope.rb +8 -0
- data/test/tc_source.rb +8 -0
- data/test/tc_spatialReference.rb +8 -0
- data/test/tc_spatialRepresentation.rb +8 -0
- data/test/tc_spatialResolution.rb +8 -0
- data/test/tc_taxonomicClassification.rb +8 -0
- data/test/tc_taxonomicSystem.rb +8 -0
- data/test/tc_taxonomy.rb +8 -0
- data/test/tc_temporalExtent.rb +8 -0
- data/test/tc_timeInstant.rb +8 -0
- data/test/tc_timePeriod.rb +8 -0
- data/test/tc_transferOption.rb +8 -0
- data/test/tc_uri.rb +8 -0
- data/test/tc_usage.rb +8 -0
- data/test/tc_utils.rb +8 -11
- data/test/tc_vectorRepresentation.rb +13 -0
- data/test/tc_verticalExtent.rb +8 -0
- data/test/tc_voucher.rb +8 -0
- metadata +264 -57
- data/examples/contactRef.json +0 -12
- data/examples/coverageInfo.json +0 -148
- data/examples/dataDictionary.json +0 -549
- data/examples/dataQuality.json +0 -272
- data/examples/extent_linestring.json +0 -288
- data/examples/extent_point.json +0 -246
- data/examples/extent_polygon.json +0 -353
- data/examples/full_example.json +0 -3065
- data/examples/full_example2.json +0 -2325
- data/examples/geojson.json +0 -446
- data/examples/graphicOverview.json +0 -28
- data/examples/gridInfo.json +0 -23
- data/examples/hierarchyLevel.json +0 -90
- data/examples/keywords.json +0 -144
- data/examples/lcc_project_example.json +0 -326
- data/examples/legalConstraints.json +0 -17
- data/examples/maintInfo.json +0 -34
- data/examples/minimum_example.json +0 -35
- data/examples/resolution.json +0 -9
- data/examples/resourceMaintenance.json +0 -10
- data/examples/securityConstraints.json +0 -13
- data/examples/spatialRef.json +0 -14
- data/examples/temporalElement.json +0 -29
- data/schema/schema/contact.json +0 -262
- data/schema/schema/coverageInfo.json +0 -303
- data/schema/schema/dataDictionary.json +0 -335
- data/schema/schema/distributor.json +0 -216
- data/schema/schema/extent.json +0 -215
- data/schema/schema/geojson/crs.json +0 -99
- data/schema/schema/metadata.json +0 -188
- data/schema/schema/resolution.json +0 -51
- data/schema/schema/taxonomy.json +0 -122
- data/test/tc_schemas.rb +0 -243
- /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": "
|
6
|
+
"example": "",
|
7
7
|
"translation": {
|
8
8
|
"ISO 19115-2": ["MD_Usage"]
|
9
9
|
},
|
10
|
-
"required": ["specificUsage"
|
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": "
|
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
|
data/test/tc_address.rb
ADDED
@@ -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 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
|
data/test/tc_citation.rb
ADDED
data/test/tc_contact.rb
ADDED
@@ -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
|
data/test/tc_domain.rb
ADDED
@@ -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
|
data/test/tc_duration.rb
ADDED
@@ -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 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
data/test/tc_funding.rb
ADDED
@@ -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
|
data/test/tc_graphic.rb
ADDED
@@ -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 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
|
data/test/tc_keyword.rb
ADDED
data/test/tc_lineage.rb
ADDED
data/test/tc_measure.rb
ADDED
data/test/tc_medium.rb
ADDED
data/test/tc_metadata.rb
ADDED
@@ -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
|