User:Mxn/Stay-at-home orders

 { "type": "ExternalData", "service": "geoshape", "query": "SELECT DISTINCT ?id    (concat(, ?placeLabel, ) as ?title)     (concat(GROUP_CONCAT(DISTINCT concat(, ?orderLabel, ); SEPARATOR=' '),             ' ', coalesce(str(MIN(?startDate)), '?'), '–', coalesce(str(MAX(?endDate)), '?'), ' ',             coalesce(GROUP_CONCAT(DISTINCT ?startLink; SEPARATOR=), ), coalesce(GROUP_CONCAT(DISTINCT ?endLink; SEPARATOR=), )) AS ?description)     (MIN(?color) AS ?fill) WHERE {   ?order wdt:P31 wd:Q88509703;     wdt:P1001 ?id.   SERVICE wikibase:label {     bd:serviceParam wikibase:language 'en'.     ?order rdfs:label ?orderLabel.     ?id rdfs:label ?placeLabel.   }   OPTIONAL {     ?order wdt:P580 ?isoStartDate .     BIND(if(?isoStartDate < '2020-03-22T00:00:00-00:00'^^xsd:dateTime, '#045a8d',             if(?isoStartDate < '2020-03-29T00:00:00-00:00'^^xsd:dateTime, '#2b8cbe',                if(?isoStartDate < '2020-04-05T00:00:00-00:00'^^xsd:dateTime, '#74a9cf',                  if(?isoStartDate < '2020-04-12T00:00:00-00:00'^^xsd:dateTime, '#a6bddb',                     '#d0d1e6')))) AS ?color)     BIND(day(?isoStartDate) AS ?startDay). BIND(month(?isoStartDate) AS ?startMonthNumber). VALUES (?startMonthNumber ?startMonth) {      (1 'January') (2 'February') (3 'March') (4 'April') (5 'May') (6 'June') (7 'July') (8 'August') (9 'September') (10 'October') (11 'November') (12 'December')     }     BIND(concat(?startMonth, ' ', str(?startDay)) AS ?startDate). ?order p:P580 ?startStatement. ?startStatement ps:P580 ?startValue. OPTIONAL {      ?startStatement prov:wasDerivedFrom ?startRefNode. ?startRefNode pr:P854 ?startURL. }    BIND(concat('[', str(?startURL), ']') AS ?startLink)   }   OPTIONAL {     ?order wdt:P582 ?isoEndDate. BIND(day(?isoEndDate) AS ?endDay). BIND(month(?isoEndDate) AS ?endMonthNumber). VALUES (?endMonthNumber ?endMonth) {      (1 'January') (2 'February') (3 'March') (4 'April') (5 'May') (6 'June') (7 'July') (8 'August') (9 'September') (10 'October') (11 'November') (12 'December')     }     BIND(concat(?endMonth, ' ', str(?endDay)) AS ?endDate). ?order p:P582 ?endStatement. ?endStatement ps:P582 ?endValue. OPTIONAL {      ?endStatement prov:wasDerivedFrom ?endRefNode. ?endRefNode pr:P854 ?endURL. }    BIND(concat('[', str(?endURL), ']') AS ?endLink)     OPTIONAL {       ?endStatement pq:P582 ?endEndDay     }     FILTER(!BOUND(?endEndDay)). }  ?placeLink schema:about ?id; schema:isPartOf . } GROUP BY ?id ?placeLink ?placeLabel ORDER BY DESC(?isoStartDate)" }