query-66e9756d7e045b636030675a6f77dd52
Organizer gender distribution
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:BarChart
PREFIX target: <http://www.wikidata.org/entity/Q6053150>
SELECT
(STR(?year_) AS ?year)
?count
?genderLabel
WHERE {
{
SELECT
?year_
(COUNT(?event) AS ?count)
?gender
WHERE {
{
SELECT
(MIN(?years) AS ?year_)
?event
WHERE {
?event wdt:P179 target: ;
wdt:P580 | wdt:P585 ?datetime .
BIND(STR(YEAR(?datetime)) AS ?years)
FILTER (?years != "0")
}
GROUP BY ?event
} ?event wdt:P664 / wdt:P21 ?gender .
}
GROUP BY ?year_ ?gender
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE,en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?count"):::projected
v3("?datetime")
v2("?event")
v5("?gender")
v7("?year")
v4("?year_"):::projected
v4("?years")
a1((" "))
c9(["bd:serviceParam"]):::iri
c3([http://www.wikidata.org/entity/Q6053150]):::iri
c11(["#91;AUTO_LANGUAGE,en"]):::literal
f0[["?years != '0'"]]
f0 --> v4
v2 --"wdt:P179"--> c3
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P585"--> v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P580"--> v3
end
union0r <== or ==> union0l
end
bind1[/"str(year-from-dateTime(?datetime))"/]
v3 --o bind1
bind1 --as--o v4
bind3[/"min(?years)"/]
v4 --o bind3
bind3 --as--o v4
v2 --"wdt:P664"--> a1
a1 --"wdt:P21"--> v5
bind5[/"count(?event)"/]
v2 --o bind5
bind5 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind6[/"str(?year_)"/]
v4 --o bind6
bind6 --as--o v7