Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions content/docs/standard/data-package.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ A root level Data Package descriptor `MAY` have a `$schema` property that `MUST`

The default value is `https://datapackage.org/profiles/1.0/datapackage.json` and the recommended value is `https://datapackage.org/profiles/2.0/datapackage.json`.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

:::note[Backward Compatibility]
If the `$schema` property is not provided but a descriptor has the `profile` property a data consumer `MUST` validate the descriptor according to the [Profiles](https://specs.frictionlessdata.io/profiles/) specification.
:::
Expand Down
8 changes: 8 additions & 0 deletions content/docs/standard/data-resource.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ A Data Resource descriptor `MAY` contain a property `type` that `MUST` be a stri

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.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

:::note[Backward Compatibility]
If a resource has `profile` property that equals to `tabular-data-resource` or `https://specs.frictionlessdata.io/schemas/tabular-data-resource.json`, an implementation `MUST` treat it as `type` property were set to `table`
:::
Expand All @@ -161,6 +165,10 @@ A root level Data Resource descriptor `MAY` have a `$schema` property that `MUST

The default value is `https://datapackage.org/profiles/1.0/dataresource.json` and the recommended value is `https://datapackage.org/profiles/2.0/dataresource.json`.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

:::note[Backward Compatibility]
If the `$schema` property is not provided but a descriptor has the `profile` property a data consumer `MUST` validate the descriptor according to the [Profiles](https://specs.frictionlessdata.io/profiles/) specification.
:::
Expand Down
4 changes: 4 additions & 0 deletions content/docs/standard/table-dialect.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ It is not expected that all the properties are supported by all the Data Package

Table Dialect is useful for programmes which might have to deal with multiple dialects of tabular files, but which can rely on being told out-of-band which dialect will be used in a given input stream. This reduces the need for heuristic inference of dialects, and simplifies the implementation of readers, which must juggle dialect inference, schema inference, unseekable input streams, character encoding issues, and the lazy reading of very large input streams.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

:::note[Backward Compatibility]
Table Dialect supersedes [CSV Dialect](https://specs.frictionlessdata.io/csv-dialect/). Except for `caseSensitiveHeader` and `csvddfVersion` which are removed, all CSV Dialect properties are included in Table Dialect and can be used without changes.
:::
Expand Down
44 changes: 44 additions & 0 deletions content/docs/standard/table-schema.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ A root level Table Schema descriptor `MAY` have a `$schema` property that `MUST`

The default value is `https://datapackage.org/profiles/1.0/tableschema.json` and the recommended value is `https://datapackage.org/profiles/2.0/tableschema.json`.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

#### `fieldsMatch` {#fieldsMatch}

A Table Schema descriptor `MAY` contain a property `fieldsMatch` that `MUST` be a string with the following possible values and the `exact` value by default:
Expand All @@ -98,6 +102,10 @@ A Table Schema descriptor `MAY` contain a property `fieldsMatch` that `MUST` be
- **superset**: The data source `MUST` only have fields defined in the `fields` array, but `MAY` have fewer. Fields `MUST` be mapped by their names.
- **partial**: The data source `MUST` have at least one field defined in the `fields` array. Fields `MUST` be mapped by their names.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

#### `missingValues` {#missingValues}

Many datasets arrive with missing data values, either because a value was not collected or it never existed. Missing values may be indicated simply by the value being empty in other cases a special value may have been used e.g. `-`, `NaN`, `0`, `-9999` etc.
Expand Down Expand Up @@ -127,6 +135,10 @@ Examples:

When implementations choose to convert missing values to null, this conversion to `null` `MUST` be done before any other attempted type-specific string conversion. The default value `[ "" ]` means that empty strings will be converted to null before any other processing takes place. Providing the empty list `[]` means that no conversion to null will be done, on any value.

:::tip[Version Compatibility]
Extended to support labeled missingness in `v2.0`.
:::

#### `primaryKey` {#primaryKey}

A primary key is a field or set of fields that uniquely identifies each row in the table. Per SQL standards, the fields cannot be `null`, so their use in the primary key is equivalent to adding `required: true` to their [`constraints`](#constraints).
Expand Down Expand Up @@ -200,6 +212,10 @@ All the field values that are on the logical level are considered to be `null` v

In contrast with `field.constraints.unique`, `uniqueKeys` allows to define uniqueness as a combination of fields. Both properties `SHOULD` be assessed separately.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

#### `foreignKeys` {#foreignKeys}

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.
Expand Down Expand Up @@ -369,6 +385,10 @@ If `categories` is (b) an array of objects, each object `MAY` also have a `label

An `enum` constraint `MAY` be added to a field with a `categories` property, but if so, the `enum` values `MUST` be a subset of the values in `categories`.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

#### `categoriesOrdered` {#categoriesOrdered}

When the `categories` property is defined, it `MAY` be accompanied by a `categoriesOrdered` property in the field definition. When present, the `categoriesOrdered` property `MUST` be `boolean`. When `categoriesOrdered` is `true`, implementations `SHOULD` regard the order of appearance of the values in the `categories` property as their natural order. For example:
Expand All @@ -390,6 +410,10 @@ When the `categories` property is defined, it `MAY` be accompanied by a `categor

When the property `categoriesOrdered` is `false`, implementations `SHOULD` assume that the categories do not have a natural order; when the property is not present, no assumption about the ordered nature of the values `SHOULD` be made.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

#### `missingValues` {#field-missingValues}

A list of missing values for this field as per [Missing Values](#missingValues) definition. If this property is defined, it takes precedence over the schema-level property and completely replaces it for the field without combining the values.
Expand All @@ -414,6 +438,10 @@ A data consumer `MUST`:
- interpret `""` and `NA` as missing values for `column1`
- interpret only `-` as a missing value for `column2`

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

#### `rdfType` {#rdfType}

A richer, "semantic", description of the "type" of data in a given column `MAY` be provided using a `rdfType` property on a field descriptor.
Expand Down Expand Up @@ -522,6 +550,10 @@ The list field can be customised with these additional properties:
- **delimiter**: specifies the character sequence which separates lexically represented list items. If not present, the default is `,` (comma).
- **itemType**: specifies the list item type in terms of existent Table Schema types. If present, it `MUST` be one of `string`, `integer`, `boolean`, `number`, `datetme`, `date`, and `time`. If not present, the default is `string`. A data consumer `MUST` process list items as it were individual values of the corresponding data type. Note, that on lexical level only default formats are supported, for example, for a list with `itemType` set to `date`, items have to be in default form for dates i.e. `yyyy-mm-dd`.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

### `datetime`

The field contains a date with a time.
Expand Down Expand Up @@ -839,6 +871,10 @@ With this schema definition:

Will be invalid because the `price` field has a value that is too low.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

### `exclusiveMaximum` {#exclusiveMaximum}

- **Type**: integer, number, date, time, datetime, duration, year, yearmonth
Expand Down Expand Up @@ -868,6 +904,10 @@ With this schema definition:

Will be invalid because the `price` field has a value that is too high.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

### `jsonSchema` {#jsonSchema}

- **Type**: object
Expand Down Expand Up @@ -908,6 +948,10 @@ With this schema definition:

Will be invalid because the `price` field has a value that is not an integer.

:::tip[Version Compatibility]
Added to the standard in `v2.0`.
:::

### `pattern`

- **Type**: string
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"generate": "vite-node scripts/generate.ts",
"lint": "eslint . && prettier --check .",
"prepare": "husky",
"preview": "npm run build && astro preview --open --port 8080",
"start": "astro dev --open --port 8080",
"preview": "npm run build && astro preview --port 8080",
"start": "astro dev --port 8080",
"update": "ncu -u",
"test": "npm run lint",
"type": "tsc"
Expand Down