query-862a70d5639810d68eeb7954c1882b74
title:Distribuzione tipografi e tipografe per paese e città SELECT DISTINCT ?paeseLabel ?luogolavLabel (COUNT (?uomini) AS ?n_uomini) (COUNT (?donne) AS ?n_donne) WHERE { ?tipograf wdt:P31 wd:Q5; wdt:P937 ?luogolav; wdt:P106 ?activity . values ?activity { wd:Q175151 wd:Q1229025 wd:Q998550 wd:Q2516866 wd:Q40881196 } ?luogolav wdt:P17 ?paese OPTIONAL { ?tipograf wdt:P21 wd:Q6581097 . BIND("uomini" as ?uomini) } OPTIONAL { ?tipograf wdt:P21 wd:Q6581072 . BIND("donne" as ?donne) }
SERVICE wikibase:label { bd:serviceParam wikibase:language "it, en". } } GROUP BY ?paeseLabel ?luogolavLabel ORDER BY DESC (?n_donne)
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 bd: <http://www.bigdata.com/rdf#>
#title:Distribuzione tipografi e tipografe per paese e cittÃ
SELECT DISTINCT ?paeseLabel ?luogolavLabel (COUNT (?uomini) AS ?n_uomini) (COUNT (?donne) AS ?n_donne) WHERE {
?tipograf wdt:P31 wd:Q5; wdt:P937 ?luogolav; wdt:P106 ?activity .
values ?activity { wd:Q175151 wd:Q1229025 wd:Q998550 wd:Q2516866 wd:Q40881196 }
?luogolav wdt:P17 ?paese
OPTIONAL { ?tipograf wdt:P21 wd:Q6581097 . BIND("uomini" as ?uomini) }
OPTIONAL { ?tipograf wdt:P21 wd:Q6581072 . BIND("donne" as ?donne) }
SERVICE wikibase:label { bd:serviceParam wikibase:language "it, en". }
}
GROUP BY ?paeseLabel ?luogolavLabel
ORDER BY DESC (?n_donne)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?activity")
v7("?donne"):::projected
v3("?luogolav")
v9("?n_donne")
v8("?n_uomini")
v5("?paese")
v2("?tipograf")
v6("?uomini"):::projected
c10(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c7(["wd:Q6581097"]):::iri
c8(["wd:Q6581072"]):::iri
c12(["it, en"]):::literal
v2 --"wdt:P31"--> c2
v2 --"wdt:P937"--> v3
v2 --"wdt:P106"--> v5
bind0[/VALUES ?activity/]
bind0-->v5
bind00(["wd:Q175151"])
bind00 --> bind0
bind01(["wd:Q1229025"])
bind01 --> bind0
bind02(["wd:Q998550"])
bind02 --> bind0
bind03(["wd:Q2516866"])
bind03 --> bind0
bind04(["wd:Q40881196"])
bind04 --> bind0
v3 --"wdt:P17"--> v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P21".-> c7
bind1[/"'uomini'"/]
bind1 --as--o v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P21".-> c8
bind2[/"'donne'"/]
bind2 --as--o v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind5[/"count(?uomini)"/]
v6 --o bind5
bind5 --as--o v8
bind6[/"count(?donne)"/]
v7 --o bind6
bind6 --as--o v9