← Federation
Query multiple SPARQL endpoints.
Go BackMaster time-based queries in SPARQL. From filtering by dates to building timelines, explore how to work with temporal data across programming language history, cultural heritage events, and urban development.
Wikidata contains rich temporal information: when programming languages were created, when historical buildings were constructed, when cities were founded, and when cultural movements flourished. Understanding how to query temporal data unlocks powerful historical analysis and timeline generation.
Temporal queries involve:
Filter and compare dates using SPARQL date functions. Learn YEAR(), MONTH(), DAY() and date comparisons.
Learn DatesBuild chronological timelines and analyze time periods. Group events by decade, century, or custom intervals.
Build TimelinesQuery historical events, movements, and periods. Explore cultural heritage through time-based analysis.
Explore HistoryHandle dates with different precision levels. Work with year-only, month-only, and exact dates.
Handle PrecisionWork with different calendar systems: Gregorian, Julian, and proleptic calendars for ancient dates.
Explore CalendarsSELECT ?decade (COUNT(?lang) AS ?count)
(GROUP_CONCAT(DISTINCT ?langLabel; SEPARATOR=", ") AS ?languages)
WHERE {
?lang wdt:P31 wd:Q9143 ;
wdt:P571 ?inception .
BIND(FLOOR(YEAR(?inception) / 10) * 10 AS ?decade)
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
GROUP BY ?decade
ORDER BY ?decade
SELECT ?century (COUNT(?site) AS ?count)
WHERE {
?site wdt:P1435 wd:Q9259 . # UNESCO World Heritage Site
?site wdt:P571 ?inception .
BIND(FLOOR((YEAR(?inception) - 1) / 100) + 1 AS ?century)
FILTER(?century > 0) # Only AD dates
}
GROUP BY ?century
ORDER BY ?century
SELECT ?era (COUNT(?city) AS ?count)
(SAMPLE(?cityLabel) AS ?example)
WHERE {
?city wdt:P31/wdt:P279* wd:Q515 ; # city or subclass
wdt:P571 ?founded .
BIND(YEAR(?founded) AS ?year)
BIND(
IF(?year < -500, "Ancient (before 500 BC)",
IF(?year < 500, "Classical (500 BC - 500 AD)",
IF(?year < 1500, "Medieval (500 - 1500)",
IF(?year < 1800, "Early Modern (1500 - 1800)",
IF(?year < 1900, "Industrial (1800 - 1900)",
"Modern (1900+)")))))
AS ?era)
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
GROUP BY ?era
ORDER BY ?era
| Property | ID | Description |
|---|---|---|
| inception | wdt:P571 |
Date when entity was created/founded |
| dissolved/abolished | wdt:P576 |
Date when entity ceased to exist |
| start time | wdt:P580 |
When something started |
| end time | wdt:P582 |
When something ended |
| point in time | wdt:P585 |
When an event occurred |
| date of birth | wdt:P569 |
Birth date of a person |
| date of death | wdt:P570 |
Death date of a person |
| publication date | wdt:P577 |
When something was published |