query-805cfd2a5141a41e52553dd3cbe19ee2

rq turtle/ttl

Bubble Chart: Top 20 LGBT Places Represented in Wikidata by P31

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#TOP 20 LGBT PLACES REPRESENTED IN WIKIDATA BY P31
#defaultView:BubbleChart
SELECT DISTINCT ?topicType ?topicTypeLabel ?number
WHERE
{
 {
  SELECT DISTINCT ?topicType (COUNT(DISTINCT ?item) AS ?number)
  WHERE
  {
   ?item wdt:P31/wdt:P279* wd:Q64364539 ; wdt:P31 ?topicType .
  }GROUP BY ?topicType
 }SERVICE wikibase:label {bd:serviceParam wikibase:language "en" . }
}ORDER BY DESC (?number) LIMIT 20

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item") v4("?number"):::projected v3("?topicType"):::projected a1((" ")) c5(["bd:serviceParam"]):::iri c3(["wd:Q64364539"]):::iri c7(["en"]):::literal v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v2 --"wdt:P31"--> v3 bind1[/"count(?item)"/] v2 --o bind1 bind1 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end