Writing descriptions
What to write in dataset, table and column descriptions and in the README, guides and documents, and how long each should be
Write what you know about a dataset in the description of the dataset, its tables and its columns, and in Markdown files. Descriptions appear as-is in lists and search results, so keep them short and put detailed explanations in Markdown. There are four kinds of Markdown: the dataset’s overview (README.md at the root), table guides (the body of each table Markdown file), schema guides (guide: under schemas in queria.yml) and documents that span tables (docs: in queria.yml).
Where to write and how long
| Where | What | Length |
|---|---|---|
Dataset description (queria.yml) |
What the data is, and its source | 1–2 sentences plus 1 sentence on the source |
Table description (front matter) |
What one row represents, and what is easy to get wrong | A 1-sentence summary, a blank line, then up to 3 caveat bullets |
Column description (front matter) |
Definition, unit, code system | About one short line |
README.md |
Source and license, table list, example SQL, caveats that span several tables | No limit |
| Schema guide | Notes on a schema and SQL that spans its tables | No limit |
| Table guide (the body of the table Markdown file) | SQL examples and caveats for one table | No limit |
Documents listed in docs: |
Guides that span schemas | No limit |
Table lists and search results show only the first paragraph of a table’s description. Write the summary sentence so a reader can decide from it whether to use the table.
description: |-
Buildings started, floor area and estimated construction cost by municipality and use (annual).
- City rows and ward rows share the same columns. Summing without filtering counts them twice.
- Suppressed values are NULL.
The rule: write it where it is true
Pick the smallest thing your sentence is true of.
| The sentence is true of | Where it goes |
|---|---|
| One column | that column’s description |
| One table | that table’s description |
| More than one table | the caveats section of README.md |
| What people call this dataset | keywords |
| Something you can run as SQL | the guide of that table or schema (Where files go) |
Once it is written in the smaller place, do not repeat it higher up. Two copies drift apart when only one gets fixed.
Fix pitfalls in the data first
Before writing a caveat, check whether the shape of the tables or columns can prevent the mistake.
- Rows of different grain in one table → split the table
- Only a 5-digit code → also provide the 6-digit local government code
- Values for different years side by side → tell them apart by column name
Keep in the description only what comes from the source data and cannot be changed, such as suppression or coverage.
What does not go in a description
- Validation numbers (“matches the national total”, “0 mismatches”): put them in dbt tests
- Full license text: use
licensesand the source and license section ofREADME.md - Processing or build steps: maintainer-only procedures go in
CONTRIBUTING.md, which is not listed indocs: - Runnable SQL: put it in a guide or a document
Dataset overview layout (README.md)
README.md appears on the dataset page. GitHub shows it at the top of the repository too. Using this order makes it read like other datasets:
# Dataset nameand 1–2 sentences on what the data is## Source and license: links to the sources and their terms of use## Tables: table name, contents and row count, linking to each table’s Markdown file## Usage: SQL examples that run as-is## Caveats: caveats that span several tables
Write the columns, grain and caveats of each table in its guide.
Where files go
A table Markdown file says which table it describes with table:, so its name and location are up to you. Keeping it next to the model that builds the table lets you edit both together. Other documents can be anywhere too; queria.yml says what is shown where.
| What you write | Describes | Shown on |
|---|---|---|
README.md |
The dataset | The dataset page |
The file named by guide: under schemas |
A schema | The schema page |
| The body of a table Markdown file | A table | The table’s “Guide” tab |
Files listed in docs: |
Content that spans schemas | The “Documents” tab (in the listed order) |
README.md # the dataset's overview
queria.yml
docs/
catalog.md # a guide that spans schemas (listed in docs:)
census.md # describes the census schema (guide: under schemas)
models/census/census_municipality.sql
models/census/census_municipality.md # describes census.census_municipality, with its guide
- The “Documents” tab is a table of contents. It lists the guides and the schemas and tables that have descriptions, and links each schema and table to its own page. Guides are listed by their first
#heading, schemas and tables by theirtitle - Do not list the columns in a table guide. Define each column in its
description; the table page shows them in the column list - Link to other Markdown files with relative paths (for example
[Population by municipality](../models/census/census_municipality.md)). The links open as written on GitHub and on Queria
Column names and titles
How to name columns and choose their title is in Dataset conventions.
keywords
keywords feeds the search index. Put in the words that classify the dataset and the other names people call it by, so someone who does not know the official name can still find it.
keywords: [statistics, population, society, e-Stat, SSDS, 政府統計]
Words specific to one table belong in that table’s own keywords, not the dataset’s.
Before you stop
- Is the first paragraph of each table description one sentence that tells a reader whether to use the table?
- Could this sentence be said about something smaller than where you put it?
- Is the same thing written in two places?
- Could the shape of a table or column prevent the mistake instead of a caveat?
- Did SQL, validation numbers or processing steps end up in a description?
- Are the other names people use in
keywords? - Is any new column an abbreviation listed in
aliasesindata_elements.csv?
