query-83eb46f8feb63d65303dfa022981961d
Simple count
Use at
- https://query.wikidata.org/sparql
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?gender ?genderLabel (COUNT(*) AS ?count)
WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "en.wikipedia.org";
wikibase:api "Generator";
mwapi:generator "links";
mwapi:titles "Economics";.
?item wikibase:apiOutputItem mwapi:item.
}
FILTER BOUND (?item)
?item wdt:P31 wd:Q5 .
?item wdt:P21 ?gender .
?gender rdfs:label ?genderLabel filter (lang(?genderLabel) = "en") .
}
GROUP BY ?gender ?genderLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?count")
v4("?gender"):::projected
v2("?genderLabel"):::projected
v3("?item")
c11(["Economics"]):::literal
c13(["mwapi:item"]):::iri
c5(["en.wikipedia.org"]):::literal
c3(["bd:serviceParam"]):::iri
c15(["wd:Q5"]):::iri
c9(["links"]):::literal
c7(["Generator"]):::literal
f0[["?genderLabel = 'en'"]]
f0 --> v2
f1[["bound(?item)"]]
f1 --> v3
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c3 --"mwapi:endpoint"--> c5
c3 --"mwapi:api"--> c7
c3 --"mwapi:generator"--> c9
c3 --"mwapi:titles"--> c11
v3 --"mwapi:apiOutputItem"--> c13
end
v3 --"wdt:P31"--> c15
v3 --"wdt:P21"--> v4
v4 --"rdfs:label"--> v2
bind3[/"count(*)"/]
bind3 --as--o v5