query-ca100cb37e86764aee878368d28bb6aa
TODO
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?occupation ?occupationLabel (COUNT(?occupation) AS ?count) WHERE{
?person wdt:P31 wd:Q5;
wdt:P106 ?occupation;
wdt:P569 ?birth.
FILTER(
(("1900-10-22"^^xsd:date <= ?birth) && (?birth < "1900-11-23"^^xsd:dat)) ||
(("1901-10-22"^^xsd:date <= ?birth) && (?birth < "1901-11-23"^^xsd:dat)) ||
(("1902-10-22"^^xsd:date <= ?birth) && (?birth < "1902-11-23"^^xsd:dat)) ||
(("1903-10-22"^^xsd:date <= ?birth) && (?birth < "1903-11-23"^^xsd:dat)) ||
(("1904-10-22"^^xsd:date <= ?birth) && (?birth < "1904-11-23"^^xsd:dat)) ||
(("1905-10-22"^^xsd:date <= ?birth) && (?birth < "1905-11-23"^^xsd:dat)) ||
(("1906-10-22"^^xsd:date <= ?birth) && (?birth < "1906-11-23"^^xsd:dat)) ||
(("1907-10-22"^^xsd:date <= ?birth) && (?birth < "1907-11-23"^^xsd:dat)) ||
(("1908-10-22"^^xsd:date <= ?birth) && (?birth < "1908-11-23"^^xsd:dat)) ||
(("1909-10-22"^^xsd:date <= ?birth) && (?birth < "1909-11-23"^^xsd:dat)) ||
(("1910-10-22"^^xsd:date <= ?birth) && (?birth < "1910-11-23"^^xsd:dat))).
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
}
GROUP BY ?occupation ?occupationLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?birth")
v5("?count")
v4("?occupation"):::projected
v3("?person")
c28(["bd:serviceParam"]):::iri
c30(["#91;AUTO_LANGUAGE#93;"]):::literal
c24(["wd:Q5"]):::iri
f0[["('1900-10-22^^xsd:date' <= ?birth?birth < s1900-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || ('1901-10-22^^xsd:date' <= ?birth?birth < s1901-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || ('1902-10-22^^xsd:date' <= ?birth?birth < s1902-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || ('1903-10-22^^xsd:date' <= ?birth?birth < s1903-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || ('1904-10-22^^xsd:date' <= ?birth?birth < s1904-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || ('1905-10-22^^xsd:date' <= ?birth?birth < s1905-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || ('1906-10-22^^xsd:date' <= ?birth?birth < s1906-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || ('1907-10-22^^xsd:date' <= ?birth?birth < s1907-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || ('1908-10-22^^xsd:date' <= ?birth?birth < s1908-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || ('1909-10-22^^xsd:date' <= ?birth?birth < s1909-11-23^^<http://www.w3.org/2001/XMLSchema#dat>' || '1910-10-22^^xsd:date' <= ?birth?birth < s1910-11-23^^<http://www.w3.org/2001/XMLSchema#dat>'))))))))))"]]
f0 --> v2
v3 --"wdt:P31"--> c24
v3 --"wdt:P106"--> v4
v3 --"wdt:P569"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c28 --"wikibase:language"--> c30
end
bind2[/"count(?occupation)"/]
v4 --o bind2
bind2 --as--o v5