query-ef8b2c4f1998f601bfdab1a9d0020709
Propertiesposition held (P39)occupation (P106)subclass of (P279)
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#>
select ?parliament ?parliamentLabel ?job ?jobLabel ?s
WHERE{
{
SELECT ?parliament (MAX(?sens) AS ?s) WHERE{
{
SELECT (COUNT(?sen) AS ?sens) ?job ?parliament WHERE {
?sen wdt:P39 ?parliament;
wdt:P106 ?job.
?parliament wdt:P279* wd:Q486839
FILTER (?job != wd:Q82955)
} GROUP BY ?job ?parliament HAVING (?sens > 1)
} } GROUP BY ?parliament
}
{
SELECT (COUNT(?sen) AS ?sens) ?job ?parliament WHERE {
?sen wdt:P39 ?parliament;
wdt:P106 ?job.
?parliament wdt:P279* wd:Q486839
FILTER (?job != wd:Q82955)
} GROUP BY ?job ?parliament HAVING (?sens > 1)
} FILTER(?s = ?sens)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY DESC(?s)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?job"):::projected
v5("?parliament"):::projected
v6("?s"):::projected
v4("?sen")
v6("?sens")
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q486839"]):::iri
f0[["?s = ?sens"]]
f0 --> v6
f0 --> v6
f1[["?sens > '1^^xsd:integer'"]]
f1 --> v6
f2[["?job != 'wd:Q82955'"]]
f2 --> v3
v4 --"wdt:P39"--> v5
v4 --"wdt:P106"--> v3
v5 --"wdt:P279"--> c6
bind4[/"count(?sen)"/]
v4 --o bind4
bind4 --as--o v6
bind6[/"max(?sens)"/]
v6 --o bind6
bind6 --as--o v6
f7[["?sens > '1^^xsd:integer'"]]
f7 --> v6
f8[["?job != 'wd:Q82955'"]]
f8 --> v3
v4 --"wdt:P39"--> v5
v4 --"wdt:P106"--> v3
v5 --"wdt:P279"--> c6
bind10[/"count(?sen)"/]
v4 --o bind10
bind10 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end