Skip to content

Add Eurostat COFOG adapter and Irish budget pilot - #6

Merged
lukefretwell merged 1 commit into
mainfrom
eurostat-adapter
Sep 7, 2026
Merged

lukefretwell merged 1 commit into
mainfrom
eurostat-adapter

Conversation

@lukefretwell

Copy link
Copy Markdown
Member

Eurostat publishes general government expenditure by function for every EU member state using COFOG - the classification the budget profile adopted, maintained by the authority that defines it. That makes it the most direct test available of whether the profile holds real fiscal data from outside the US.

Ireland 2022: 79 budget lines across 10 COFOG divisions.

One defect, the same shape as the areaServed finding from UK Contracts Finder. The budget arithmetic check demanded exact equality between a parent line and the sum of its parts, which no statistical publisher can satisfy. Four of ten Irish divisions failed by 100,000 to 200,000 euro on figures of 10 billion - 0.002%, and rounding rather than error, because Eurostat reports in millions to one decimal place and independently rounded sub-groups cannot sum exactly to an independently rounded division.

The check now infers the publisher's rounding unit from the greatest common divisor of the amounts and allows half a unit per figure. It is self-calibrating, so the publisher declares nothing, and real discrepancies are still caught - a fixture 75% out still fails, with the tolerance reported alongside.

Deliberately not added: a precision or unit-multiplier field on amount. Eurostat reports in millions and the adapter multiplies to whole euro, which implies precision the source lacks, but the granularity is already recoverable from the data - every figure here is a multiple of 100,000 euro, which is exactly what the tolerance inference reads. A declared field would restate what the numbers say and add one more thing a publisher can omit or get wrong.

Two structural traps handled: a TOTAL row sits alongside the breakdown and would double every figure if imported as a line, so it becomes the budget total; and divisions arrive in the same response as their sub-groups, so they nest through isPartOf rather than flattening.

administrativeClassification is empty across all 79 lines. Eurostat's publisher is ESA 2010 sector S13, a statistical sector rather than a body, so there is no org chart to join to. Not a defect, but a real limit on what statistical fiscal sources can express.

Six datasets now run in the check pipeline.

Eurostat publishes general government expenditure by function for every EU member
state using COFOG - the classification the budget profile adopted, maintained by
the authority that defines it. That makes it the most direct test available of
whether the profile holds real fiscal data from outside the US.

Ireland 2022: 79 budget lines across 10 COFOG divisions.

One defect, the same shape as the areaServed finding from UK Contracts Finder.
The budget arithmetic check demanded exact equality between a parent line and the
sum of its parts, which no statistical publisher can satisfy. Four of ten Irish
divisions failed by 100,000 to 200,000 euro on figures of 10 billion - 0.002%,
and rounding rather than error, because Eurostat reports in millions to one
decimal place and independently rounded sub-groups cannot sum exactly to an
independently rounded division.

The check now infers the publisher's rounding unit from the greatest common
divisor of the amounts and allows half a unit per figure. It is self-calibrating,
so the publisher declares nothing, and real discrepancies are still caught - a
fixture 75% out still fails, with the tolerance reported alongside.

Deliberately not added: a precision or unit-multiplier field on amount. Eurostat
reports in millions and the adapter multiplies to whole euro, which implies
precision the source lacks, but the granularity is already recoverable from the
data - every figure here is a multiple of 100,000 euro, which is exactly what the
tolerance inference reads. A declared field would restate what the numbers say
and add one more thing a publisher can omit or get wrong.

Two structural traps handled: a TOTAL row sits alongside the breakdown and would
double every figure if imported as a line, so it becomes the budget total; and
divisions arrive in the same response as their sub-groups, so they nest through
isPartOf rather than flattening.

administrativeClassification is empty across all 79 lines. Eurostat's publisher
is ESA 2010 sector S13, a statistical sector rather than a body, so there is no
org chart to join to. Not a defect, but a real limit on what statistical fiscal
sources can express.

Six datasets now run in the check pipeline.
@lukefretwell
lukefretwell merged commit b6b5da9 into main Sep 7, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant