query-8a7b79313133d70bdd6554a5619d09d5

rq turtle/ttl

TODO

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
select ?no_of_citizenships (count(?item) as ?count) 
where
{

{select ?item (count(?citizen) as ?no_of_citizenships) where
        {
          ?item wdt:P31 wd:Q5.
          ?item wdt:P106 wd:Q2309784.
          optional {?item wdt:P27 ?citizen.}
          } group by ?item }  filter(?no_of_citizenships>2)
  } group by ?no_of_citizenships

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?citizen") v4("?count") v2("?item"):::projected v4("?no_of_citizenships"):::projected c3(["wd:Q5"]):::iri c5(["wd:Q2309784"]):::iri f0[["?no_of_citizenships > '2^^xsd:integer'"]] f0 --> v4 v2 --"wdt:P31"--> c3 v2 --"wdt:P106"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P27".-> v3 end bind2[/"count(?citizen)"/] v3 --o bind2 bind2 --as--o v4 bind4[/"count(?item)"/] v2 --o bind4 bind4 --as--o v4