Posts

Build a location timeline with Histropedia Query Timeline

Rewritten on 28 October 2026 for the current Histropedia Query Timeline tool. The original publication date is retained above.

A useful local-history timeline starts with two decisions: where to search and which date to show. This example finds items within one kilometre of the Eiffel Tower that have a recorded inception date. It is a discovery view of dated places and objects, not a complete history of everything that happened nearby.

Open this example in Query Timeline · Download the SPARQL query

# Dated items within 1 km of the Eiffel Tower, using inception dates.
SELECT DISTINCT ?item ?itemLabel ?itemDescription ?start ?startPrecision
  ?distanceKm ?typeLabel
WHERE {
  hint:Query hint:optimizer "None" .
  wd:Q243 wdt:P625 ?centre .
  SERVICE wikibase:around {
    ?item wdt:P625 ?location .
    bd:serviceParam wikibase:center ?centre ;
                    wikibase:radius "1" ;
                    wikibase:distance ?distanceKm .
  }
  ?item p:P571 ?dateStatement .
  ?dateStatement a wikibase:BestRank ; psv:P571 ?dateValue .
  ?dateValue wikibase:timeValue ?start ;
             wikibase:timePrecision ?startPrecision .
  OPTIONAL { ?item wdt:P31 ?type . }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY ?distanceKm ?item ?start
LIMIT 200

The link opens Query Timeline with the query and mappings filled in. Open Configure Timeline to adapt it, keep Main graph selected, then choose Generate timeline.

Setting Variable
Title / Description itemLabel / itemDescription
Start date / Start precision start / startPrecision
End date leave empty: these are inception events
URL / Wikidata item / item
Merge duplicate results / Group by enabled / item
Colour code by distanceKm, typeLabel
Filter categories typeLabel

Change the centre and radius

wd:Q243 wdt:P625 ?centre reads the Eiffel Tower’s coordinates. Replace Q243 with a landmark that has a coordinate location on Wikidata. The radius is in kilometres. Begin with a small area, then widen it once you understand the returned records.

For a custom location, replace that centre line with:

BIND("Point(2.2945 48.8584)"^^geo:wktLiteral AS ?centre)

WKT uses longitude first, latitude second. Reversing them can produce an empty result or a plausible-looking result somewhere else. The Wikidata Query Service manual documents the around service and its distance output.

Choose a date with a clear meaning

The query hint preserves the written order so the geographic search runs before the date lookup; this avoided a timeout during testing.

The query uses P571, inception. For a building that might be a foundation or creation date, not its opening date or the date of its present structure. It reads the value and precision from the same best-ranked statement. Map startPrecision explicitly so a year-only date stays a year.

To investigate official openings instead, replace both occurrences of P571 with P1619 and change the timeline title to say “official opening dates”. The result set will change because many items have one property but not the other. Combining inception, opening and event dates into one unnamed start field makes the chronology hard to interpret; use separate queries or return a date-role category and label the event accordingly.

Items without usable coordinates or the chosen date are absent. An organisation’s headquarters coordinate does not make every event in its history local to that place. A nearby painting or monument is a discovery lead, not evidence that its creator lived nearby or influenced another nearby person.

Use distance and type to explore the result

distanceKm is numeric, so it can drive a colour scale. typeLabel is categorical and gives a different view of the same rows. Select the colour scheme in the tool, inspect its legend and try filtering to a type that interests you. Keep the distance unit in the variable name so exported values remain understandable.

Several types or date statements can create several rows for one item. Merge by item for matching start dates, but retain different dates for inspection. The query returns at most 200 rows, ordered by distance; it reached that cap in our check, is not an exhaustive census and can contain fewer than 200 distinct items. A small radius is also a more effective starting point for a slow query than simply adding LIMIT at the end.

From discovery to a reusable timeline

Check a few source items before sharing, especially the date property and coordinate. Share provides the configured link and embed code; test the link in a fresh tab. Use Export when you need a snapshot to curate in Histropedia Sheets, and record the retrieval date, centre, radius and date property with the export.

The old around[...] URL syntax and legacy map instructions have been replaced by this SPARQL workflow.

comments powered by Disqus