-
Notifications
You must be signed in to change notification settings - Fork 7
Add documentation of sample data structure #100
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
Changes from all commits
a24f119
74b02d9
9db30a9
7fdddfe
dba9e26
eaa009a
af15c9a
c0acbd1
bcc5a0f
3532b15
53a05b9
3aadfea
9661da0
5332619
e05cd3c
053e986
7981308
b6c52e5
20b1a97
36bb261
67015af
be1d112
e64f03d
3f1a357
a8565b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,13 @@ | ||
| .DS_Store* | ||
| .vscode* | ||
| /__pycache__/* | ||
| .env | ||
| /venv* | ||
| /site | ||
| /__pycache__ | ||
| /site/* | ||
| # pages that are copied in from main repo | ||
| /docs/CONTRIBUTING.md | ||
| /docs/CODE_OF_CONDUCT.md | ||
| /docs/README.md | ||
| # pages that are generated from templates | ||
| /docs/tables.md | ||
| /docs/architecture.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| {{ include_file('README.md', downshift_h1= False) }} | ||
| # TIDES Transit Specification Suite | ||
|
|
||
| {{ include_file('README.md', start_line = 2, downshift_h1= False) }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Sample Data | ||
|
|
||
| Sample data can be found in the `/samples` directory, with one directory for each data sample. | ||
|
|
||
| {{ include_file('samples/README.md')}} | ||
|
|
||
| ## Data List | ||
|
|
||
| {{ list_samples('samples') }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| # Data Directory Organization | ||
|
|
||
| Each TIDES Data Package example should follow the following directory structure, consistent with the structure of the [Frictionless Data Package specification](https://specs.frictionlessdata.io/data-package/), including: | ||
|
|
||
| ``` | ||
| unique-example-name | ||
| \TIDES # Required. Data to be validated against the TIDES specification | ||
| \datapackage.json # Required. Data package metadata per https://specs.frictionlessdata.io/data-package/ | ||
| \raw # Optional. Data which the agency uses to create TIDES data | ||
| \scripts # Optional. Scripts used to transform raw --> TIDES | ||
| ``` | ||
|
|
||
| ## Adding Examples | ||
|
|
||
| We encourage the addition of examples, but please follow the following guidelines: | ||
|
|
||
| 1. *No large files* This isn't the place to store your data, rather to document some minimal examples. The recommended size is 100-1000 records per file, more if absolutely required to reproduce an issue with the spec. The whole data package should be well under 50 MB. | ||
| 2. *Include Metadata* as specified in [`datapackage.json`](#data-package). | ||
| 3. *Include a README.md* in the base folder of your example with an overview so that it can be included in the documentation. | ||
|
|
||
| ## Data Package | ||
|
|
||
| TIDES data packages must include a [`datapackage.json`](https://specs.frictionlessdata.io/data-package/). Key information to include in [`datapackage.json`](https://specs.frictionlessdata.io/data-package/) includes: | ||
|
|
||
| | **Field** | **Description** | **Required** | | ||
| | --------- | --------------- | ------------ | | ||
| | `title` | A human-readable title. | Required | | ||
| | `name` | Short [sluggable](https://en.wikipedia.org/wiki/Clean_URL#Slug) identifier string. | Recommended | | ||
| | `description` | Short description of data package. | Recommended | | ||
| | `agency` | Transit agency name. | Recommended | | ||
| | `ntd_id` | ID for the National Transit Database. | Recommended | | ||
| | `profile` | Should be `tabular-data-package` | Required | | ||
| | `licenses` | Should be `[{"name": "Apache-2.0"}]` to be consistent with this repository | Required | | ||
| | `contributors` | Array of data contributors `[{"title": "My Name", "github": "my_handle", "email": "me@myself.com"}]` | Recommended | | ||
| | `maintainers` | Array of data maintainers `[{"title": "My Name", "github": "my_handle", "email": "me@myself.com"}]` | Recommended | | ||
| | `sources` | Array of data sources formatted as a [`source`](#data-source). Recommended to be documented *either* here at the top-level or for each individual `resource`. | Recommended | | ||
| | `resources` | Array of data files included in your package, formated as a [`tabular-data-resource`](#data-resource)| Required | | ||
|
|
||
| ### Data Resource | ||
|
|
||
| Key fields for each [`tabular-data-resource`](https://specs.frictionlessdata.io/tabular-data-resource/) are as follows: | ||
|
|
||
| | **Field** | **Description** | **Required** | | ||
| | --------- | --------------- | ------------ | | ||
| | `name` | Short [sluggable](https://en.wikipedia.org/wiki/Clean_URL#Slug) identifier string used to refer to data in this file. `name` must be unique within this datapackage. | Required | | ||
| | `path` | Path of the data resource file relative to the `datapackage.json` | Required | | ||
| | `schema` | Data schema to use to valdiate the data resource to | Required | | ||
| | `sources` | Array of data sources formatted as a [`source`](#data-source). Recommended to be documented *either* here for each individual `resource` or at the top-level. | Recommended | | ||
|
|
||
| ### Data Source | ||
|
|
||
| | **Field** | **Description** | **Required** | | ||
| | --------- | --------------- | ------------ | | ||
| | `title` | Description of the data source. | Required | | ||
| | `component` | What technology component was used to generate this data (directly or indirectly)? Examples include `AVL`, `APC`, `AFC`, etc. | Recommended | | ||
| | `product` | What product was used to generate this data (directly or indirectly)? | Recommended | | ||
|
e-lo marked this conversation as resolved.
|
||
| | `product_version` | Describe the version of the product was used. | Optional | | ||
| | `vendor` | What company makes this product? | Recommended | | ||
|
|
||
| ## Data validation | ||
|
|
||
| Data with a valid [`datapackage.json`](#data-package) can be easily validated using the [frictionless framework](https://framework.frictionlessdata.io/), which can be installed and invoked as follows: | ||
|
|
||
| ```bash | ||
| pip install frictionless | ||
| frictionless validate path/to/your/datapackage.json | ||
| ``` | ||
|
Comment on lines
+64
to
+67
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. again, when I run this it seems to only validate the datapackage.json file, not the datapackage itself? Or maybe it's just because I'm getting a nonsense error,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahhh - i thought you were talking before about it SHOULD only validate the datapackage file and not the resourcs. Will investigate. |
||
|
|
||
| ### Specific files | ||
|
|
||
| Specific files can be validated by running the frictionless framework against them and their corresponding schemas as follows: | ||
|
|
||
| ```sh | ||
| frictionless validate vehicles.csv --schema https://raw.githubusercontent.com/TIDES-transit/TIDES/main/spec/vehicles.schema.json --schema-sync | ||
| ``` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this just validates the datapackage.json file, not the contents of the datapackage?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Investigating...