Temporal

Calendar Systems

Work with different calendar systems: Gregorian, Julian, and proleptic calendars for handling ancient dates across cultural heritage data.

Calendars in Wikidata

Wikidata stores dates with calendar model information. Most modern dates use the Gregorian calendar, but historical dates may use the Julian calendar or proleptic calendars for dates before these systems existed.

Calendar Wikidata Entity Use Case
Gregorian wd:Q1985727 Dates after 1582 (standard)
Proleptic Gregorian wd:Q1985786 Dates before 1582 using Gregorian rules
Julian wd:Q1985786 Historical dates (45 BC - 1582 AD)
Proleptic Julian wd:Q1985786 Very ancient dates using Julian rules

Accessing Calendar Information

Query Date with Calendar Model
Run ↗
SELECT ?item ?itemLabel ?date
       ?calendar ?calendarLabel
WHERE {
  ?item wdt:P31 wd:Q839954 ;  # archaeological site
        p:P571 ?dateStatement .

  ?dateStatement psv:P571 ?timeValue .
  ?timeValue wikibase:timeValue ?date ;
             wikibase:timeCalendarModel ?calendar .

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
LIMIT 50

Ancient Dates in Cultural Heritage

Ancient Civilizations by Founding Date
Run ↗
SELECT ?city ?cityLabel ?founded
       (YEAR(?founded) AS ?year)
WHERE {
  ?city wdt:P31/wdt:P279* wd:Q515 ;  # city
        wdt:P571 ?founded .

  # Ancient cities: founded before 0 AD
  FILTER(YEAR(?founded) < 0)

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
ORDER BY ?founded
LIMIT 50
Historical Figures from Antiquity
Run ↗
#defaultView:Timeline
SELECT ?person ?personLabel ?birth ?death
       ?occupation ?occupationLabel
WHERE {
  ?person wdt:P31 wd:Q5 ;       # human
          wdt:P569 ?birth ;
          wdt:P106 ?occupation .
  OPTIONAL { ?person wdt:P570 ?death . }

  # Born before 500 BC
  FILTER(YEAR(?birth) < -500)

  # Philosophers, mathematicians, or rulers
  VALUES ?occupation {
    wd:Q4964182   # philosopher
    wd:Q170790    # mathematician
    wd:Q116       # monarch
  }

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
ORDER BY ?birth
LIMIT 100

Handling BC/BCE Dates

SPARQL represents BC dates as negative years. The year -500 represents 500 BC. Be aware that there is no year 0 in the traditional calendar — 1 BC is followed by 1 AD.

Format BC/AD Dates
Run ↗
SELECT ?item ?itemLabel ?year
       (IF(?year < 0,
          CONCAT(STR(ABS(?year)), " BC"),
          CONCAT(STR(?year), " AD"))
        AS ?formattedYear)
WHERE {
  ?item wdt:P31 wd:Q839954 ;  # archaeological site
        wdt:P571 ?date .
  BIND(YEAR(?date) AS ?year)
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
ORDER BY ?year
LIMIT 50

Urban History: Ancient Cities

Oldest Continuously Inhabited Cities
Run ↗
SELECT ?city ?cityLabel ?country ?countryLabel
       (YEAR(?founded) AS ?year)
       (YEAR(NOW()) - YEAR(?founded) AS ?age)
WHERE {
  ?city wdt:P31/wdt:P279* wd:Q515 ;
        wdt:P571 ?founded ;
        wdt:P17 ?country .

  # Founded before 1000 BC
  FILTER(YEAR(?founded) < -1000)

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
ORDER BY ?year
LIMIT 30
Ancient Urban Infrastructure
Run ↗
SELECT ?structure ?structureLabel ?type ?typeLabel
       (YEAR(?built) AS ?year)
       ?location ?locationLabel
WHERE {
  # Ancient infrastructure types
  VALUES ?type {
    wd:Q12280    # bridge
    wd:Q34038    # aqueduct
    wd:Q39614    # amphitheatre
    wd:Q57346    # road
  }

  ?structure wdt:P31 ?type ;
             wdt:P571 ?built .
  OPTIONAL { ?structure wdt:P131 ?location . }

  FILTER(YEAR(?built) < 500)

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}
ORDER BY ?year
LIMIT 50

Calendar Conversion Notes