Code-Driven Manifesto: Auditing Japan’s Public Data Stack

IT Policy Proposals
Code-Driven Manifesto: Auditing Japan’s Public Data Stack

どうも〜おかむーです!今日はちょっとエンジニアっぽい話をしますよ〜

  • Government publishes lots of data but formats and APIs are inconsistent.
  • Key grant programs (Digital Den-en-toshi) report KPIs often in PDFs, not machine-readable formats.
  • With modest engineering fixes – cataloging, APIs, schemas, validation – reuse and impact jump dramatically.

結論

Japan has the building blocks (Digital Agency, e-Gov APIs, municipal open data portals like Tokyo/Saitama, RAIDA coordination), but the implementation is patchy: too many PDFs, mixed formats, and inconsistent schemas. エンジニア的に言うと、standard API + versioned machine-readable datasets + automated validation pipelinesを整備すれば、透明性と利活用が一気に上がるんですよね。

Report: what I looked at and what's wrong

Sources reviewed: Digital Agency (digital.go.jp), e-Gov API catalog (api-catalog.e-gov.go.jp / api-catalog.e-gov.go.jp/info), RAIDA (raida.go.jp), Tokyo Open Data Catalog (catalog.data.metro.tokyo.lg.jp), Saitama/Niigata portals, BODIK aggregator (bodik.jp), and an example prefectural grant report PDF (pref.yamaguchi.lg.jp upload).

Problems spotted:

  • PDF-first reporting: grant KPIs and performance often land in PDF reports (see Yamaguchi example), which blocks programmatic monitoring.
  • Fragmented APIs: e-Gov catalog exists but adoption and standard data models vary across ministries and municipalities.
  • Format variety: CSV, XLSX, PDF, GeoJSON mixed without consistent metadata (license, schema, update cadence).
  • KPI gaps: published targets vs reported achievements are not published as linked time-series datasets, making trend analysis manual and error-prone.

Technical implications (why this matters):

  • Machine-readability: PDFs need OCR/table extraction (tabula, Camelot) which is brittle.
  • Integration overhead: Developers waste time normalizing schemas instead of building services.
  • Monitoring impossible: No single source of truth for KPI time-series means delayed policy adjustments.

Concrete engineering checks and quick wins

1) Inventory + cataloging

  • Ensure every dataset in portals (Tokyo, Saitama) has DCAT metadata (title, description, tags, license, schema, update frequency).
  • RAIDA can act as a federated index for grant datasets.

2) API-first & schema stability

  • Publish KPI time-series as JSON/CSV via APIs. Use OpenAPI + JSON Schema to lock contracts.
  • Example: Digital grant KPI endpoint: /api/v1/grants/{grant_id}/kpis?from=YYYY-MM-DD&to=YYYY-MM-DD

3) Validation and ETL

  • Use Great Expectations or custom validators to assert types, ranges, and required fields on ingestion.
  • Automate PDF→CSV pipelines only as a stopgap; prefer upstream CSV/JSON publishing.

4) Versioning & provenance

  • Version datasets with semantic versioning and expose provenance fields (creator, source_url, generated_at).

5) Aggregation layer

  • Build a small aggregator (could be BODIK-like) that normalizes municipal schema to a canonical model for cross-jurisdiction analysis.

Example: fetch + validate a municipal CSV (Python)

import requests

import pandas as pd

from jsonschema import validate

url = 'https://catalog.data.metro.tokyo.lg.jp/dataset/xxx/resource/yyy/download/sample.csv'

df = pd.read_csv(url)

quick schema

schema = {

'type': 'object',

'properties': {

'date': {'type': 'string', 'format': 'date'},

'kpi_value': {'type': 'number'}

},

'required': ['date','kpi_value']

}

validate first row

validate(instance=df.iloc[0].to_dict(), schema=schema)

要するに、API一本とスキーマバリデーションがあれば、PDFの山に悩まされる必要はなくなるということです。

Policy vs Reality: KPI mismatch

The Digital Den-en-toshi grant guidance (see RAIDA and chiso guidelines) defines KPIs, but many prefectural reports publish aggregated achievements in PDFs (Yamaguchi example) rather than time-series datasets. That means central monitoring teams and civil society can't run continuous checks for underperformance — decisions are slower and less evidence-driven.

Roadmap for implementation (practical steps)

  • Mandate machine-readable KPI reporting for all grant recipients (CSV/JSON + API endpoint).
  • Provide an open-source reference implementation: small Dockerized service that municipalities can deploy to expose datasets with built-in schema and OpenAPI.
  • Central federated index (RAIDA-like) harvests endpoints and shows compliance dashboards.
  • Funding tied to compliance: part of grant disbursement conditioned on publishing required datasets.

まとめ

This is not a technology fantasy — Japan already has e-Gov APIs, city portals, and aggregators like BODIK. The remaining work is standardization, validation, and a bit of developer-friendly tooling. Fix those and transparency + reuse skyrocket.

おかむーから一言

Tech + policyって最強です!エンジニア目線で小さな改善を積み重ねれば、行政サービスはもっと速く、もっと優しくなる。やりましょう!