Skip to content

Commit 4664b95

Browse files
committed
Added JSON Data Resource
1 parent 3093554 commit 4664b95

File tree

2 files changed

+57
-0
lines changed

2 files changed

+57
-0
lines changed

content/docs/standard/data-resource.mdx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ If `path` property is not provided but there is a `url` property as was defined
148148
A Data Resource descriptor `MAY` contain a property `type` that `MUST` be a string with the following possible values:
149149

150150
- `table`: indicates that the resource is tabular as per [Tabular Data](/standard/glossary/#tabular-data) definition. Please read more about [Tabular Resource](#tabular) properties.
151+
- `json`: indicates that the resource is JSON as per [JSON Data](/standard/glossary/#json-data) definition. Please read more about [JSON Resource](#json) properties.
151152

152153
If property `type` is not provided, the resource is considered to be a non-specific file. An implementation `MAY` provide some additional interfaces, for example, tabular, to non-specific files if `type` can be detected from the data source or format.
153154

@@ -211,6 +212,10 @@ List of licenses as for [Data Package](/standard/data-package/#licenses). If not
211212

212213
The properties below are applicable to any Tabular Data Resource.
213214

215+
#### `type` {#tabular-type}
216+
217+
A Tabular Data Resource descriptor `SHOULD` contain a property `type` that `MUST` be `table`.
218+
214219
#### `path` or `data` [required] {#tabular-path-or-data}
215220

216221
If the `path` property is used for providing data than it `MUST` contain [Tabular Data](/standard/glossary/#tabular-data).
@@ -275,3 +280,38 @@ An example of a resource with a schema:
275280
}
276281
}
277282
```
283+
284+
### JSON
285+
286+
The properties below are applicable to any JSON Data Resource.
287+
288+
#### `type` {#json-type}
289+
290+
A JSON Data Resource descriptor `SHOULD` contain a property `type` that `MUST` be `json`.
291+
292+
#### `path` or `data` [required] {#json-path-or-data}
293+
294+
If the `path` property is used for providing data than it `MUST` contain [JSON Data](/standard/glossary/#json-data).
295+
296+
If the `data` property is used for providing data for a JSON Data Resource than it `MUST` be an inline instance of [JSON Data](/standard/glossary/#json-data).
297+
298+
#### `jsonSchema`
299+
300+
A JSON Data Resource `MAY` have a `jsonSchema` property to provide a JSONSchema of the resource data. If provided, the `jsonSchema` property `MUST` be a valid [JSON Schema](https://json-schema.org) descriptor in a form of an object or [URL-or-Path](/standard/glossary/#url-or-path).
301+
302+
An example of a resource with a JSON Schema:
303+
304+
```json
305+
{
306+
"name": "data",
307+
"type": "table",
308+
"path": "data.json",
309+
"jsonSchema": {
310+
"type": "object",
311+
"properties": {
312+
"first_name": { "type": "string" },
313+
"last_name": { "type": "string" },
314+
}
315+
}
316+
}
317+
```

content/docs/standard/glossary.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,23 @@ In JSON, a table would be:
134134
]
135135
```
136136

137+
### JSON Data
138+
139+
JSON data is a valid [JSON](https://www.json.org) object. For example:
140+
141+
```json
142+
{
143+
"name": "John Doe",
144+
"age": 30,
145+
"address": {
146+
"street": "123 Main St",
147+
"city": "Anytown",
148+
"state": "CA"
149+
}
150+
}
151+
```
152+
153+
137154
### Data Representation
138155

139156
In order to talk about the representation and processing of tabular data from text-based sources, it is useful to introduce the concepts of the _physical_ and the _logical_ representation of data.

0 commit comments

Comments
 (0)