Where the data comes from

Everything here is built from open sources and stored on disk before you ever load a page — nothing is fetched while you play, so the quiz works offline apart from the photographs. Each source is used for the thing it is actually good at, which took some finding out.

The sources

SourceWhat it givesLicence
Wikidata Country facts, capitals, currencies, borders, leaders past and present, famous people and their photographs, wars, highest points, memberships. Queried over SPARQL. CC0
Wikipedia The opening paragraph on every country page, and the article every name on the site links out to. CC BY-SA
CIA World Factbook, via factbook.json Language breakdowns with percentages and official status, government type, climate, exports, imports, trading partners, natural resources, industries, agriculture, GDP per head. Public domain
GeoNames The five largest cities of each country, by population. CC BY
world.geo.json Country outlines, for the silhouettes and the clickable map. Public domain
flagcdn.com Flags, at two sizes. Public domain
Wikimedia Commons Every photograph of a person on the site. Various free licences
Written by hand The belligerents of fifty major wars, two to four figures from the history of every country, and the landmarks each country is known for. Every entry links to its Wikipedia article, and each figure's opening sentence and portrait are pulled from there.

Why more than one source

Wikidata is the best structured record of the world there is, and it is wrong in specific, predictable ways for the questions a geography quiz wants to ask:

  • Borders. Its shares border with counts sea boundaries, which had the United States bordering Japan and Tonga. Every pair is now checked against the real polygons, so only coastlines within about two kilometres of each other count.
  • Languages. Speaker counts exist for a handful of countries and nowhere else, and official-language lists are not the same question — Sweden did not list Swedish. The Factbook publishes a breakdown with percentages for almost every country.
  • Government. Wikidata lists every form that applies at once: China is a communist state, a socialist state, a unitary state and a one-party state, so the question had four right answers. The Factbook states one type per country.
  • Wars. Participants are recorded as the state that fought, which before about 1950 no longer exists — World War II lists Nazi Germany and the Soviet Union, neither of which has a country code. The major wars are written out by hand against their modern successors.
  • People. A leader is modelled as the holder of an office, and the office often belongs to a state that has since dissolved, so Muammar Gaddafi appeared nowhere on Libya's page. Offices are looked up both ways round now, and a curated list fills the rest.

What is a thread

Any fact shared between countries gets a page of its own, and every mention of it anywhere on the site links to that page. That covers languages, wars, currencies, religions, organisations, forms of government and highest points, and also climates, landmarks, and every commodity a country buys, sells, mines or makes. The economy fields arrive as bare strings from the Factbook and are wrapped into the same shape as the rest at load time, which is why "crude petroleum" behaves exactly like "Spanish".

What is in the dataset today

197countries
2049people
347languages
234wars
882cities
196trade profiles

Rebuilding it

python scripts/fetch_data.py pulls everything structured from Wikidata and Wikipedia, resuming from a checkpoint if it is interrupted. python scripts/enrich_data.py layers the Factbook fields on top and repairs what the first pass gets wrong. The hand-written tables live in learngeo/supplement.py and are merged at load time, so a rebuild cannot wipe them.