query-e2219f7a9d9fe565b4a44e524d17ddaa
Elisabeth par genre
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?gender ?genderLabel (COUNT(*) AS ?count) WHERE {
VALUES ?target {
wd:Q385468
wd:Q17524931
wd:Q18093037
}
?item wdt:P31 wd:Q5;
wdt:P21 ?gender;
p:P735 ?statement.
?statement ps:P735 ?target.
OPTIONAL { ?statement pq:P1545 ?rank. }
BIND(IF(BOUND(?rank),?rank, 0) AS ?rank2)
FILTER(xsd:integer(?rank2) < xsd:integer(2))
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,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;
v8("?count")
v5("?gender"):::projected
v4("?item")
v7("?rank")
v8("?rank2")
v6("?statement")
v3("?target")
c9(["bd:serviceParam"]):::iri
c3(["wd:Q5"]):::iri
c11(["fr,en"]):::literal
f0[["http://www.w3.org/2001/XMLSchema#integer(?rank2) < http://www.w3.org/2001/XMLSchema#integer('2^^xsd:integer')"]]
f0 --> v8
bind1[/VALUES ?target/]
bind1-->v3
bind10(["wd:Q385468"])
bind10 --> bind1
bind11(["wd:Q17524931"])
bind11 --> bind1
bind12(["wd:Q18093037"])
bind12 --> bind1
v4 --"p:direct/P31"--> c3
v4 --"p:direct/P21"--> v5
v4 --"p:P735"--> v6
v6 --"p:statement/P735"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:qualifier/P1545".-> v7
end
bind2[/"if(bound(?rank),?rank,'0^^xsd:integer')"/]
v7 --o bind2
bind2 --as--o v8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind4[/"count(*)"/]
bind4 --as--o v8