query: #defaultView:Map
  
  SELECT DISTINCT ?item ?itemLabel ?article ?place ?placeLabel ?location ?id ?distance ?rgb WHERE {
     {?item wdt:P31 wd:Q11032 .} UNION {?item wdt:P31/wdt:P279* wd:Q11032 .}
     ?item wdt:P291 ?place .
    
     SERVICE wikibase:around { 
        ?place wdt:P625 ?location . 
        bd:serviceParam wikibase:center "Point(-79.066667 43.116667)"^^geo:wktLiteral .
        bd:serviceParam wikibase:radius "150" . 
        bd:serviceParam wikibase:distance ?distance .
     } 
    
     OPTIONAL{?item wdt:P5454 ?id .}
  
     OPTIONAL {   
      SELECT ?item ?pageid ?ns WHERE {
       SERVICE wikibase:mwapi {
        bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
        bd:serviceParam wikibase:api "Generator" .
        bd:serviceParam mwapi:generator "search" .
        bd:serviceParam mwapi:gsrsearch "insource:\"infobox newspaper\"" .
        bd:serviceParam mwapi:gsrlimit "max" .
        ?item wikibase:apiOutputItem mwapi:item .
        ?pageid wikibase:apiOutput "@pageid" .
        ?ns wikibase:apiOutput "@ns" .
       }
      } LIMIT 1000
     }
   
    
    OPTIONAL {
        ?article schema:about ?item .
        ?article schema:inLanguage "en" .
        FILTER (SUBSTR(str(?article), 1, 25) = "https://en.wikipedia.org/")
    }
  
    BIND(IF(BOUND(?ns),"_infobox","_noinfobox") AS ?infobox).
    BIND(IF(BOUND(?article),"enwiki","noenwiki") AS ?onwiki).  
    BIND(CONCAT(?onwiki,?infobox) as ?layer) .
  
    BIND( IF(BOUND(?article),   IF(BOUND(?ns), "009500" , "FFF000" )  ,  "FF0000"   )  AS ?rgb).  
  
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  
  }