Skip to content
Field Guide

Prompt Lab

What the search box decides before it shows you anything

A natural-language query is not a filter — it is an interpretation. The resolver has to commit to a place and to a set of statistical variables, and it will commit even when your question gave it nothing to go on. This page shows you those commitments for any question you like.

Prompt Lab

Every question you type into data.un.org is resolved into a place and a set of statistical variables before a single chart is drawn. Those two decisions are what determine whether you get the number you meant. Here they are, in the open.

Open on data.un.org ↗

What this preset isolates: One bare noun. Watch which country it decides you meant.

Resolving…

The failure nobody warns you about

Start with the first preset — the single word “violence” — and look at the place it resolved to.

It answers United States of America. Nothing in the question said so. The resolver needs a place to build a page around, so when it cannot find one it supplies a default — and then draws perfectly legitimate charts on top of that assumption.

A chart titled “Number of Victims of Intentional Homicide” looks like a global figure. It is a US figure. If you screenshot it into a brief, the error is now yours and it is invisible.

The fix is one word long: name the geography, every time. Say “worldwide”, or “in Sub-Saharan Africa”, or name the country. The Lab flags an inferred place with a warning so you can see the difference immediately.

Don't

violence

No place, no measure, no time frame. You get a country you did not choose.

Do

number of total conflict-related deaths in South Sudan

A measure phrased the way the database phrases it, and an explicit place.

The four moves that make a prompt precise

Each one changes the resolver's behaviour in a way you can watch in the Lab above.
  1. 1

    Name the place — always

    Omitting it does not give you a world total. It gives you a guess.

    … in South Sudan · … worldwide · … across countries in Africa

  2. 2

    Use the database's noun, not yours

    “War deaths” is not an indicator. “Conflict-related deaths” is SDG 16.1.2. Matching the official phrasing pulls the right series to the top instead of a near neighbour.

    conflict-related deaths · intentional homicide · access to electricity · human development index

  3. 3

    Say “compare … across countries in X” to change the chart form

    This phrasing is what promotes a single line into a map and a ranking across a whole region. Without it you get one place's time series.

    compare homicide rate across countries in Africa

  4. 4

    Ask for the breakdown you need by name

    Sex, age, urban/rural and wealth quintile all exist as separate variables. Naming one brings the sliced series forward; leaving it out gets you the total.

    … of children under 18 · … by sex · … in rural areas

When to stop prompting

Natural language is for finding the indicator. Once you know its identifier, ask for it directly.

Every variable in the Lab's results is listed with its dcid. That string is the durable address of the series. Once you have it, the search box is a detour: you can fetch the numbers directly, pin the exact slice, and get a response you can put in a script.

This is also the honest answer to reproducibility. A prompt is a question whose interpretation may change as the resolver improves. A dcid is an address that will not.

the same answer, addressed directly
curl -s -X POST \
  'https://unsd-datacommons.gcp.un-icc.cloud/api/observations/series' \
  -H 'Content-Type: application/json' \
  -d '{"variables":["undata/sdg/VC_DTH_TOTN"],"entities":["country/SSD"]}'

Takeaway

Use natural language to discover the indicator, then switch to its dcid to retrieve it. Prompting is a search strategy; identifiers are a data strategy. The query cookbook picks up from here.

↑ ↓ to move · Enter to open · A match inside a video opens the lesson at the moment the words are said.