query-7653c24015ad505bd59f0cd1d1ebe3b4

rq turtle/ttl

Distinct author gender distribution

PREFIX target: http://www.wikidata.org/entity/Q2284414

SELECT ?count ?gender ?genderLabel WITH { SELECT (COUNT(DISTINCT ?author) AS ?count) ?gender WHERE { ?work wdt:P1433 target: . ?work wdt:P50 ?author . ?author wdt:P21 ?gender . } GROUP BY ?gender } AS %result WHERE { INCLUDE %result SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } } ORDER BY DESC(?count)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Distinct author gender distribution

PREFIX target: <http://www.wikidata.org/entity/Q2284414>

SELECT ?count ?gender ?genderLabel 
WHERE {
   {
  SELECT (COUNT(DISTINCT ?author) AS ?count) ?gender WHERE {
    ?work wdt:P1433 target: .
    ?work wdt:P50 ?author .
    ?author wdt:P21 ?gender .
  } 
  GROUP BY ?gender
}  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } 
} 
 ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?author") v5("?count"):::projected v4("?gender"):::projected v2("?work") c6(["bd:serviceParam"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2([http://www.wikidata.org/entity/Q2284414]):::iri v2 --"wdt:P1433"--> c2 v2 --"wdt:P50"--> v3 v3 --"wdt:P21"--> v4 bind1[/"count(?author)"/] v3 --o bind1 bind1 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end