Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix schema.fieldsMatch #975

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
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
8 changes: 8 additions & 0 deletions content/docs/overview/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ sidebar:

This document includes all meaningful changes made to the **Data Package standard**. It does not cover changes made to other documents like Recipes or Guides.

## v2.1

> Sep 17, 2024
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To update: release should be approved by WG.


##### `schema.fieldsMatch` (fixed)

The `schema.fieldsMatch` property definition has been fixed in the Table Schema profile ([#965](https://github.com/frictionlessdata/datapackage/issues/965)).

## v2.0

> June 26, 2024
Expand Down
4 changes: 2 additions & 2 deletions content/docs/standard/data-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sidebar:
</tr>
<tr>
<th>Profile</th>
<td><a href="/profiles/2.0/datapackage.json">https://datapackage.org/profiles/2.0/datapackage.json</a></td>
<td><a href="/profiles/2.1/datapackage.json">https://datapackage.org/profiles/2.1/datapackage.json</a></td>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to make this table a Markdown table (assuming it is supported by the static website generator). That way the profile can just be referenced as:

<https://datapackage.org/profiles/2.1/datapackage.json>

Guaranteeing there is no discrepancy between the displayed URL and link

</tr>
</table>

Expand Down Expand Up @@ -119,7 +119,7 @@ Packaged data resources are described in the `resources` property of the package

A root level Data Package descriptor `MAY` have a `$schema` property that `MUST` be a profile as per [Profile](/standard/glossary/#profile) definition that `MUST` include all the metadata constraints required by this specification.

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`.
The default value is `https://datapackage.org/profiles/1.0/datapackage.json` and the recommended value is `https://datapackage.org/profiles/2.1/datapackage.json`.

:::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: 2 additions & 2 deletions content/docs/standard/data-resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sidebar:
</tr>
<tr>
<th>Profile</th>
<td><a href="/profiles/2.0/dataresource.json">https://datapackage.org/profiles/2.0/dataresource.json</a></td>
<td><a href="/profiles/2.1/dataresource.json">https://datapackage.org/profiles/2.1/dataresource.json</a></td>
</tr>
</table>

Expand Down Expand Up @@ -149,7 +149,7 @@ If a resource has `profile` property that equals to `tabular-data-resource` or `

A root level Data Resource descriptor `MAY` have a `$schema` property that `MUST` be a profile as per [Profile](/standard/glossary/#profile) definition that `MUST` include all the metadata constraints required by this specification.

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`.
The default value is `https://datapackage.org/profiles/1.0/dataresource.json` and the recommended value is `https://datapackage.org/profiles/2.1/dataresource.json`.

:::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: 2 additions & 2 deletions content/docs/standard/table-dialect.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sidebar:
</tr>
<tr>
<th>Profile</th>
<td><a href="/profiles/2.0/tabledialect.json">https://datapackage.org/profiles/2.0/tabledialect.json</a></td>
<td><a href="/profiles/2.1/tabledialect.json">https://datapackage.org/profiles/2.1/tabledialect.json</a></td>
</tr>
</table>

Expand Down Expand Up @@ -137,7 +137,7 @@ Database formats is a group of formats accessing data from databases like SQLite

A root level Table Dialect descriptor `MAY` have a `$schema` property that `MUST` be a profile as per [Profile](/standard/glossary/#profile) definition that `MUST` include all the metadata constraints required by this specification.

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

### `header`

Expand Down
4 changes: 2 additions & 2 deletions content/docs/standard/table-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sidebar:
</tr>
<tr>
<th>Profile</th>
<td><a href="/profiles/2.0/tableschema.json">https://datapackage.org/profiles/2.0/tableschema.json</a></td>
<td><a href="/profiles/2.1/tableschema.json">https://datapackage.org/profiles/2.1/tableschema.json</a></td>
</tr>
</table>

Expand Down Expand Up @@ -73,7 +73,7 @@ The way Table Schema `fields` are mapped onto the data source fields are defined

A root level Table Schema descriptor `MAY` have a `$schema` property that `MUST` be a profile as per [Profile](/standard/glossary/#profile) definition that `MUST` include all the metadata constraints required by this specification.

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`.
The default value is `https://datapackage.org/profiles/1.0/tableschema.json` and the recommended value is `https://datapackage.org/profiles/2.1/tableschema.json`.

#### `fieldsMatch` {#fieldsMatch}

Expand Down
157 changes: 152 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "datapackage.org",
"type": "module",
"version": "2.0-draft",
"version": "2.1",
"engines": {
"node": "^20.0.0",
"npm": "^10.0.0"
Expand All @@ -22,6 +22,7 @@
"@apidevtools/json-schema-ref-parser": "^11.6.4",
"@astrojs/markdown-remark": "^5.1.1",
"@astrojs/starlight": "^0.24.4",
"@npmcli/package-json": "^5.2.0",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
Expand Down
3 changes: 2 additions & 1 deletion profiles/build.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import JsonSchema from "@apidevtools/json-schema-ref-parser"
import { readPackage } from "@npmcli/package-json/lib/read-package.js"
import fs from "fs-extra"
import { glob } from "glob"
import yaml from "js-yaml"
import nodePath from "path"
import process from "process"

const VERSION = "2.0"
const VERSION = (await readPackage("./package.json")).version
const SOURCE_DIR = "profiles/source"
const TARGET_DIR = `profiles/target`
const VERSION_DIR = `${TARGET_DIR}/${VERSION}`
Expand Down
18 changes: 8 additions & 10 deletions profiles/source/dictionary/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,14 @@ tableSchemaField:
- "$ref": "#/definitions/tableSchemaFieldDuration"
- "$ref": "#/definitions/tableSchemaFieldAny"
tableSchemaFieldsMatch:
type: array
item:
type: string
enum:
- exact
- equal
- subset
- superset
- partial
default: exact
type: string
enum:
- exact
- equal
- subset
- superset
- partial
default: exact
tableSchemaPrimaryKey:
oneOf:
- type: array
Expand Down
Loading