---
title: Publish data
description: How to get your own data into Queria's catalog, and how to write the metadata files
---

How to get your own data into Queria's catalog. It takes two things: **the data itself**, and **metadata files describing what it is**.

## What you need to produce

Queria serves datasets in the [FDL](https://fdl.queria.io) format: a DuckLake catalog frozen into one version per update. You build and publish them with the `fdl` command. **Getting your data into DuckLake tables is the build's job** — dropping a file somewhere does not publish it.

The tool is your choice; anything that writes DuckLake from DuckDB works. So is the input format, as long as DuckDB can read it (CSV, Parquet, JSON, Excel, whatever you fetched from an API).

## The loop

```bash
uvx queria login                       # authenticate; fdl uses the same token
uvx queria dataset create my-dataset --public  # register the dataset (private if omitted)
# write tabledoc.yml and a <table>.tabledoc.yml per table
uvx --from fdl-cli fdl clone https://data.queria.io/datasets/<handle>/my-dataset/ .fdl/work.sqlite
# run your build, writing into the working catalog
uvx tabledoc load --ducklake .fdl/work.sqlite --out build/assets   # check, then write the working catalog and build/assets/
uvx --from fdl-cli fdl commit .fdl/work.sqlite --assets build/assets -m "First version" --author <name>
uvx --from fdl-cli fdl push .fdl/work.sqlite
```

The first time you run `uvx queria login`, you choose a [handle](/en/login) in the browser. Your datasets belong to that handle and are published at `queria.io/datasets/<handle>/<dataset name>`.

Creating a dataset (`queria dataset create`) and publishing it (`fdl push`) need a token with "Allow modifying datasets and reports" turned on. The `queria login` approval page turns it on by default, so there is nothing to set up from your own machine. To publish from CI, create a token with the option turned on at the [API tokens page](https://queria.io/settings/tokens) and pass it to fdl with the `FDL_TOKEN` environment variable. To publish an organization's dataset from GitHub Actions without storing a token, use a [GitHub Actions registration](/en/authentication#github-actions). See [Authentication](/en/authentication) for details.

If you belong to an organization account, `--owner` says where to create the dataset. Without it, the dataset belongs to your own handle. To keep publishing as the organization, use an [organization service token](/en/authentication), which an admin creates at `queria.io/accounts/<org handle>/settings/tokens` — it keeps working after the person who created it leaves.

```bash
uvx queria dataset create my-dataset --owner my-org
```

When the same dataset name exists in more than one of your accounts, `queria dataset edit` and `queria dataset delete` stop rather than guess which one you meant. Give the name as `<handle>/<dataset name>` instead.

### From build to publish

`fdl clone` copies the catalog of the version published now into a working catalog on your disk (DuckLake in SQLite). The first time, it makes an empty one. Open the working catalog with the `ATTACH` statement it prints and write your tables into it. New data files go to `.fdl/work.sqlite.fdl/data/`, next to the working catalog, and `fdl push` uploads them.

```sql
ATTACH 'ducklake:.fdl/work.sqlite' AS lake (DATA_PATH '…', OVERRIDE_DATA_PATH true, META_TYPE 'sqlite', DATA_INLINING_ROW_LIMIT 0);
CREATE OR REPLACE TABLE lake.main.towns AS SELECT * FROM 'towns.csv';
```

`tabledoc load` from [tabledoc](https://github.com/queria-io/tabledoc) checks the metadata files, then writes the description into the tables of the `_tabledoc` schema in the working catalog, so it goes into the same version as the data. It also writes `README.md`, the table guides and other files into the folder you give with `--out`, outside `.fdl/`. `fdl commit` makes a new version from the working catalog and that folder (`--assets`), and `fdl push` uploads it and publishes it. Queria checks the metadata when it receives the push, and serves the version if it passes.

Point it at the working catalog with `--ducklake` or the `FDL_WORKING` environment variable. A table or column that is described but not in the working catalog is an error. When you build with dbt, it takes each table's SQL and dependencies from `target/manifest.json` into the tables of the `_tabledoc` schema. To check the files only, use `tabledoc validate`.

```bash
uvx tabledoc validate           # check the metadata files
uvx tabledoc validate --strict  # fail on warnings too (for CI)
```

## The metadata files

Metadata is written in the [tabledoc](https://tabledoc.queria.io) format: one `tabledoc.yml` for the dataset, and one `<table>.tabledoc.yml` per table. Both start with `$schema`, which names the format and its version. An editor that reads the JSON Schema at `$schema` can complete and check the keys.

| File | Content |
|---|---|
| `tabledoc.yml` (repository root) | the dataset as a whole |
| `<schema>/<table>.tabledoc.yml` | the table and its columns |
| `<schema>/<table>.md` (optional) | the table's guide |

```yaml
# tabledoc.yml
$schema: https://tabledoc.queria.io/schemas/dataset/v1.json
name: calendar
title: Japanese calendar
title_reading: ニホンノコヨミデータ  # optional: kana reading of the Japanese title (日本の暦データ)
issued: 2024-04-01               # optional: first published
description: A date spine from 1955 to 2027 with holidays, weekdays and Japanese eras.
language: ja
licenses: [CC-BY-4.0]
contributors:
  - id: cao                # short and fixed, unique in the dataset
    title: Cabinet Office
    roles: [rightsHolder]
  - id: queria
    title: Queria
    roles: [publisher]  # the provider: who publishes this dataset
spatial_coverage: [JP]  # country codes, or 6-digit local government codes with the check digit, quoted as in "131202"
```

```yaml
# calendar/day.tabledoc.yml
$schema: https://tabledoc.queria.io/schemas/table/v1.json
title: Japanese calendar
description: One row per day, with holidays, weekdays, Japanese eras and fiscal years.
primary_key: [date]
columns:
  - name: date
    title: Date
```

```markdown
<!-- calendar/day.md -->
Holidays follow the Cabinet Office's list of national holidays.
```

The file's name and place say which table it describes: `calendar/day.tabledoc.yml` describes `calendar.day`. `day.md` with the same name is shown on the table's "Guide" tab.

**Do not write column types.** Types, column order and nullability are read from your data, so they cannot drift from it.

Licenses, sources and contributors each get an `id`. A table file can refer to a source of the dataset by its `id` alone, as in `sources: [<id>]`. Every key goes into the tables of the catalog's `_tabledoc` schema.

### When you build with dbt

Put the table file and the guide next to the model's `.sql`, named `<model>.tabledoc.yml` and `<model>.md`. The model's `schema` and `alias` say which table they describe.

```
models/calendar/day.sql
models/calendar/day.tabledoc.yml
models/calendar/day.md
```

dbt reads every yml in the model folders, so list `*.tabledoc.yml` in `.dbtignore`. Without it, `tabledoc load` gives an error.

Keep dbt's yml to what the build needs, such as tests. tabledoc also reads `description` and `config.meta` in dbt's yml, but the same key in both dbt's yml and the table file is an error. With each table described in one file, the file name tells you which table a description is for.

### README and documents

`README.md` at the repository root is the dataset's overview and is shown on the dataset page. GitHub shows it at the top of the repository too. List other documents by path under `documents:` of the dataset, a schema or a table. A document named `README.md` describes what it is listed under and is shown on its page. Keep the files anywhere you like: in the version, tabledoc places them in the folder of what they describe ([Where files go](/en/publish/writing-descriptions#where-files-go)).

```yaml
# tabledoc.yml
schemas:
  - name: census
    title: Census
    documents: [docs/census/README.md]   # shown on the schema's page
documents: [docs/catalog.md]             # shown as a document of the dataset
```

Relative links between these Markdown files work on GitHub and on Queria. tabledoc rewrites the links to files that move in the version.

### Declare the primary key

Write what identifies one row in `primary_key`: one column name, or a list such as `[local_government_code, year]` when it takes several columns.

A primary key column that is not in the working catalog is an error. Check that the values are unique and never NULL with dbt tests (`unique` and `not_null`). When you build with dbt, a primary key in `constraints` (`type: primary_key`) in dbt's yml is read too.

### Declare identifiers

Declaring with a column's `entity` what identifies a table's rows lets [search](/en/search#find-tables-by-their-columns) find the table through its identifiers, and through column conditions that name the key. Give the same key only to columns that can be matched against each other, across datasets too.

```yaml
columns:
  - name: local_government_code
    title: Local government code
    entity: { type: foreign, name: city }
```

Write `type` as `primary` when the column alone is the table's primary key, else `foreign`.

These are the keys `name` takes. Columns that can be matched after a conversion, such as 5-digit and 6-digit (with check digit) local government codes, get the same key.

| Key | Unit | Examples |
| --- | --- | --- |
| `prefecture` | Prefecture | Prefecture code, prefecture name |
| `city` | Municipality | Local government code, municipality name |
| `small_area` | Small area (chō-chōme / aza) | Census small area code (KEY_CODE), town block name |
| `town` | Town (machiaza) | Address Base Registry town ID (unique together with the local government code) |
| `mesh` | Grid square | Standard grid square (mesh) code |
| `corporate_number` | Corporation | 13-digit corporate number |
| `postal_code` | Postal code area | 7-digit postal code |

Queria refuses a push with a key outside this list. The list of keys comes from `entities.csv` in the vocabulary [queria-io/vocabulary](https://github.com/queria-io/vocabulary).

### Coverage

When a published table has a `city`, `small_area` or `prefecture` identifier, Queria reads the data when you publish and writes the areas the table covers to `spatial_coverage`. The table is then found when someone [searches by place name](/en/search#search-by-place-name) for a place it covers.

- Up to 100 municipalities are listed by their local government codes (6 digits with the check digit)
- More than that are listed by prefecture
- All 47 prefectures with nearly every municipality (1,500 or more) become `JP`

Only values made of digits are read, so a column holding only municipality names cannot give a coverage. Nor can a table with more than 10 million rows whose identifier holds more than 2,000 distinct values, such as nationwide small areas. When the worked-out coverage is wrong, or the table has only latitude and longitude, write `spatial_coverage` in the table file (a written value wins) or on the dataset. A table without its own coverage takes the dataset's.

```yaml
spatial_coverage: ["082201"]  # a table that holds Tsukuba only
```

### Period

When a published table has a column saying when each row's numbers are from, Queria reads the data when you publish and writes the first and last periods to `temporal_coverage`. The table is then found when the MCP server's `search_catalog` is given a year it covers.

The column is chosen by name: only the first of these, in this order, that the table has is read (when it gives no period, the later ones are not tried): `year`, `fiscal_year`, `survey_year`, `data_year` (year); `year_month`, `survey_month` (month); `date`, `survey_date`, `observed_date`, `measured_on`, `reference_date`, `as_of_date` (day). Values are written as fine as the column: `2020`, `2020-04` or `2020-04-01`. A year column is read only for 4-digit numbers, so a column of Japanese era years cannot give a period.

Dates about the row's subject, such as a permit date or an opening date, are not read as a period. When there is no column to read, or the worked-out period is wrong, write `temporal_coverage` in the table file (a written value wins). A table without its own period takes the dataset's `temporal_coverage`.

```yaml
temporal_coverage: { start: "2015", end: "2020" }  # a table holding 2015 to 2020
```

## What happens when you make it public

A dataset is either public or private. While it is private, only you (and members of your organization) and the people you share it with can see it ([share a dataset](/en/account#share-a-dataset)). Admins can also limit an organization's dataset to specific members and teams ([who can access an organization's datasets](/en/account#who-can-access-an-organizations-datasets)). A free account can keep up to 5 GB of private datasets in total ([Limits](/en/limits#storage)). To switch:

```bash
uvx queria dataset create my-dataset --public      # decide at creation
uvx queria dataset edit my-dataset --public        # change it later
```

Once public, it appears in these places.

| Where | What is shown |
| --- | --- |
| [Dataset list](https://queria.io/datasets) | A card with the title, description, tags and table count |
| Table search on that list | Table and column names, titles and descriptions |
| The dataset page | Tables, columns, SQL definitions, lineage and history |
| sitemap.xml and llms.txt | URLs of the dataset and its tables |

**Your handle is shown everywhere.** Cards in the list and the dataset page both render it as `<handle> / <dataset>`, so readers always know who published the data.

Search engines may crawl these pages. **Making the dataset private again stops it from being listed on Queria, but removal from search engine indexes takes time.**

A change to the visibility setting **takes up to 60 seconds to reach data delivery.** For those 60 seconds after you switch back to private, anyone who already knew the delivery URL may still be able to read the data.

## What trips people up

**Licenses are never guessed.** An id in the registry can be written as is. You may omit them, but then you reserve every right and what others may do with the data is left to Queria's terms of use.

For a license that is not in the registry, or data that comes only with the distributor's terms of use and no named license, write `id: other` with the terms. The dataset page shows `title` as the license, linked to `url` when you give one. Queria refuses a push when `commercial_use` or `url` is missing.

```yaml
licenses:
  - id: other
    title: State that the distributor's API was used and link to the distributor (terms of use)
    url: https://example.go.jp/terms
    commercial_use: true         # whether commercial use and redistribution are allowed; data with false cannot be published
    attribution_required: true   # whether attribution is required
```

**Small tables may produce no parquet at all.** DuckLake inlines values into the catalog below a row threshold, so a dataset can end up with no data files. Set `DATA_INLINING_ROW_LIMIT` to 0, as in the `ATTACH` statement `fdl clone` prints. `fdl commit` stops while inlined rows remain.

**A push goes only on top of the version published now.** If someone else pushed after your `fdl clone`, `fdl push` is refused. Start again from `fdl clone`.

## Deciding what to write

How to name tables and columns, which types to use, the grain and the keys are in [Dataset conventions](/en/publish/conventions); which layer each sentence belongs to is in [Writing descriptions](/en/publish/writing-descriptions).

## Letting an agent do it

Both the publishing steps and the writing conventions ship as agent skills. See [Queria skill](/en/queria-skill) for installation.

- `queria-publish-dataset` — register, build and publish
- `queria-describe-dataset` — what to write where
