Open data in your apps

Reactive ships an open-data service with 240 public Italian datasets: official vocabularies, state legislation, fuel prices, public tenders, population and boundaries by municipality, the registry of public administrations. Every app queries them with three directives; explore them live below, read-only — none of the user's data leaves the device.

The boundary map

Live choropleth over the ISTAT boundaries: pick a level and a metric, the map draws itself by querying the service. Hover for the value, click a region to drill into its municipalities.

click a region for its municipalities

How the tables relate

How the data connects: each fact table is linked to the others by a shared key — the municipality ISTAT code, the authority tax code, the station id. Search a node, click to focus it and isolate its neighbourhood, switch off the keys you don’t need; double-click opens its catalogue card.

join keytable

Rounded nodes are join keys; rectangles are tables (only connected ones). Click a node to focus its neighbourhood; double-click a table for its catalogue card; the chips above switch keys on and off. Drag to pan, scroll to zoom.

The catalogue

Every warehouse table, live: description, columns, a preview of the rows and a ready-to-paste ::od-query snippet.

Query the data

A read-only SELECT against the service. None of your data leaves the device; the result is a table, and one click turns it into an ::od-query directive.

How to query it from your apps

Everything you see above is done by three directives, inside any Reactive app:

  • ::od-query{into="rows" sql="SELECT …"} — one SELECT against the service, the rows land in a collection (tables, charts, maps, Python). {#key} placeholders in the SQL are reactive parameters: the query re-runs when they change.
  • ::od-search — semantic catalogue search; with table="lex_atti", table="anac_cig" or table="corte_costituzionale" it searches the rows (laws, tenders, Constitutional Court rulings), with a ready-to-copy query. In the catalogue above the three tables carry the ✦ Semantic search badge.
  • ::od-datasets{into} — the catalogue list in a collection.
::od-search{}

::od-query{into="cities" sql="SELECT LABEL_COMUNE_IT AS name, SIGLA_AUTOMOBILISTICA AS code
  FROM voc_istat_cities
  WHERE CODICE_PROVINCIA = '015' AND DATA_FINE_VALIDITA = '31-12-9999'"}

:::table{path="cities"}
| {name} | {code} |
:::

The service exposes GET /datasets (the catalogue), POST /query (a single SELECT, LIMIT capped at 10000, 10s timeout) and POST /search (semantic search). Boundary geometry is served as GeoJSON [lon, lat] in thegeojson column, ready for Leaflet and the :::map directive (withgeojson= and fill= it draws a choropleth). The last good response is cached in the browser, so the app stays usable offline. And the AI assistant knows the catalogue — ask it "a map of population density by municipality" and it writes the query for you.