query-f01389ef6afeef4701be2af266723f00
Propertiesinstance of (P31)sex or gender (P21)country of citizenship (P27)continent (P30)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?country ?countryLabel
(COUNT(?item) AS ?NombreHumains)
WHERE {
?item wdt:P31 wd:Q5; #give me a human
wdt:P21 ?genre; #give me a person
wdt:P27 ?country. #and who has a country of citizenship (P27)
?country wdt:P30 wd:Q15. #and that country of citizenship is in the continent (P30) Africa
?article schema:about ?item ;
schema:isPartOf [ wikibase:wikiGroup "wikipedia" ] . # A un article dans wikipedia
# schema:isPartOf <https://en.wikipedia.org/> .
VALUES ?genre {
wd:Q8441 # Homme
wd:Q6581072}. # Femme
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?country ?countryLabel # groupe par label du pays de naissance
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?NombreHumains")
v4("?article")
v3("?country"):::projected
v5("?genre")
v1("?item"):::projected
a1((" "))
c6(["wd:Q15"]):::iri
c12(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c9(["wikipedia"]):::literal
v1 --"wdt:P31"--> c2
v1 --"wdt:P21"--> v5
v1 --"wdt:P27"--> v3
v3 --"wdt:P30"--> c6
v4 --"schema:about"--> v1
a1 --"wikibase:wikiGroup"--> c9
v4 --"schema:isPartOf"--> a1
bind0[/VALUES ?genre/]
bind0-->v5
bind00(["wd:Q8441"])
bind00 --> bind0
bind01(["wd:Q6581072"])
bind01 --> bind0
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end
bind2[/"count(?item)"/]
v1 --o bind2
bind2 --as--o v5