-
Notifications
You must be signed in to change notification settings - Fork 117
/
resource.yml
240 lines (240 loc) · 5.49 KB
/
resource.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
---
dataResource:
title: Data Resource
description: Data Resource.
type: object
oneOf:
- required:
- name
- data
- required:
- name
- path
properties:
profile:
"$ref": "#/definitions/profile"
propertyOrder: 10
default: "data-resource"
name:
"$ref": "#/definitions/name"
propertyOrder: 20
path:
"$ref": "#/definitions/resourcePath"
propertyOrder: 30
data:
"$ref": "#/definitions/data"
propertyOrder: 230
schema:
"$ref": "#/definitions/anySchema"
propertyOrder: 40
title:
"$ref": "#/definitions/title"
propertyOrder: 50
description:
"$ref": "#/definitions/description"
propertyOrder: 60
format: textarea
homepage:
"$ref": "#/definitions/homepage"
propertyOrder: 70
sources:
"$ref": "#/definitions/sources"
propertyOrder: 140
options:
hidden: true
licenses:
"$ref": "#/definitions/licenses"
description: The license(s) under which the resource is published.
propertyOrder: 150
options:
hidden: true
format:
"$ref": "#/definitions/format"
propertyOrder: 80
mediatype:
"$ref": "#/definitions/mediatype"
propertyOrder: 90
encoding:
"$ref": "#/definitions/encoding"
propertyOrder: 100
bytes:
"$ref": "#/definitions/bytes"
propertyOrder: 110
options:
hidden: true
hash:
"$ref": "#/definitions/hash"
propertyOrder: 120
options:
hidden: true
tabularDataResource:
title: Tabular Data Resource
description: A Tabular Data Resource.
type: object
oneOf:
- required:
- name
- data
- schema
- profile
- required:
- name
- path
- schema
- profile
properties:
profile:
"$ref": "#/definitions/profile"
enum: ["tabular-data-resource"]
propertyOrder: 10
name:
"$ref": "#/definitions/name"
propertyOrder: 20
path:
"$ref": "#/definitions/resourcePath"
propertyOrder: 30
data:
"$ref": "#/definitions/data"
propertyOrder: 230
schema:
"$ref": "#/definitions/tableSchema"
propertyOrder: 40
title:
"$ref": "#/definitions/title"
propertyOrder: 50
description:
"$ref": "#/definitions/description"
propertyOrder: 60
format: textarea
homepage:
"$ref": "#/definitions/homepage"
propertyOrder: 70
sources:
"$ref": "#/definitions/sources"
propertyOrder: 140
options:
hidden: true
licenses:
"$ref": "#/definitions/licenses"
description: The license(s) under which the resource is published.
propertyOrder: 150
options:
hidden: true
dialect:
"$ref": "#/definitions/csvDialect"
propertyOrder: 50
format:
"$ref": "#/definitions/format"
propertyOrder: 80
mediatype:
"$ref": "#/definitions/mediatype"
propertyOrder: 90
encoding:
"$ref": "#/definitions/encoding"
propertyOrder: 100
bytes:
"$ref": "#/definitions/bytes"
propertyOrder: 110
options:
hidden: true
hash:
"$ref": "#/definitions/hash"
propertyOrder: 120
options:
hidden: true
pathArray:
type: array
minItems: 1
items:
"$ref": "#/definitions/path"
examples:
- |
[ "file.csv" ]
- |
[ "http://example.com/file.csv" ]
resourcePath:
title: Path
description: A reference to the data for this resource, as either a path as a string, or an array of paths as strings.
of valid URIs.
oneOf: [
{ "$ref": "#/definitions/path" },
{ "$ref": "#/definitions/pathArray" }
]
context: The dereferenced value of each referenced data source in `path`
`MUST` be commensurate with a native, dereferenced representation of the data
the resource describes. For example, in a *Tabular* Data Resource, this means
that the dereferenced value of `path` `MUST` be an array.
examples:
- |
{
"path": [
"file.csv",
"file2.csv"
]
}
- |
{
"path": [
"http://example.com/file.csv",
"http://example.com/file2.csv"
]
}
- |
{
"path": "http://example.com/file.csv"
}
format:
title: Format
description: The file format of this resource.
context: "`csv`, `xls`, `json` are examples of common formats."
type: string
examples:
- |
{
"format": "xls"
}
mediatype:
title: Media Type
description: The media type of this resource. Can be any valid media type listed
with [IANA](https://www.iana.org/assignments/media-types/media-types.xhtml).
type: string
pattern: "^(.+)/(.+)$"
examples:
- |
{
"mediatype": "text/csv"
}
encoding:
title: Encoding
description: The file encoding of this resource.
type: string
default: utf-8
examples:
- |
{
"encoding": "utf-8"
}
bytes:
title: Bytes
description: The size of this resource in bytes.
type: integer
examples:
- |
{
"bytes": 2082
}
hash:
title: Hash
type: string
description: The MD5 hash of this resource. Indicate other hashing algorithms
with the {algorithm}:{hash} format.
pattern: "^([^:]+:[a-fA-F0-9]+|[a-fA-F0-9]{32}|)$"
examples:
- |
{
"hash": "d25c9c77f588f5dc32059d2da1136c02"
}
- |
{
"hash": "SHA256:5262f12512590031bbcc9a430452bfd75c2791ad6771320bb4b5728bfb78c4d0"
}