# How the files fit together — kaggle-dataset-economy-2026-12-r1 (small edition)

This guide says what one row of each file is, which column identifies it, and how files can be joined without
counting anything twice. The join figures were recomputed from the published files with a separate script
(`scripts/kaggle-economy/check_relationships.py` in the Persistfolio repository), not taken from the builder.

## The three editions

| Edition | What it holds | Can its files be joined row by row? |
|---|---|---|
| **Explorer** (small) | `data/kaggle_datasets_explorer.csv` (one row per public dataset) and the group-level tables under `research/` | No. The flat file already carries everything per dataset; the research tables are totals over groups. |
| **Research** (medium) | The normalised tables `datasets`, `publishers`, `dataset_versions`, `dataset_tags`, plus `research/` | Yes, on the keys below |
| **Complete** (large) | The Research tables plus `votes_daily`, `notebook_use` and `snapshot_totals_v2416`, in CSV and Parquet | Yes, on the keys below |

Persistfolio's Dataset Explorer opens one table at a time and does not join files. Use the Explorer edition there;
use the Research or Complete edition in pandas, R, SQL or a spreadsheet when you need joins.

## Tables: one row is…

| File | One row is | Identifying column(s) | Rows |
|---|---|---|---:|
| `datasets.csv` | one public dataset | `dataset_id` | 799,155 |
| `publishers.csv` | one owner account: an organisation, or an individual under a pseudonymous key | `publisher_key` | 287,543 |
| `dataset_versions.csv` | one version of a dataset | `version_id` | 2,028,023 |
| `dataset_tags.csv` | one tag on one dataset | `dataset_id` + `tag_id` | 596,999 |
| `votes_daily.csv` | one dataset on one day on which it received at least one dated vote | `dataset_id` + `date` | 1,898,447 |
| `notebook_use.csv` | one public notebook that used one dataset (its first use) | `dataset_id` + `notebook_id` | 1,468,786 |
| `snapshot_totals_v2416.csv` | one dataset's lifetime totals in Meta Kaggle version 2416 | `dataset_id` | 799,155 |
| `kaggle_datasets_explorer.csv` (Explorer) | one public dataset, flattened | `dataset_id` | 799,155 |

Every identifying column above is unique and never empty.

## Joins

| From (many) | To (one) | On | Unmatched rows | Notes |
|---|---|---|---:|---|
| `datasets` | `publishers` | `publisher_key` | 0 | One publisher has up to 6,936 datasets |
| `dataset_versions` | `datasets` | `dataset_id` | 0 | 678 datasets have no version row in the source |
| `dataset_tags` | `datasets` | `dataset_id` | 0 | Two thirds of datasets have no tag |
| `votes_daily` | `datasets` | `dataset_id` | 0 | 521,478 datasets have no dated vote |
| `notebook_use` | `datasets` | `dataset_id` | 0 | 527,091 datasets were never used by a public notebook |
| `snapshot_totals_v2416` | `datasets` | `dataset_id` | 0 | Exactly one row each |
| `datasets` | `dataset_versions` | `current_version_id` → `version_id` | 318, plus 413 empty | Meta Kaggle names a current version for these datasets that is not in its own `DatasetVersions.csv`. They are kept; their licence is "unknown". |

**Avoiding double counting.** Joining a dataset to its versions, tags, vote days or notebooks gives one row per
version, tag, day or notebook. Add up dataset measures such as `total_downloads` *before* such a join, or count
distinct `dataset_id`s after it. A dataset with three tags appears three times in a tag join; the topic tables in
`research/` count it once under each of its tags, and say so.

## Research tables (`research/`)

These are totals over groups, computed from the tables above. They cannot be joined back to single datasets, but
their group columns use the same codes as the row-level files:

| Group column in `research/` | Same codes as |
|---|---|
| `publisher_category`, `group`, `value` where `dimension` is `d_publisher_category` | `datasets.d_publisher_category` (Explorer: `publisher_category`) |
| `creation_year`, `cy` | the year of `datasets.created` (Explorer: `creation_year`) |
| `licence_family` | `kaggle_datasets_explorer.licence_family` |
| `tag_level2` | `dataset_tags.tag_level2` |
| `vote_year`, `month`, `date` | the date of `votes_daily.date` |

The `group` used in the voting tables is: `KAGGLE_ORGANISATION` (category `KAGGLE`), `ORGANISATION_LABELLED`
(an organisation with a verified category), `ORGANISATION_UNKNOWN` (an organisation whose category could not be
verified), `INDIVIDUAL_STAFF_TIER` (an individual whose current Kaggle tier is staff) and `INDIVIDUAL` (everyone else).

## Definitions that are easy to get wrong

- **First-year counts** (`d_votes_365_*`, `votes_first_year*`, `d_notebooks_365`) count events dated on or before day 365 after the creation date. Compare them only where `d_observed_365` / `observed_365` says the dataset was at least 365 days old on 2 December 2026.
- **Newcomer datasets** (`d_newcomer`, `newcomer`): an individual account's first surviving public dataset, created 0 to 90 days after the account registered. "First" means the earliest creation time; datasets created in the same second are ordered by dataset id.
- **High-volume votes** (`votes_flagged_t20/t50/t100`) are votes cast on a day when the same account cast at least 20, 50 or 100 votes. Thresholds are nested: every V-100 vote is also a V-50 and a V-20 vote. They describe how votes arrive, not why.
- **Lifetime totals** (`total_views`, `total_downloads`, `total_votes`, `total_kernels`) are Kaggle's counters at the snapshot. `total_votes` is not always the sum of `votes_daily`: they agree for 791,910 datasets, Kaggle's total is higher for 7,216 and lower for 29. Meta Kaggle does not explain the difference.
- **Source rows left out**: two dataset versions whose dataset is not in Meta Kaggle's `Datasets.csv`, and 150 notebook-to-dataset links that cite versions missing from `DatasetVersions.csv`. Nothing else was dropped.
