adiwg-json_schemas 0.5.2 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/extent_point.json +39 -13
- data/examples/extent_polygon.json +4 -4
- data/examples/full_example.json +195 -156
- data/examples/full_example2.json +2278 -0
- data/examples/geojson.json +428 -235
- data/examples/keywords.json +45 -40
- data/examples/lcc_project_example.json +266 -203
- data/examples/onlineResource.json +1 -2
- data/examples/resourceInfo.json +1015 -1045
- data/examples/spatialRef.json +14 -0
- data/examples/uri.json +2 -1
- data/lib/adiwg/json_schemas/version.rb +2 -2
- data/schema/schema/citation.json +16 -25
- data/schema/schema/extent.json +3 -3
- data/schema/schema/geojson/geojson.json +5 -2
- data/schema/schema/graphicOverview.json +3 -3
- data/schema/schema/keyword.json +1 -15
- data/schema/schema/metadata.json +0 -6
- data/schema/schema/onlineResource.json +0 -3
- data/schema/schema/resourceInfo.json +25 -10
- data/templates/adiwg_metadata_template.json +263 -148
- data/test/tc_schemas.rb +132 -122
- data/test/tc_utils.rb +1 -1
- metadata +4 -2
data/test/tc_schemas.rb
CHANGED
@@ -5,130 +5,140 @@
|
|
5
5
|
* License: Public Domain
|
6
6
|
=end
|
7
7
|
|
8
|
-
require
|
9
|
-
require
|
8
|
+
require 'test/unit'
|
9
|
+
require 'json'
|
10
10
|
require 'json-schema'
|
11
|
-
require File.dirname(__FILE__)
|
11
|
+
require File.join(File.dirname(__FILE__),'..','lib', 'adiwg-json_schemas.rb')
|
12
12
|
|
13
13
|
class TestExamples < Test::Unit::TestCase
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
15
|
+
@@dir = File.join(File.dirname(__FILE__),'..','schema/')
|
16
|
+
@@ex = File.join(File.dirname(__FILE__),'..','examples/')
|
17
|
+
@@schema = File.join(File.dirname(__FILE__),'..','schema','schema.json')
|
18
|
+
|
19
|
+
def test_data_template
|
20
|
+
errors = JSON::Validator.fully_validate(@@schema, @@dir + '../templates/adiwg_metadata_template.json', :strict => false)
|
21
|
+
assert(errors.empty?, errors.join("/n"))
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_full_example
|
25
|
+
errors = JSON::Validator.fully_validate(@@schema , @@ex + 'full_example.json')
|
26
|
+
assert(errors.empty?, errors.join("/n"))
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_full_example2
|
30
|
+
errors = JSON::Validator.fully_validate(@@schema , @@ex + 'full_example2.json')
|
31
|
+
assert(errors.empty?, errors.join("/n"))
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_lcc_example
|
35
|
+
errors = JSON::Validator.fully_validate(@@schema , @@ex + 'lcc_project_example.json')
|
36
|
+
assert(errors.empty?, errors.join("/n"))
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_contact
|
40
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'contact.json')
|
41
|
+
assert(errors.empty?, errors.join("/n"))
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_citation
|
45
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/citation.json', @@ex + 'citation.json', :list => true)
|
46
|
+
assert(errors.empty?, errors.join("/n"))
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_taxonomy
|
50
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/taxonomy.json', @@ex + 'taxonomy.json', :list => true)
|
51
|
+
assert(errors.empty?, errors.join("/n"))
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_usage
|
55
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/usage.json', @@ex + 'usage.json', :list => true)
|
56
|
+
assert(errors.empty?, errors.join("/n"))
|
57
|
+
end
|
58
|
+
|
59
|
+
def test_resolution
|
60
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/resolution.json', @@ex + 'resolution.json', :list => true)
|
61
|
+
assert(errors.empty?, errors.join("/n"))
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_graphicOverview
|
65
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/graphicOverview.json', @@ex + 'graphicOverview.json', :list => true)
|
66
|
+
assert(errors.empty?, errors.join("/n"))
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_resourceInfo
|
70
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceInfo.json', @@ex + 'resourceInfo.json', :list => true)
|
71
|
+
assert(errors.empty?, errors.join("/n"))
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_onlineResource
|
75
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/onlineResource.json', @@ex + 'onlineResource.json', :list => true)
|
76
|
+
assert(errors.empty?, errors.join("/n"))
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_resourceConstraint
|
80
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceConstraint.json', @@ex + 'resourceConstraints.json', :list => true)
|
81
|
+
assert(errors.empty?, errors.join("/n"))
|
82
|
+
end
|
83
|
+
|
84
|
+
def test_date
|
85
|
+
errors = JSON::Validator.fully_validate(@@schema, @@ex + 'date.json', :fragment => "#/definitions/date", :list => true)
|
86
|
+
assert(errors.empty?, errors.join("/n"))
|
87
|
+
end
|
88
|
+
|
89
|
+
def test_spatialRef
|
90
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/resourceInfo.json', @@ex + 'spatialRef.json', :fragment => "#/properties/spatialReferenceSystem", :list => false)
|
91
|
+
assert(errors.empty?, errors.join("/n"))
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_contactRef
|
95
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/contact.json', @@ex + 'contactRef.json', :fragment => "#/definitions/contactRef", :list => true)
|
96
|
+
assert(errors.empty?, errors.join("/n"))
|
97
|
+
end
|
98
|
+
|
99
|
+
def test_keywords
|
100
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/keyword.json', @@ex + 'keywords.json', :list => true)
|
101
|
+
assert(errors.empty?, errors.join("/n"))
|
102
|
+
end
|
103
|
+
|
104
|
+
def test_distributor
|
105
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/distributor.json', @@ex + 'distributor.json', :list => true)
|
106
|
+
assert(errors.empty?, errors.join("/n"))
|
107
|
+
end
|
108
|
+
|
109
|
+
def test_geojson
|
110
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/geojson/geojson.json', @@ex + 'geojson.json', :list => true)
|
111
|
+
assert(errors.empty?, errors.join("/n"))
|
112
|
+
end
|
113
|
+
|
114
|
+
def test_extent_linestring
|
115
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_linestring.json', :list => true)
|
116
|
+
assert(errors.empty?, errors.join("/n"))
|
117
|
+
end
|
118
|
+
|
119
|
+
def test_extent_point
|
120
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_point.json', :list => true)
|
121
|
+
assert(errors.empty?, errors.join("/n"))
|
122
|
+
end
|
123
|
+
|
124
|
+
def test_extent_polygon
|
125
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/extent.json', @@ex + 'extent_polygon.json', :list => true)
|
126
|
+
assert(errors.empty?, errors.join("/n"))
|
127
|
+
end
|
128
|
+
|
129
|
+
def test_maintInfo
|
130
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/maintInfo.json', @@ex + 'maintInfo.json', :list => true)
|
131
|
+
errors = errors + JSON::Validator.fully_validate(@@dir + 'schema/maintInfo.json', @@ex + 'resourceMaintenance.json', :list => true)
|
132
|
+
assert(errors.empty?, errors.join("/n"))
|
133
|
+
end
|
134
|
+
|
135
|
+
def test_dataQuality
|
136
|
+
errors = JSON::Validator.fully_validate(@@dir + 'schema/dataQuality.json', @@ex + 'dataQuality.json', :list => true)
|
137
|
+
assert(errors.empty?, errors.join("/n"))
|
138
|
+
end
|
139
|
+
|
140
|
+
def test_uri
|
141
|
+
errors = JSON::Validator.fully_validate(@@schema, @@ex + 'uri.json', :fragment => "#/definitions/uri", :list => true)
|
142
|
+
assert(errors.empty?, errors.join("/n"))
|
143
|
+
end
|
134
144
|
end
|
data/test/tc_utils.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adiwg-json_schemas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Bradley, Stan Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,6 +92,7 @@ files:
|
|
92
92
|
- examples/extent_point.json
|
93
93
|
- examples/extent_polygon.json
|
94
94
|
- examples/full_example.json
|
95
|
+
- examples/full_example2.json
|
95
96
|
- examples/geojson.json
|
96
97
|
- examples/graphicOverview.json
|
97
98
|
- examples/hierarchyLevel.json
|
@@ -103,6 +104,7 @@ files:
|
|
103
104
|
- examples/resourceConstraints.json
|
104
105
|
- examples/resourceInfo.json
|
105
106
|
- examples/resourceMaintenance.json
|
107
|
+
- examples/spatialRef.json
|
106
108
|
- examples/taxonomy.json
|
107
109
|
- examples/uri.json
|
108
110
|
- examples/usage.json
|