Skip to content

Commit 3bd8961

Browse files
pierrecamilleripeterdesmetPietrH
authored
Promote "Metadata in Table Schema" recipe to the specs. (#961)
Co-authored-by: Peter Desmet <[email protected]> Co-authored-by: Peter Desmet <[email protected]> Co-authored-by: Pieter Huybrechts <[email protected]>
1 parent e1cae21 commit 3bd8961

File tree

9 files changed

+637
-11
lines changed

9 files changed

+637
-11
lines changed

content/docs/overview/changelog.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,42 @@ This document includes all meaningful changes made to the **Data Package standar
1212

1313
[fieldsMatch](/standard/table-schema/#fieldsMatch) has been corrected from array to string to match its definition ([#965](https://github.com/frictionlessdata/datapackage/issues/965)).
1414

15+
##### `schema.name` (new)
16+
17+
[`name`](/standard/table-schema/#name) allows to specify a name for a schema ([#961](https://github.com/frictionlessdata/datapackage/pull/961)).
18+
19+
##### `schema.title` (new)
20+
21+
[`title`](/standard/table-schema/#title) allows to specify a title for a schema ([#961](https://github.com/frictionlessdata/datapackage/pull/961)).
22+
23+
##### `schema.description` (new)
24+
25+
[`description`](/standard/table-schema/#description) allows to specify a description for a schema ([#961](https://github.com/frictionlessdata/datapackage/pull/961)).
26+
27+
##### `schema.homepage` (new)
28+
29+
[`homepage`](/standard/table-schema/#homepage) allows to specify a homepage for a schema ([#961](https://github.com/frictionlessdata/datapackage/pull/961)).
30+
31+
##### `schema.version` (new)
32+
33+
[`version`](/standard/table-schema/#version) allows to specify a version for a schema ([#961](https://github.com/frictionlessdata/datapackage/pull/961)).
34+
35+
##### `schema.created` (new)
36+
37+
[`created`](/standard/table-schema/#created) allows to specify when a schema was created ([#961](https://github.com/frictionlessdata/datapackage/pull/961)).
38+
39+
##### `schema.keywords` (new)
40+
41+
[`keywords`](/standard/table-schema/#keywords) allows to specify keywords for a schema ([#961](https://github.com/frictionlessdata/datapackage/pull/961)).
42+
43+
##### `schema.contributors` (new)
44+
45+
[`contributors`](/standard/table-schema/#contributors) allows to specify contributors for a schema ([#961](https://github.com/frictionlessdata/datapackage/pull/961)).
46+
47+
##### `schema.examples` (new)
48+
49+
[`examples`](/standard/table-schema/#examples) allows to specify a list of illustrative data resources that use a schema ([#961](https://github.com/frictionlessdata/datapackage/pull/961)).
50+
1551
## v2.0
1652

1753
This release includes a rich set of specification improvements to make Data Package a finished product (see [announcement](https://frictionlessdata.io/blog/2023/11/15/frictionless-specs-update/)). All changes were reviewed and accepted by the Data Package Working Group.

content/docs/standard/data-package.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ An Array of string keywords to assist users searching for the package in catalog
229229

230230
### `contributors`
231231

232-
The people or organizations who contributed to this Data Package. It `MUST` be an array. Each entry is a Contributor and `MUST` be an `object`. A Contributor `MUST` have at least one property. A Contributor is `RECOMMENDED` to have `title` property and `MAY` contain `givenName`, `familyName`, `path`, `email`, `roles`, and `organization` properties:
232+
The people or organizations that contributed to this Data Package. It `MUST` be an array. Each entry is a Contributor and `MUST` be an `object`. A Contributor `MUST` have at least one property. A Contributor is `RECOMMENDED` to have `title` property and `MAY` contain `givenName`, `familyName`, `path`, `email`, `roles`, and `organization` properties:
233233

234234
- `title`: A string containing a name of the contributor.
235235
- `givenName`: A string containing the name a person has been given, if the contributor is a person.

content/docs/standard/table-schema.mdx

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ In contrast with `field.constraints.unique`, `uniqueKeys` allows to define uniqu
202202

203203
#### `foreignKeys` {#foreignKeys}
204204

205-
A foreign key is a reference where values in a field (or fields) on the table ('resource' in data package terminology) described by this Table Schema connect to values a field (or fields) on this or a separate table (resource). They are directly modelled on the concept of foreign keys in SQL.
205+
A foreign key is a reference where values in a field (or fields) of the table ('resource' in Data Package terminology) described by this Table Schema connect to values a field (or fields) of this or a separate table (resource). This concept is directly modelled on the concept of foreign keys in SQL.
206206

207207
The `foreignKeys` property, if present, `MUST` be an Array. Each entry in the array `MUST` be a `foreignKey`. A `foreignKey` `MUST` be a `object` and `MUST` have the following properties:
208208

209209
- `fields` - `fields` is an array of strings specifying the field or fields on this resource that form the source part of the foreign key. The structure of the array is as per `primaryKey` above.
210210
- `reference` - `reference` `MUST` be a `object`. The `object`
211211
- `MUST` have a property `fields` which is an array of strings of the same length as the outer `fields`, describing the field (or fields) references on the destination resource. The structure of the array is as per `primaryKey` above.
212-
- `MAY` have a property `resource` which is the name of the resource within the current data package, i.e. the data package within which this Table Schema is located. For referencing another data resource the `resource` property `MUST` be provided. For self-referencing, i.e. references between fields in this Table Schema, the `resource` property `MUST` be omitted.
212+
- `MAY` have a property `resource` which is the name of the resource within the current Data Package, i.e. the Data Package within which this Table Schema is located. For referencing another Data Resource the `resource` property `MUST` be provided. For self-referencing, i.e. references between fields in this Table Schema, the `resource` property `MUST` be omitted.
213213

214214
Here's an example:
215215

@@ -277,6 +277,44 @@ If the value of the `foreignKey.reference.resource` property is an empty string
277277
Data consumer MUST support the `foreignKey.fields` and `foreignKey.reference.fields` properties in a form of a single string e.g. `"fields": "a"` which was a part of the `v1.0` of the specification.
278278
:::
279279

280+
#### `name`
281+
282+
A simple name or identifier for the schema (cf. [Data Package](https://datapackage.org/standard/data-package/#name)).
283+
284+
#### `title`
285+
286+
A string providing a title or one sentence description for the schema.
287+
288+
#### `description`
289+
290+
A description of the schema (cf. [Data Package](https://datapackage.org/standard/data-package/#description)).
291+
292+
#### `homepage`
293+
294+
A URL for the web page associated with the schema.
295+
296+
#### `version`
297+
298+
A version string identifying the version of the schema (cf. [Data Package](https://datapackage.org/standard/data-package/#version)). If not specified, the schema inherits from the Data Package if distributed in a Data Package descriptor.
299+
300+
#### `created`
301+
302+
The datetime on which the schema was created (cf. [Data Package](https://datapackage.org/standard/data-package/#created)).
303+
304+
#### `keywords`
305+
306+
An array of string keywords to assist users searching for the schema in catalogs.
307+
308+
#### `contributors`
309+
310+
The people or organizations that contributed to the schema (cf. [Data Package](https://datapackage.org/standard/data-package/#contributors)). If not specified the schema inherits from the Data Package if distributed in a Data Package descriptor.
311+
312+
#### `examples`
313+
314+
A list of Data Resources that use and illustrate the schema.
315+
316+
If present, it `MUST` be a non-empty array of objects. Each object is a [Data Resource](https://datapackage.org/standard/data-resource/) that `MUST` at least have the `name` and `path` property. The `path` must be a URL.
317+
280318
### Field
281319

282320
A field descriptor `MUST` be a JSON `object` that describes a single field. The descriptor provides additional human-readable documentation for a field, as well as additional information that can be used to validate the field or create a user interface for data entry.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

profiles/dictionary/common.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ example:
7272
}
7373
homepage:
7474
title: Home Page
75-
description: The home on the web that is related to this data package.
75+
description: The home on the web that is related to this descriptor.
7676
type: string
7777
format: uri
7878
examples:
@@ -149,7 +149,7 @@ created:
149149
}
150150
keywords:
151151
title: Keywords
152-
description: A list of keywords that describe this package.
152+
description: A list of keywords that describe this descriptor.
153153
type: array
154154
minItems: 1
155155
items:

profiles/dictionary/schema.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@ tableSchema:
8181
}
8282
missingValues:
8383
"$ref": "#/definitions/tableSchemaMissingValues"
84+
name:
85+
"$ref": "#/definitions/name"
86+
title:
87+
"$ref": "#/definitions/title"
88+
description:
89+
"$ref": "#/definitions/description"
90+
homepage:
91+
"$ref": "#/definitions/homepage"
92+
created:
93+
"$ref": "#/definitions/created"
94+
version:
95+
"$ref": "#/definitions/version"
96+
keywords:
97+
"$ref": "#/definitions/keywords"
98+
contributors:
99+
"$ref": "#/definitions/contributors"
100+
examples:
101+
"$ref": "#/definitions/tableSchemaExamples"
84102
examples:
85103
- |
86104
{
@@ -262,6 +280,33 @@ tableSchemaMissingValues:
262280
{
263281
"missingValues": []
264282
}
283+
tableSchemaExamples:
284+
title: Examples
285+
description: A list of Data Resources that use and illustrate the schema.
286+
type: array
287+
minItems: 0
288+
items:
289+
"$ref": "#/definitions/tableSchemaExample"
290+
examples:
291+
- |
292+
{
293+
"examples": [
294+
{
295+
"name": "valid-data",
296+
"path": "http://example.com/valid-data.csv"
297+
}
298+
]
299+
}
300+
tableSchemaExample:
301+
title: Example
302+
description: A Data Resource that uses and illustrates the schema.
303+
type: object
304+
properties:
305+
name:
306+
"$ref": "#/definitions/name"
307+
path:
308+
"$ref": "#/definitions/path"
309+
required: ["name", "path"]
265310
tableSchemaFieldString:
266311
type: object
267312
title: String Field

0 commit comments

Comments
 (0)