-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathodam-data-resource.json
374 lines (374 loc) · 11 KB
/
odam-data-resource.json
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://inrae.github.io/ODAM/json-schema/odam-data-resource.json",
"title": "odam-data-resource",
"description": "Description of an ODAM data resource",
"type": "object",
"definitions": {
"profile": {
"title": "odam-data-resource",
"description": "odam-data-resource profile is an extension of the tabular data resource profile",
"type": "string"
},
"name": {
"title": "Name",
"description": "An identifier string. Lower case characters with `_` are allowed.",
"type": "string",
"pattern": "^([a-zA-Z0-9_])+$",
"context": "This is ideally a url-usable and human-readable name. Name `SHOULD` be invariant, meaning it `SHOULD NOT` change when its parent descriptor is updated."
},
"label": {
"title": "Label",
"description": "A very short description where spaces are allowed.",
"type": "string",
"context": "Ideally it corresponds to the label for CV Term"
},
"title": {
"title": "Title",
"description": "A human-readable title.",
"type": "string"
},
"description": {
"title": "Description",
"description": "A text description. Markdown is encouraged.",
"type": "string"
},
"path": {
"title": "Path",
"description": "A fully qualified URL, or a POSIX file path..",
"type": "string",
"pattern": "^(?=^[^./~])(^((?!\\.{2}).)*$).*$",
"context": "Implementations need to negotiate the type of path provided, and dereference the data accordingly."
},
"cv_term": {
"title": "CV Term",
"description": "Controlled Vocabulary based on ontology",
"type": "object",
"properties": {
"label": {
"$ref": "#/definitions/label"
},
"path": {
"$ref": "#/definitions/path"
}
}
},
"csvDialect": {
"title": "CSV Dialect",
"description": "The CSV dialect descriptor.",
"required": [
"delimiter",
"doubleQuote"
],
"properties": {
"csvddfVersion": {
"$ref": "#/definitions/csvddfVersion"
},
"delimiter": {
"$ref": "#/definitions/delimiter"
},
"doubleQuote": {
"$ref": "#/definitions/doubleQuote"
},
"lineTerminator": {
"$ref": "#/definitions/lineTerminator"
},
"quoteChar": {
"$ref": "#/definitions/quoteChar"
},
"escapeChar": {
"$ref": "#/definitions/escapeChar"
},
"skipInitialSpace": {
"$ref": "#/definitions/skipInitialSpace"
},
"header": {
"$ref": "#/definitions/header"
},
"commentChar": {
"$ref": "#/definitions/commentChar"
},
"caseSensitiveHeader": {
"$ref": "#/definitions/caseSensitiveHeader"
}
}
},
"csvddfVersion": {
"title": "CSV Dialect schema version",
"description": "A number to indicate the schema version of CSV Dialect. Version 1.0 was named CSV Dialect Description Format and used different field names.",
"type": "number",
"default": 1.2
},
"delimiter": {
"title": "Delimiter",
"description": "A character sequence to use as the field separator.",
"type": "string",
"default": ","
},
"doubleQuote": {
"title": "Double Quote",
"description": "Specifies the handling of quotes inside fields.",
"context": "If Double Quote is set to true, two consecutive quotes must be interpreted as one.",
"type": "boolean",
"default": true
},
"lineTerminator": {
"title": "Line Terminator",
"description": "Specifies the character sequence that must be used to terminate rows.",
"type": "string",
"default": "\n"
},
"quoteChar": {
"title": "Quote Character",
"description": "Specifies a one-character string to use as the quoting character.",
"type": "string",
"default": "\""
},
"escapeChar": {
"title": "Escape Character",
"description": "Specifies a one-character string to use as the escape character.",
"type": "string"
},
"skipInitialSpace": {
"title": "Skip Initial Space",
"description": "Specifies the interpretation of whitespace immediately following a delimiter. If false, whitespace immediately after a delimiter should be treated as part of the subsequent field.",
"type": "boolean",
"default": true
},
"header": {
"title": "Header",
"description": "Specifies if the file includes a header row, always as the first row in the file.",
"type": "boolean",
"default": true
},
"commentChar": {
"title": "Comment Character",
"description": "Specifies a character sequence causing the rest of the line after it to be ignored.",
"type": "string"
},
"caseSensitiveHeader": {
"title": "Case Sensitive Header",
"description": "Specifies if the case of headers is meaningful.",
"context": "Use of case in source CSV files is not always an intentional decision. For example, should \"CAT\" and \"Cat\" be considered to have the same meaning.",
"type": "boolean",
"default": false
},
"format": {
"title": "Format",
"description": "The file format of this resource.",
"context": "`csv`, `xls`, `json` are examples of common formats.",
"type": "string"
},
"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": "^(.+)/(.+)$"
},
"encoding": {
"title": "Encoding",
"description": "The file encoding of this resource.",
"type": "string",
"default": "utf-8"
},
"tableSchema": {
"title": "Table Schema",
"description": "A Table Schema for this resource, compliant with the [Table Schema](/tableschema/) specification.",
"type": "object",
"required": [
"fields",
"categories"
],
"properties": {
"fields": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/tableSchemaField"
},
"description": "An `array` of Table Schema Field objects."
},
"primaryKey": {
"$ref": "#/definitions/tableSchemaPrimaryKey"
},
"foreignKeys": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/tableSchemaForeignKey"
}
},
"categories": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/tableSchemaCategory"
},
"description": "An `array` of Table Schema Category objects."
},
"missingValues": {
"$ref": "#/definitions/tableSchemaMissingValues"
}
}
},
"tableSchemaField": {
"title": "Table Schema Field",
"type": "object",
"required": [
"name", "type", "title"
],
"properties": {
"name": {
"$ref": "#/definitions/name"
},
"type": {
"type": "string",
"enum": [
"number", "string"
]
},
"title": {
"$ref": "#/definitions/title"
},
"unit": {
"type": "string"
},
"cv_term": {
"$ref": "#/definitions/cv_term"
},
"constraints": {
"title": "Constraints",
"description": "The following constraints are supported for `string` fields.",
"type": "object",
"properties": {
"required": {
"type": "boolean",
"description": "Indicates whether a property must have a value for each instance.",
"context": "An empty string is considered to be a missing value."
},
"unique": {
"type": "boolean",
"description": "When `true`, each value for the property `MUST` be unique."
}
}
}
}
},
"tableSchemaPrimaryKey": {
"oneOf": [
{
"type": "array",
"minItems": 1,
"uniqueItems": false,
"items": {
"type": "string"
}
},
{
"type": "string"
}
],
"description": "A primary key is a field name or an array of field names, whose values `MUST` uniquely identify each row in the table."
},
"tableSchemaForeignKey": {
"title": "Table Schema Foreign Key",
"description": "Table Schema Foreign Key",
"type": "object",
"required": [
"fields",
"reference"
],
"properties": {
"fields": {
"type": "string",
"description": "Fields that make up the primary key."
},
"reference": {
"type": "object",
"required": [
"resource",
"fields"
],
"properties": {
"resource": {
"type": "string",
"default": ""
},
"fields": {
"type": "string"
}
}
}
}
},
"tableSchemaCategory": {
"title": "Table Schema Category",
"type": "object",
"properties": {
"name": {
"type": "string",
"enum": [
"identifier", "factor", "quantitative", "qualitative"
]
},
"fields": {
"type": "array"
}
}
},
"tableSchemaMissingValues": {
"type": "array",
"items": {
"type": "string"
},
"default": [
""
]
}
},
"properties": {
"path": {
"$ref": "#/definitions/path"
},
"profile": {
"$ref": "#/definitions/profile"
},
"name": {
"$ref": "#/definitions/name"
},
"title": {
"$ref": "#/definitions/title"
},
"identifier": {
"description": "name of the identifier field (column name). i.e same as primaryKey",
"type": "string"
},
"obtainedFrom": {
"description": "name of the file ",
"type": "string"
},
"joinkey": {
"description": "name of the identifier field (column name) that serves to link with its father file i.e same as foreignKey",
"type": "string"
},
"cv_term" : {
"$ref": "#/definitions/cv_term"
},
"schema": {
"$ref": "#/definitions/tableSchema"
},
"dialect": {
"$ref": "#/definitions/csvDialect"
},
"encoding": {
"$ref": "#/definitions/encoding"
},
"format": {
"$ref": "#/definitions/format"
},
"mediatype": {
"$ref": "#/definitions/mediatype"
}
},
"required": [ "path", "name", "title", "identifier", "schema", "dialect", "format" ]
}