Posts
Make a descendants timeline with Wikidata and Query Timeline
Rewritten on 28 October 2026 for the current Histropedia Query Timeline tool. The original publication date is retained above.
A family timeline can reveal overlapping lifetimes and the spread of generations. Histropedia Query Timeline turns the results of a Wikidata SPARQL query into an interactive timeline without writing a JavaScript application.
This example follows recorded child relationships from Queen Victoria. It includes people with a usable birth date and displays a lifespan when a death date is available. It is an exploration of Wikidata’s records, not a complete family tree or proof of ancestry.
Start with a working timeline
Open this example in Query Timeline · Download the SPARQL query
The link includes the query and field mappings. It runs a live query, so loading time and results depend on Wikidata. Open Configure Timeline to inspect or change it. For a fresh setup, paste the query below into the editor, choose Main graph, and enter these mappings without the ? prefix:
| Setting | Variable |
|---|---|
| Title / Description | itemLabel / itemDescription |
| Start date / Start precision | start / startPrecision |
| End date / End precision | end / endPrecision |
| URL / Wikidata | item / item |
| Merge duplicate results | disabled: retain competing lifespan dates |
| Colour code by / Filter categories | deathData / deathData |
Choose Generate timeline. Pan and zoom to compare lifetimes; open a person’s Wikidata record to inspect the underlying statements.
What the query actually asks
Open this example in Query Timeline · Download the SPARQL query
# Recorded descendants of Queen Victoria; not a complete genealogy.
SELECT DISTINCT ?item ?itemLabel ?itemDescription
?start ?startPrecision ?end ?endPrecision ?deathData
WHERE {
wd:Q9439 wdt:P40/wdt:P40* ?item .
?item p:P569 ?birthStatement .
?birthStatement a wikibase:BestRank ; psv:P569 ?birthValue .
?birthValue wikibase:timeValue ?start ;
wikibase:timePrecision ?startPrecision .
OPTIONAL {
?item p:P570 ?deathStatement .
?deathStatement a wikibase:BestRank ; psv:P570 ?deathValue .
?deathValue wikibase:timeValue ?end ;
wikibase:timePrecision ?endPrecision .
}
BIND(IF(BOUND(?end), "Death date recorded", "No death date returned") AS ?deathData)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY ?start ?item
LIMIT 500
Q9439 is Queen Victoria. P40 means child. The path wdt:P40/wdt:P40* follows one child link, then zero or more further child links. Victoria herself is not included. A missing relationship breaks the path: someone can be a descendant without appearing in this result.
The birth date is required; the death date is inside OPTIONAL. This keeps people whose death date is missing. “No death date returned” does not mean “alive”. It can mean an incomplete record or a statement without a usable date. When no end date is mapped for a row, the tool displays a point at the birth date, not a lifespan extending to today.
The query reads the date’s value and precision from the same statement. 11 means day, 10 month, 9 year. Mapping both precision fields avoids presenting a year-only birth as an exact 1 January birthday. wikibase:BestRank selects the preferred rank if present, otherwise normal rank; it does not establish that a statement is true or resolve competing dates at the same rank.
Adapt it without losing control of the results
Replace wd:Q9439 with another person’s item identifier, including the Q. Start with someone whose recorded family is small. To show only children, replace the path with wdt:P40; for exactly two generations, use wdt:P40/wdt:P40. See the filtering walkthrough for children and grandchildren and a date cutoff.
The example sorts by birth date and caps the response at 500 query rows. It reached that cap in our check, so it is deliberately incomplete. Multiple dates can produce multiple rows for one person. Increasing the cap is not a cure for an expensive family-tree traversal; narrow the relationship depth first. Broad medieval ancestry queries, including Charlemagne’s entire recorded descent, can be much more expensive.
The example leaves duplicate merging off. The query removes identical rows with DISTINCT, but different birth or death dates remain available to inspect. The tool’s merge option groups by the chosen key and displayed start date; it does not reconcile end dates or precision. Enabling it can hide competing death dates for the same birth date. Inspect those statements on Wikidata before treating the timeline as evidence.
Share a reproducible starting point
Use Share to copy the configured query link or embed code. Reopen the link in a fresh tab and check the title, mappings and results. A shared query reruns against live data; it is not a frozen research record, and interactive exploration is not necessarily preserved in the link. For a dated snapshot, use Share → Export, retain the query and retrieval date alongside the data, and use the Histropedia Sheets export if you want to continue curating it.
For the query language itself, see the Wikidata SPARQL tutorial. The old tree[...], claim[...] and Home.aspx workflow has been replaced by the steps above.