query-d16487fa13bf284f3b2475bbe6075e28

rq turtle/ttl

Map of newspapers in the United States by presence of Infobox newspaper in their English Wikipedia article in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query Map of newspapers in the United States by presence of Infobox newspaper in their English Wikipedia article in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query Carte des journaux des Etats Unis d'aprés l'infobox du journal présente dans l'article correspondant de la Wikipedia anglaise in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query Map of newspapers in the United States by presence of Infobox newspaper in their English Wikipedia article in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query Map of newspapers in the United States by presence of Infobox newspaper in their English Wikipedia article in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query Kaart van kranten in de Verenigde Staten door de aanwezigheid van de Infobox krant in hun Engels Wikipedia artikel in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query Karta över nyhetstidningar i USA efter närvaron av Infobox newspaper i deras artkel på engelskspråkiga Wikipedia in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query Map of newspapers in the United States by presence of Infobox newspaper in their English Wikipedia article in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query Map of newspapers in the United States by presence of Infobox newspaper in their English Wikipedia article in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query Map of newspapers in the United States by presence of Infobox newspaper in their English Wikipedia article in their English Wikipedia articleInfobox newspaperMap of newspapers in the United States by presence of the template integrates a text search for the template's name using the MediaWiki API into a SPARQL query

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT DISTINCT ?item ?itemLabel ?place ?placeLabel ?id ?coords ?article ?rgb WHERE {
 ?c wdt:P279* wd:Q11032 .
  ?item wdt:P31 ?c .
 ?item wdt:P17|wdt:P495 wd:Q30 .
 OPTIONAL{?item wdt:P5454 ?id .}
 ?item wdt:P291 ?place .
 ?place wdt:P625 ?coords.
 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 "hastemplate:"infobox newspaper"" .
      bd:serviceParam mwapi:gsrlimit "max" .
      ?item wikibase:apiOutputItem mwapi:item .
      ?pageid wikibase:apiOutput "@pageid" .
      ?ns wikibase:apiOutput "@ns" .
    }
  } LIMIT 15000
 }

  OPTIONAL {
      ?article schema:about ?item .
      ?article schema:inLanguage "en" .
      FILTER (SUBSTR(str(?article), 1, 25) = "https://en.wikipedia.org/")
  }

  BIND( IF(BOUND(?article),   IF(BOUND(?ns), "009500" , "FFF000" )  ,  "FF0000"   )  AS ?rgb).  

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

Query found at