query-63fa451e329bb045c5c913844239b81c

rq turtle/ttl

Usage of each label in Wikidata with genders, in a graph

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#>
#defaultView:BarChart
SELECT (CONCAT(STR(?genderLabel), " / ", STR(?orientationLabel)) AS ?lab) (COUNT(*) AS ?count) WHERE {
  SELECT ?genderLabel ?orientationLabel WHERE {
    ?item wdt:P31 wd:Q5;
      wdt:P21 ?gender;
      wdt:P91 ?orientation.
    SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  }
}
GROUP BY ?genderLabel ?orientationLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?count") v2("?gender") v1("?item") v4("?lab") v3("?orientation") c6(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"wdt:P31"--> c2 v1 --"wdt:P21"--> v2 v1 --"wdt:P91"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind1[/"concat(str(?genderLabel),' / ',str(?orientationLabel))"/] null --o bind1 null --o bind1 bind1 --as--o v4 bind2[/"count(*)"/] bind2 --as--o v5