datapackage 0.1.3 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +140 -54
- data/bin/console +10 -0
- metadata +5 -52
- data/datapackage/schemas/LICENSE.md +0 -24
- data/datapackage/schemas/README.md +0 -33
- data/datapackage/schemas/csv-dialect-description-format.json +0 -30
- data/datapackage/schemas/data-package.json +0 -146
- data/datapackage/schemas/definitions.json +0 -222
- data/datapackage/schemas/fiscal-data-package.json +0 -279
- data/datapackage/schemas/fiscal-data-package.jsonld +0 -5
- data/datapackage/schemas/index.html +0 -15
- data/datapackage/schemas/json-table-schema.json +0 -83
- data/datapackage/schemas/registry.csv +0 -4
- data/datapackage/schemas/tabular-data-package.json +0 -147
- data/datapackage/schemas/tests/__init__.py +0 -0
- data/datapackage/schemas/tests/test_registry.py +0 -102
- data/datapackage/schemas/tests/test_schemas.py +0 -41
- data/lib/datapackage/exceptions.rb +0 -12
- data/lib/datapackage/package.rb +0 -181
- data/lib/datapackage/registry.rb +0 -81
- data/lib/datapackage/resource.rb +0 -83
- data/lib/datapackage/schema.rb +0 -111
- data/lib/datapackage/version.rb +0 -3
- data/lib/datapackage.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fc6a10e6daa3511af308ad0bc2d3c8901c13237
|
4
|
+
data.tar.gz: 28cc6fe87eb009d93c31ae5341cc599eefd0c96b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b59f052947c6a931890c76dc005ce10f2cb1e36a593e6c089c503a838dceb87cd2a0662b93b53e7ed6299b4e285b5ba75dff4a07fbeb3f1f48d0f69525ccc96c
|
7
|
+
data.tar.gz: a1423662c7310e957db54c8c566a8fc044c78489188094c844eae13dee81e9977f1befde61474b869fcd9b3b79cd2458bfb906ae81da59d90140fc8380208952
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
[![SemVer](https://img.shields.io/badge/versions-SemVer-brightgreen.svg)](http://semver.org/)
|
7
7
|
[![Gitter](https://img.shields.io/gitter/room/frictionlessdata/chat.svg)](https://gitter.im/frictionlessdata/chat)
|
8
8
|
|
9
|
-
A ruby library for working with [Data Packages](
|
9
|
+
A ruby library for working with [Data Packages](https://specs.frictionlessdata.io/data-package/).
|
10
10
|
|
11
11
|
The library is intending to support:
|
12
12
|
|
@@ -35,29 +35,54 @@ Require the gem, if you need to:
|
|
35
35
|
require 'datapackage'
|
36
36
|
```
|
37
37
|
|
38
|
-
Parsing a
|
38
|
+
Parsing a data package descriptor from a remote location:
|
39
39
|
|
40
40
|
```ruby
|
41
|
-
package = DataPackage::Package.new( "http://example.org/datasets/a" )
|
41
|
+
package = DataPackage::Package.new( "http://example.org/datasets/a/datapackage.json" )
|
42
42
|
```
|
43
43
|
|
44
|
-
This assumes that `http://example.org/datasets/a/datapackage.json` exists
|
44
|
+
This assumes that `http://example.org/datasets/a/datapackage.json` exists.
|
45
|
+
Similarly you can load a package descriptor from a local JSON file.
|
45
46
|
|
46
47
|
```ruby
|
47
|
-
package = DataPackage::Package.new( "
|
48
|
+
package = DataPackage::Package.new( "/my/data/package/datapackage.json" )
|
48
49
|
```
|
49
50
|
|
50
|
-
|
51
|
+
The data package descriptor
|
52
|
+
i.e. `datapackage.json` file, is expected to be at the _root_ directory
|
53
|
+
of the data package and the `path` attribute of the package's `resources` will be resolved
|
54
|
+
relative to it.
|
55
|
+
|
56
|
+
You can also load a data package descriptor directly from a Hash:
|
51
57
|
|
52
58
|
```ruby
|
53
|
-
|
54
|
-
|
59
|
+
descriptor = {
|
60
|
+
'resources'=> [
|
61
|
+
{
|
62
|
+
'name'=> 'example',
|
63
|
+
'profile'=> 'tabular-data-resource',
|
64
|
+
'data'=> [
|
65
|
+
['height', 'age', 'name'],
|
66
|
+
['180', '18', 'Tony'],
|
67
|
+
['192', '32', 'Jacob'],
|
68
|
+
],
|
69
|
+
'schema'=> {
|
70
|
+
'fields'=> [
|
71
|
+
{'name'=> 'height', 'type'=> 'integer'},
|
72
|
+
{'name'=> 'age', 'type'=> 'integer'},
|
73
|
+
{'name'=> 'name', 'type'=> 'string'},
|
74
|
+
],
|
75
|
+
}
|
76
|
+
}
|
77
|
+
]
|
78
|
+
}
|
79
|
+
|
80
|
+
package = DataPackage::Package.new(descriptor)
|
55
81
|
```
|
56
82
|
|
57
83
|
There are a set of helper methods for accessing data from the package, e.g:
|
58
84
|
|
59
85
|
```ruby
|
60
|
-
package = DataPackage::Package.new( "/my/data/package" )
|
61
86
|
package.name
|
62
87
|
package.title
|
63
88
|
package.description
|
@@ -65,93 +90,154 @@ package.homepage
|
|
65
90
|
package.license
|
66
91
|
```
|
67
92
|
|
68
|
-
## Reading
|
93
|
+
## Reading Data Resources
|
69
94
|
|
70
|
-
|
71
|
-
|
95
|
+
A data package must contain an array of [Data Resources](https://specs.frictionlessdata.io/data-resource).
|
96
|
+
You can access the resources in your Data Package either by their name or by their index in the `resources` array:
|
72
97
|
|
73
|
-
|
98
|
+
```ruby
|
99
|
+
first_resource = package.resources[0]
|
100
|
+
first_resource = package.get_resource('example')
|
74
101
|
|
75
|
-
|
76
|
-
|
77
|
-
|
102
|
+
# Get info about the data source of this resource
|
103
|
+
first_resource.source_type
|
104
|
+
first_resource.source
|
105
|
+
```
|
78
106
|
|
79
|
-
|
80
|
-
min_gdp = brazil_gdp.min_by { |r| r[:value] }
|
107
|
+
You can then read the source depending on its `source_type`: `inline`, `remote` or `local`.
|
81
108
|
|
82
|
-
|
83
|
-
|
109
|
+
If a resource complies with the [Tabular Data Resource spec](https://specs.frictionlessdata.io/tabular-data-resource/) or uses the
|
110
|
+
`tabular-data-resource` [profile](#profiles) you can make a [TableSchema::Table](https://github.com/frictionlessdata/tableschema-rb) for it:
|
84
111
|
|
85
|
-
|
86
|
-
|
87
|
-
|
112
|
+
```ruby
|
113
|
+
package.resources[0].tabular?
|
114
|
+
table = package.resources[0].table
|
88
115
|
|
89
|
-
|
116
|
+
# Read the entire table at once
|
117
|
+
data = table.read
|
90
118
|
|
91
|
-
#
|
119
|
+
# Or iterate through it
|
120
|
+
data = table.iter {|row| print row}
|
92
121
|
```
|
93
122
|
|
123
|
+
See [TableSchema](https://github.com/frictionlessdata/tableschema-rb) documentation for other things you can do with tabular resource.
|
124
|
+
|
94
125
|
## Creating a Data Package
|
95
126
|
|
96
127
|
```ruby
|
97
128
|
package = DataPackage::Package.new
|
98
129
|
|
130
|
+
# Add package properties
|
99
131
|
package.name = 'my_sleep_duration'
|
100
|
-
package.resources = [
|
101
|
-
{'name': 'data'}
|
102
|
-
]
|
103
|
-
|
104
|
-
resource = package.resources[0]
|
105
|
-
resource.descriptor['data'] = [
|
106
|
-
7, 8, 5, 6, 9, 7, 8
|
107
|
-
]
|
108
132
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
133
|
+
# Add a resource
|
134
|
+
package.add_resource(
|
135
|
+
{
|
136
|
+
'name'=> 'sleep_durations_this_week',
|
137
|
+
'data'=> [7, 8, 5, 6, 9, 7, 8],
|
138
|
+
}
|
139
|
+
)
|
114
140
|
```
|
115
141
|
|
116
|
-
|
142
|
+
If the resource is valid it will be added to the `resources` array of the Data Package;
|
143
|
+
if it's invalid it will not be added and you should try creating and [validating](#validating-a-resource) your resource to see why it fails.
|
117
144
|
|
118
145
|
```ruby
|
119
|
-
|
146
|
+
# Update a resource
|
147
|
+
my_resource = package.get_resource('sleep_durations_this_week')
|
148
|
+
my_resource['schema'] = {
|
149
|
+
'fields'=> [
|
150
|
+
{'name'=> 'number_hours', 'type'=> 'integer'},
|
151
|
+
]
|
152
|
+
}
|
153
|
+
|
154
|
+
# Save the Data Package descriptor to the target file
|
155
|
+
package.save('datapackage.json')
|
120
156
|
|
121
|
-
|
122
|
-
|
123
|
-
package.errors
|
124
|
-
#=> [] # An array of errors
|
157
|
+
# Remove a resource
|
158
|
+
package.remove_resource('sleep_durations_this_week')
|
125
159
|
```
|
126
160
|
|
127
|
-
##
|
161
|
+
## Profiles
|
162
|
+
|
163
|
+
Data Package and Data Resource descriptors can be validated against [JSON schemas](https://tools.ietf.org/html/draft-zyp-json-schema-04) that we call `profiles`.
|
164
|
+
|
165
|
+
By default, this gem uses the standard [Data Package profile](http://specs.frictionlessdata.io/schemas/data-package.json) and [Data Resource profile](http://specs.frictionlessdata.io/schemas/data-resource.json) but alternative profiles are available for both.
|
128
166
|
|
129
|
-
|
167
|
+
According to the [specs](https://specs.frictionlessdata.io/profiles/) the value of
|
168
|
+
the `profile` property can be either a URL or an indentifier from [the registry](https://specs.frictionlessdata.io/schemas/registry.json).
|
130
169
|
|
131
|
-
###
|
170
|
+
### Profiles in the local cache
|
132
171
|
|
133
|
-
The
|
172
|
+
The profiles from the registry come bundled with the gem. You can reference them in your Data Package descriptor by their identifier in [the registry](https://specs.frictionlessdata.io/schemas/registry.json):
|
173
|
+
|
174
|
+
- `data-package` the default profile for a [Data Package](https://specs.frictionlessdata.io/data-package/)
|
175
|
+
- `data-resource` the default profile for a [Data Resource](https://specs.frictionlessdata.io/data-resource)
|
176
|
+
- `tabular-data-package` for a [Tabular Data Package](http://specs.frictionlessdata.io/tabular-data-package/)
|
177
|
+
- `tabular-data-resource` for a [Tabular Data Resource](https://specs.frictionlessdata.io/tabular-data-resource/)
|
178
|
+
- `fiscal-data-package` for a [Fiscal Data Package](http://fiscal.dataprotocols.org/spec/)
|
134
179
|
|
135
180
|
```ruby
|
136
|
-
|
181
|
+
{
|
182
|
+
"profile": "tabular-data-package"
|
183
|
+
}
|
137
184
|
```
|
138
185
|
|
139
|
-
###
|
186
|
+
### Profiles from elsewhere
|
140
187
|
|
141
|
-
If you have a
|
188
|
+
If you have a custom profile schema you can reference it by its URL:
|
142
189
|
|
143
190
|
```ruby
|
144
|
-
|
191
|
+
{
|
192
|
+
"profile": "https://specs.frictionlessdata.io/schemas/tabular-data-package.json"
|
193
|
+
}
|
145
194
|
```
|
146
195
|
|
196
|
+
## Validation
|
197
|
+
|
198
|
+
Data Resources and Data Packages are validated against their profiles to ensure they respect the expected structure.
|
199
|
+
|
200
|
+
### Validating a Resource
|
201
|
+
|
202
|
+
```ruby
|
203
|
+
descriptor = {
|
204
|
+
'name'=> 'incorrect name',
|
205
|
+
'path'=> 'https://cdn.rawgit.com/frictionlessdata/datapackage-rb/master/spec/fixtures/test-pkg/test.csv',
|
206
|
+
}
|
207
|
+
resource = DataPackage::Resource.new(descriptor, base_path='')
|
208
|
+
|
209
|
+
# Returns true if resource is valid, false otherwise
|
210
|
+
resource.valid?
|
211
|
+
|
212
|
+
# Returns true or raises DataPackage::ValidationError
|
213
|
+
resource.validate
|
214
|
+
|
215
|
+
# Iterate through validation errors
|
216
|
+
resource.iter_errors{ |err| p err}
|
217
|
+
```
|
218
|
+
|
219
|
+
### Validating a Package
|
220
|
+
|
221
|
+
The same methods used to check the validity of a Resource - `valid?`, `validate` and `iter_errors`- are also available for a Package.
|
222
|
+
The difference is that after a Package descriptor is validated against its `profile`, each of its `resources` are also validated against their `profile`.
|
223
|
+
|
224
|
+
In order for a Package to be valid all its Resources have to be valid.
|
225
|
+
|
147
226
|
## Developer notes
|
148
227
|
|
149
228
|
These notes are intended to help people that want to contribute to this package itself. If you just want to use it, you can safely ignore them.
|
150
229
|
|
230
|
+
After checking out the repo, run `bundle` to install dependencies. Then, run `rake spec` to run the tests.
|
231
|
+
|
232
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
233
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`,
|
234
|
+
which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
235
|
+
|
151
236
|
### Updating the local schemas cache
|
152
237
|
|
153
|
-
We cache the schemas from https://
|
238
|
+
We cache the local schemas from https://specs.frictionlessdata.io/schemas/registry.json.
|
239
|
+
The local schemas should be kept up to date with the remote ones using:
|
154
240
|
|
155
241
|
```
|
156
|
-
|
242
|
+
rake update_profiles
|
157
243
|
```
|
data/bin/console
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datapackage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leigh Dodds
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-08-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -40,20 +40,6 @@ dependencies:
|
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
|
-
- !ruby/object:Gem::Dependency
|
44
|
-
name: rest-client
|
45
|
-
requirement: !ruby/object:Gem::Requirement
|
46
|
-
requirements:
|
47
|
-
- - ">="
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: '0'
|
50
|
-
type: :runtime
|
51
|
-
prerelease: false
|
52
|
-
version_requirements: !ruby/object:Gem::Requirement
|
53
|
-
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: '0'
|
57
43
|
- !ruby/object:Gem::Dependency
|
58
44
|
name: colorize
|
59
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -68,20 +54,6 @@ dependencies:
|
|
68
54
|
- - ">="
|
69
55
|
- !ruby/object:Gem::Version
|
70
56
|
version: '0'
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: rack
|
73
|
-
requirement: !ruby/object:Gem::Requirement
|
74
|
-
requirements:
|
75
|
-
- - "~>"
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 1.6.4
|
78
|
-
type: :runtime
|
79
|
-
prerelease: false
|
80
|
-
version_requirements: !ruby/object:Gem::Requirement
|
81
|
-
requirements:
|
82
|
-
- - "~>"
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: 1.6.4
|
85
57
|
- !ruby/object:Gem::Dependency
|
86
58
|
name: rubyzip
|
87
59
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,7 +83,7 @@ dependencies:
|
|
111
83
|
- !ruby/object:Gem::Version
|
112
84
|
version: '0'
|
113
85
|
- !ruby/object:Gem::Dependency
|
114
|
-
name:
|
86
|
+
name: tableschema
|
115
87
|
requirement: !ruby/object:Gem::Requirement
|
116
88
|
requirements:
|
117
89
|
- - ">="
|
@@ -213,33 +185,14 @@ email:
|
|
213
185
|
- ops@theodi.org
|
214
186
|
executables:
|
215
187
|
- datapackage
|
188
|
+
- console
|
216
189
|
extensions: []
|
217
190
|
extra_rdoc_files: []
|
218
191
|
files:
|
219
192
|
- LICENSE.md
|
220
193
|
- README.md
|
194
|
+
- bin/console
|
221
195
|
- bin/datapackage
|
222
|
-
- datapackage/schemas/LICENSE.md
|
223
|
-
- datapackage/schemas/README.md
|
224
|
-
- datapackage/schemas/csv-dialect-description-format.json
|
225
|
-
- datapackage/schemas/data-package.json
|
226
|
-
- datapackage/schemas/definitions.json
|
227
|
-
- datapackage/schemas/fiscal-data-package.json
|
228
|
-
- datapackage/schemas/fiscal-data-package.jsonld
|
229
|
-
- datapackage/schemas/index.html
|
230
|
-
- datapackage/schemas/json-table-schema.json
|
231
|
-
- datapackage/schemas/registry.csv
|
232
|
-
- datapackage/schemas/tabular-data-package.json
|
233
|
-
- datapackage/schemas/tests/__init__.py
|
234
|
-
- datapackage/schemas/tests/test_registry.py
|
235
|
-
- datapackage/schemas/tests/test_schemas.py
|
236
|
-
- lib/datapackage.rb
|
237
|
-
- lib/datapackage/exceptions.rb
|
238
|
-
- lib/datapackage/package.rb
|
239
|
-
- lib/datapackage/registry.rb
|
240
|
-
- lib/datapackage/resource.rb
|
241
|
-
- lib/datapackage/schema.rb
|
242
|
-
- lib/datapackage/version.rb
|
243
196
|
homepage: http://github.com/theodi/datapackage.rb
|
244
197
|
licenses:
|
245
198
|
- MIT
|
@@ -1,24 +0,0 @@
|
|
1
|
-
This is free and unencumbered software released into the public domain.
|
2
|
-
|
3
|
-
Anyone is free to copy, modify, publish, use, compile, sell, or
|
4
|
-
distribute this software, either in source code form or as a compiled
|
5
|
-
binary, for any purpose, commercial or non-commercial, and by any
|
6
|
-
means.
|
7
|
-
|
8
|
-
In jurisdictions that recognize copyright laws, the author or authors
|
9
|
-
of this software dedicate any and all copyright interest in the
|
10
|
-
software to the public domain. We make this dedication for the benefit
|
11
|
-
of the public at large and to the detriment of our heirs and
|
12
|
-
successors. We intend this dedication to be an overt act of
|
13
|
-
relinquishment in perpetuity of all present and future rights to this
|
14
|
-
software under copyright law.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
-
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
20
|
-
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
21
|
-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
23
|
-
|
24
|
-
For more information, please refer to <http://unlicense.org>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# JSON Schemas for Data Protocol Formats
|
2
|
-
|
3
|
-
[![Build Status](http://travis-ci.org/dataprotocols/schemas.svg?branch=master)](http://travis-ci.org/dataprotocols/schemas)
|
4
|
-
|
5
|
-
JSON Schemas, and a registry, for the Data Package family of specifications. Read more about Data Packages at [Data Protocols](http://dataprotocols.org/).
|
6
|
-
|
7
|
-
The schemas are implemented using [JSON Schema](http://json-schema.org/), a specification which provides a simple declarative format for describing the structure of JSON documents.
|
8
|
-
|
9
|
-
The registry is implemented as simple CSV file, and there are libraries in [Javascript](http://github.com/okfn/datapackage-registry-js) and [Python](http://github.com/okfn/datapackage-registry-py) that work with the registry directly.
|
10
|
-
|
11
|
-
## The schemas
|
12
|
-
|
13
|
-
Here you'll find schemas for [Data Package](http://dataprotocols.org/data-packages/), various Data Package Profiles, [JSON Table Schemas](http://dataprotocols.org/json-table-schema/), [CSV Dialect Description Format](http://dataprotocols.org/csv-dialect/) and more.
|
14
|
-
|
15
|
-
Note that some of the schemas also feature information for [json-editor](http://github.com/jdorn/json-editor) - useful for building web forms and other UI components dynamically from a schema. We use this extensively in [DataPackagist](http://github.com/okfn/datapackagist) to build UIs for creating Data Packages.
|
16
|
-
|
17
|
-
## The registry
|
18
|
-
|
19
|
-
The registry enables consumers to get access to schemas and documentation for the family of Data Package specifications, and related specifications like JSON Table Schema and CSV Dialect Description Format. See [Data Protocols](http://dataprotocols.org/) for more information.
|
20
|
-
|
21
|
-
### Contributing
|
22
|
-
|
23
|
-
Yes we welcome and encourage additions to the registry! Any spec that is added must meet the following criteria:
|
24
|
-
|
25
|
-
* Be related to the Data Packages family of specifications.
|
26
|
-
* Have a publicly -accessible web page describing the specification.
|
27
|
-
* Have a JSON Schema file that describes the specification.
|
28
|
-
|
29
|
-
See the existing entries in the registry, and then take the following steps to add a new entry:
|
30
|
-
|
31
|
-
1. Make a new pull request called `registry/{NAME_OF_SPECIFICATION}`
|
32
|
-
2. The pull request features a JSON Schema file for the new specification, and adds the spec to `registry.csv`
|
33
|
-
3. Write a brief description of the spec as part of the pull request.
|
@@ -1,30 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
-
"title": "CSVDDF",
|
4
|
-
"description": "JSON Schema for validating CSVDDF dialect structures",
|
5
|
-
"type": "object",
|
6
|
-
"properties": {
|
7
|
-
"delimiter": {
|
8
|
-
"type": "string"
|
9
|
-
},
|
10
|
-
"doublequote": {
|
11
|
-
"type": "boolean"
|
12
|
-
},
|
13
|
-
"lineterminator": {
|
14
|
-
"type": "string"
|
15
|
-
},
|
16
|
-
"quotechar": {
|
17
|
-
"type": "string"
|
18
|
-
},
|
19
|
-
"skipinitialspace": {
|
20
|
-
"type": "boolean"
|
21
|
-
}
|
22
|
-
},
|
23
|
-
"required": [
|
24
|
-
"delimiter",
|
25
|
-
"doublequote",
|
26
|
-
"lineterminator",
|
27
|
-
"quotechar",
|
28
|
-
"skipinitialspace"
|
29
|
-
]
|
30
|
-
}
|
@@ -1,146 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
-
"title": "Data Package",
|
4
|
-
"description": "Data Package is a simple specification for data access and delivery.",
|
5
|
-
"type": "object",
|
6
|
-
"required": [ "name", "resources" ],
|
7
|
-
"properties": {
|
8
|
-
"name": {
|
9
|
-
"$ref": "definitions.json#/define/name",
|
10
|
-
"propertyOrder": 10
|
11
|
-
},
|
12
|
-
"title": {
|
13
|
-
"$ref": "definitions.json#/define/title",
|
14
|
-
"propertyOrder": 20
|
15
|
-
},
|
16
|
-
"description": {
|
17
|
-
"$ref": "definitions.json#/define/description",
|
18
|
-
"format": "textarea",
|
19
|
-
"propertyOrder": 30
|
20
|
-
},
|
21
|
-
"homepage": {
|
22
|
-
"$ref": "definitions.json#/define/homepage",
|
23
|
-
"propertyOrder": 40
|
24
|
-
},
|
25
|
-
"version": {
|
26
|
-
"$ref": "definitions.json#/define/version",
|
27
|
-
"propertyOrder": 50
|
28
|
-
},
|
29
|
-
"license": {
|
30
|
-
"$ref": "definitions.json#/define/license",
|
31
|
-
"propertyOrder": 60
|
32
|
-
},
|
33
|
-
"author": {
|
34
|
-
"$ref": "definitions.json#/define/author",
|
35
|
-
"propertyOrder": 70
|
36
|
-
},
|
37
|
-
"contributors": {
|
38
|
-
"$ref": "definitions.json#/define/contributors",
|
39
|
-
"propertyOrder": 80,
|
40
|
-
"options": { "hidden": true }
|
41
|
-
},
|
42
|
-
"resources": {
|
43
|
-
"title": "Resources",
|
44
|
-
"description": "The data resources that this package describes.",
|
45
|
-
"type": "array",
|
46
|
-
"propertyOrder": 90,
|
47
|
-
"minItems": 0,
|
48
|
-
"items": {
|
49
|
-
"type": "object",
|
50
|
-
"properties": {
|
51
|
-
"name": {
|
52
|
-
"$ref": "definitions.json#/define/name",
|
53
|
-
"propertyOrder": 10
|
54
|
-
},
|
55
|
-
"title": {
|
56
|
-
"$ref": "definitions.json#/define/title",
|
57
|
-
"propertyOrder": 20
|
58
|
-
},
|
59
|
-
"description": {
|
60
|
-
"$ref": "definitions.json#/define/description",
|
61
|
-
"propertyOrder": 30,
|
62
|
-
"format": "textarea"
|
63
|
-
},
|
64
|
-
"schema": {
|
65
|
-
"$ref": "definitions.json#/define/schema",
|
66
|
-
"propertyOrder": 40
|
67
|
-
},
|
68
|
-
"url": {
|
69
|
-
"$ref": "definitions.json#/define/url",
|
70
|
-
"propertyOrder": 50
|
71
|
-
},
|
72
|
-
"path": {
|
73
|
-
"$ref": "definitions.json#/define/path",
|
74
|
-
"propertyOrder": 60
|
75
|
-
},
|
76
|
-
"data": {
|
77
|
-
"$ref": "definitions.json#/define/data",
|
78
|
-
"propertyOrder": 70
|
79
|
-
},
|
80
|
-
"format": {
|
81
|
-
"$ref": "definitions.json#/define/format",
|
82
|
-
"propertyOrder": 80
|
83
|
-
},
|
84
|
-
"mediatype": {
|
85
|
-
"$ref": "definitions.json#/define/mediatype",
|
86
|
-
"propertyOrder": 90
|
87
|
-
},
|
88
|
-
"encoding": {
|
89
|
-
"$ref": "definitions.json#/define/encoding",
|
90
|
-
"propertyOrder": 100
|
91
|
-
},
|
92
|
-
"bytes": {
|
93
|
-
"$ref": "definitions.json#/define/bytes",
|
94
|
-
"propertyOrder": 110,
|
95
|
-
"options": { "hidden": true }
|
96
|
-
},
|
97
|
-
"hash": {
|
98
|
-
"$ref": "definitions.json#/define/hash",
|
99
|
-
"propertyOrder": 120,
|
100
|
-
"options": { "hidden": true }
|
101
|
-
},
|
102
|
-
"dialect": {
|
103
|
-
"$ref": "definitions.json#/define/dialect",
|
104
|
-
"propertyOrder": 130,
|
105
|
-
"options": { "hidden": true }
|
106
|
-
},
|
107
|
-
"sources": {
|
108
|
-
"$ref": "definitions.json#/define/sources",
|
109
|
-
"propertyOrder": 140,
|
110
|
-
"options": { "hidden": true }
|
111
|
-
},
|
112
|
-
"license": {
|
113
|
-
"$ref": "definitions.json#/define/license",
|
114
|
-
"description": "The license under which the resource is published.",
|
115
|
-
"propertyOrder": 150,
|
116
|
-
"options": { "hidden": true }
|
117
|
-
}
|
118
|
-
},
|
119
|
-
"anyOf": [
|
120
|
-
{ "title": "url required", "required": ["url"] },
|
121
|
-
{ "title": "path required", "required": ["path"] },
|
122
|
-
{ "title": "data required", "required": ["data"] }
|
123
|
-
]
|
124
|
-
}
|
125
|
-
},
|
126
|
-
"keywords": {
|
127
|
-
"$ref": "definitions.json#/define/keywords",
|
128
|
-
"propertyOrder": 100
|
129
|
-
},
|
130
|
-
"sources": {
|
131
|
-
"$ref": "definitions.json#/define/sources",
|
132
|
-
"propertyOrder": 110,
|
133
|
-
"options": { "hidden": true }
|
134
|
-
},
|
135
|
-
"image": {
|
136
|
-
"$ref": "definitions.json#/define/image",
|
137
|
-
"propertyOrder": 120,
|
138
|
-
"options": { "hidden": true }
|
139
|
-
},
|
140
|
-
"dataDependencies": {
|
141
|
-
"$ref": "definitions.json#/define/dataDependencies",
|
142
|
-
"propertyOrder": 140,
|
143
|
-
"options": { "hidden": true }
|
144
|
-
}
|
145
|
-
}
|
146
|
-
}
|