Skip to content

ISTAT: fetch dataflow descriptions from METADATA_API as a resource file #53

Description

@aborruso

Problem

ISTAT dataflows expose a title and nothing else. Verified on the full catalogue (4,884 dataflows, dataflow/IT1):

source dataflows
<common:Description> 26 (0.5%)
LAYOUT_DATAFLOW_KEYWORDS annotation 144 (2.9%)
METADATA_URL annotation 3,962 (81%)

LAYOUT_DATAFLOW_KEYWORDS is sometimes cited as where ISTAT hides descriptions. It is not a usable source: it is present on zero parent dataflows, concentrated in ~40 families (mostly agriculture, 101_*), absent from the entire labour domain, and its content is concatenated keywords rather than prose:

Tipo di coltivazione+Strutturale, annuale, anno+Nazionale, Italia,area, aree,
ripartizione, ripartizioni, ripartizionale,regione, regioni, regionale…

Real descriptions exist, in a third source

ISTAT publishes prose in its reference metadata repository, reachable as JSON:

https://esploradati.istat.it/METADATA_API/api/getMetadata
    ?metadataSetId=MDS_DIFF_REPORT&reportId={df_structure_id}

JSON path:
.data.metadataSets[0].reports[0].attributeSet.reportedAttributes[0].attributeSet.reportedAttributes[0].texts.it

Sample response:

Attività notarile: La rilevazione sull'attività notarile rileva il numero e le caratteristiche degli atti notarili e delle convenzioni in essi contenute. L'indagine è condotta ogni anno, in collaborazione con l'Ufficio centrale archivi notarili e con il Consiglio nazionale del notariato, presso tutti i notai in esercizio…

The key is df_structure_id, which the catalogue already carries. One report serves every dataflow sharing that DSD.

Coverage and cost

Measured by joining a prior extraction (760 reports, 2025-11-17) against the current catalogue:

dataflows in catalogue 4,879
df_structure_id present in the extraction 4,333 (89%)
non-empty prose description 3,360 (69%)

Cost is 760 requests, not 4,879 — the mapping is many-to-one. Endpoint re-tested today: HTTP 200, ~0.15 s per call.

Important: the mapping is not 1:1

The description lives at survey (DSD) level, not dataflow level. All dataflows of one survey receive the same text. On the four dataflows titled Sesso, età:

df_id DSD description
85_83_DF_DCSA_VOLON_1 DCSA_VOLON Multiscopo — aspetti della vita quotidiana
151_877_DF_DCCV_DISOCCUPTMENS1_1 DCCV_DISOCCUPTMENS1 Rilevazione forze di lavoro
150_875_DF_DCCV_OCCUPATIMENS1_2 DCCV_OCCUPATIMENS1 Rilevazione forze di lavoro
150_1170_DF_..._UNT2020_2 DCCV_OCCUPATIMENS1_UNT2020 Rilevazione forze di lavoro

It separates volunteering from labour — useful for topical retrieval. It does not separate employed from unemployed from employed-until-2020.

Worse for the discontinued-series case: the description of the discontinued dataflow never mentions 2020, "regolamento" or "precedente", while the current one discusses Regulation (EU) 2019/1700 and the recalculation through December 2020. Weighting descriptions would pull retrieval toward the wrong dataflow, not away from it.

So this is complementary to, not a replacement for, the parent-title work: descriptions answer which survey, parent titles answer which cut and which vintage.

Proposal

Generate the descriptions offline as a committed resource file, following the existing data/constraints/ + .github/workflows/constraints-archive.yml pattern: a scheduled job, keyed on df_structure_id, incremental with a budget and a status file.

Prior art proving the recipe works end to end: script/jiku_istat/jiku_istat.sh in the author's apiRestIstat repo.

Open questions

  • Pacing. METADATA_API is a different path on the same host as the SDMX endpoint, which enforces a strict rate limit and has produced 1–2 day IP blocks. Whether it shares that budget is unverified — measure conservatively before choosing a pause, do not assume the ~0.15 s response time means it is safe to hammer.
  • Descriptions are HTML (<strong>, <p>) and Italian-only in this path; check whether an en text exists for the same report.
  • Refresh cadence: survey metadata changes rarely, so a weekly or monthly run is likely enough.
  • Should the resource ship inside the package, or stay a repo data file consumed opportunistically?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions