query: #defaultView:Map
  SELECT DISTINCT
  ?item 
  (SAMPLE(?item_label) AS ?battle)
  (SAMPLE(?place_label) AS ?place_label)
  (SAMPLE(?partOf_label) AS ?partOf_label)
  (SAMPLE(?year) AS ?year)
  (SAMPLE(?image) AS ?image)
  (SAMPLE(?layer) AS ?layer)
  (SAMPLE(?coords) AS ?coords)
  (SAMPLE(?rgb) AS ?rgb)
  WHERE {
    {
      ?item wdt:P31/wdt:P279* wd:Q178561 . 
    } UNION {
      ?item wdt:P31/wdt:P279* wd:Q188055 . 
    }
    
    OPTIONAL {
      ?item rdfs:label ?item_label .
      FILTER(LANG(?item_label) IN ('fr', 'en')) .
    }
    
    OPTIONAL { 
      ?item wdt:P361 ?partOf .
      ?partOf rdfs:label ?partOf_label .
      FILTER(LANG(?partOf_label) IN ('fr', 'en')) .
    }
    OPTIONAL { ?item wdt:P18 ?image . }
    
    # Place
    ?item wdt:P276 ?place .
    
    OPTIONAL {
      ?place rdfs:label ?place_label .
      FILTER(LANG(?place_label) IN ('fr', 'en')) .
    }
    
    # Coords
    OPTIONAL { ?item wdt:P625 ?coordsItem . }
    OPTIONAL { ?place wdt:P625 ?coordsPlace . }
    BIND(COALESCE(?coordsItem, ?coordsPlace) AS ?coords)
    
    # Date
    ?item (wdt:P585|wdt:P580|wdt:P582) ?date .
    BIND(YEAR(?date) AS ?year) .
    
    # Layer
    VALUES (?layer ?min ?max ?rgb) {
      ("Prehistory" -100000 -3500 "0078BF")
      ("Ancien History -3500 → 500" -3500 500 "DDD700")
      ("Middle Ages 500 → 1500" -500 1500 "5BD500")
      ("Early Modern Period 1500 → 1750" 1500 1750 "00CE23")
      ("Mid Modern Period 1750 → 1914" 1750 1914 "00C699")
      ("Contemporary Period 1914 → present" 1914 3500 "0078BF")
    }
    FILTER (?min <= ?year && ?year < ?max)
  
  } GROUP BY ?item ORDER BY ?year ?battle