query-a88c82e74afb4d696bb28e39be26f79e
Usage{{sparql|query={{GenderPercent|var=?french|query=?french wdt:P31 wd:Q5 . ?french wdt:P27 wd:Q142 .# french people }}
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
select (?countfrenchg/?countfrencht*100 as ?french_percent) ?french_gender {
{
select (count(?french) as ?countfrenchg ) ?french_gender where {
?french wdt:P31 wd:Q5 . ?french wdt:P27 wd:Q142 .# french people
?french wdt:P21 ?french_gender filter (!isBlank(?french_gender)) .
} group by ?french_gender
}
{
select (count(?french) as ?countfrencht) where {
?french wdt:P31 wd:Q5 . ?french wdt:P27 wd:Q142 .# french people
}
}
}
Query found at
- https://www.wikidata.org/wiki/Template:GenderPercent
- https://www.wikidata.org/wiki/Template:GenderPercent/doc
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?countfrenchg"):::projected
v4("?countfrencht"):::projected
v2("?french")
v1("?french_gender"):::projected
v5("?french_percent")
c2(["wd:Q5"]):::iri
c4(["wd:Q142"]):::iri
f0[["not isBlank(?french_gender)"]]
f0 --> v1
v2 --"wdt:P31"--> c2
v2 --"wdt:P27"--> c4
v2 --"wdt:P21"--> v1
bind2[/"count(?french)"/]
v2 --o bind2
bind2 --as--o v3
v2 --"wdt:P31"--> c2
v2 --"wdt:P27"--> c4
bind4[/"count(?french)"/]
v2 --o bind4
bind4 --as--o v4
bind5[/"?countfrenchg / ?countfrencht * '100^^xsd:integer'"/]
v3 --o bind5
v4 --o bind5
bind5 --as--o v5