# prefecture-series / comparison-stats / 都道府県系列 比較統計

This dataset stores prefecture-level cross-election comparison rows as selector-oriented derived extraction CSV.  
この dataset は、都道府県単位の選挙間比較 row を selector-oriented な derived extraction CSV として保存します。

## Boundary / 境界

- this is not canonical fact storage  
  これは canonical fact storage ではありません
- source of truth remains Layer 2 release facts and release manifests  
  正本は Layer 2 release facts と release manifests に残ります
- this dataset is a deterministic comparison extraction for fixed election-set pairs  
  この dataset は固定の election-set pair に対する deterministic な比較抽出です
- this dataset is not a map payload and not a graph payload  
  この dataset は map payload でも graph payload でもありません

## Selector and row grain / selector と row grain

- family: `prefecture-series`
- dataset: `comparison-stats`
- primary selector field: `prefecture_code`
- selector shard directory: `by-prefecture`
- row grain: `comparison_key x prefecture_code x component_family`

## Files in this directory / このディレクトリのファイル

- `current.yaml`: contract and latest metadata for this dataset  
  この dataset の contract と latest metadata
- `latest/nationwide.csv`: stable convenience table for the whole dataset  
  dataset 全体の stable convenience table
- `latest/by-prefecture/<prefecture_code>.csv`: one selector shard  
  1 selector 分の shard CSV
- `releases/<source_release_version>/...`: release-scoped materialization snapshot  
  release 単位の materialization snapshot

## `current.yaml` keys / `current.yaml` の主要キー

| key | meaning / 意味 |
|---|---|
| `dataset_id` | fixed dataset contract id / 固定の dataset 契約 ID |
| `family` | extraction family name / extraction family 名 |
| `dataset` | dataset name within the family / family 内 dataset 名 |
| `source_release_version` | Layer 2 release version used to build this snapshot / この snapshot の build 元になった Layer 2 release version |
| `source_layer` | upstream layer authority / 上流 authority layer |
| `primary_selector_field` | shard key field / shard の主キー列 |
| `primary_selector_index_dir` | directory name used for shard files / shard ファイルに使う directory 名 |
| `row_grain` | one-row meaning / 1 row の意味 |
| `built_at` | UTC build timestamp / UTC build 時刻 |
| `notes` | dataset-specific contract note / dataset 固有の契約メモ |
| `source_election_set_keys` | election sets included in the build / build に含めた election set 一覧 |
| `files` | latest/release nationwide artifact metadata / latest/release artifact metadata |
| `summary` | selector count and shard summary / selector 件数と shard 要約 |

## CSV columns / CSV 列定義

| column | meaning / 意味 |
|---|---|
| `comparison_key` | fixed comparison id such as `20250720_hc__20260208_hr` / `20250720_hc__20260208_hr` のような比較 ID |
| `baseline_election_set_key` | baseline election-set id / 比較元 election-set id |
| `baseline_election_date` | baseline election date / 比較元の election date |
| `baseline_election_type` | baseline election type / 比較元の election type |
| `baseline_vote_system` | baseline vote system / 比較元の vote system |
| `target_election_set_key` | target election-set id / 比較先 election-set id |
| `target_election_date` | target election date / 比較先の election date |
| `target_election_type` | target election type / 比較先の election type |
| `target_vote_system` | target vote system / 比較先の vote system |
| `component_family` | semantic component family: `constituency` or `proportional` / `constituency` または `proportional` の semantic family |
| `prefecture_code` | two-digit prefecture code / 2 桁の prefecture code |
| `prefecture_name` | prefecture display name / prefecture の表示名 |
| `baseline_*` | baseline-side raw metric values / 比較元の raw metric 値 |
| `target_*` | target-side raw metric values / 比較先の raw metric 値 |
| `*_delta` | target minus baseline in raw units / raw 単位での target - baseline |
| `*_change_rate_pct` | relative change rate in percent / 相対増減率 |
| `*_delta_pct_pt` | percentage-point delta for rate metrics / 率指標のポイント差 |

## Notes / 注意

- this dataset performs explicit component-family alignment  
  この dataset は explicit な component-family alignment を行います
- `hc:multi` and `hr:smd` map to `constituency`; `hc:pr` and `hr:block` map to `proportional`  
  `hc:multi` と `hr:smd` は `constituency` に、`hc:pr` と `hr:block` は `proportional` に対応します
- comparisons stay sparse if either side is missing; the builder does not infer continuity or fill blanks  
  片側が欠ける場合は sparse のままとし、builder は continuity 推論や補完をしません
