query-db4f42ea2521ce952e2bf90ab470cfc6
TimeoutWhat's wrong with this?
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?count ?fnumber ?mnumber
WHERE
{
{
SELECT ?count ?g (count(?count) as ?fnumber) WHERE {
SELECT ?item ?g (count(?p) as ?count) WHERE
{
VALUES ?g {wd:Q6581072}
?item wdt:P106 wd:Q177220 .
?item wdt:P451 ?p.
?item wdt:P21 ?g.
} group by ?item ?g } group by ?count ?g }
{
SELECT ?count ?g (count(?count) as ?mnumber) WHERE {
SELECT ?item ?g (count(?p) as ?count)
WHERE
{
VALUES ?g {wd:Q6581097}
?item wdt:P106 wd:Q177220 .
?item wdt:P451 ?p.
?item wdt:P21 ?g.
} group by ?item ?g } group by ?count ?g }}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?count"):::projected
v5("?fnumber"):::projected
v6("?g")
v2("?item")
v6("?mnumber"):::projected
v3("?p")
c2(["wd:Q177220"]):::iri
bind0[/VALUES ?g/]
bind0-->v6
bind00(["wd:Q6581072"])
bind00 --> bind0
v2 --"wdt:P106"--> c2
v2 --"wdt:P451"--> v3
v2 --"wdt:P21"--> v6
bind2[/"count(?p)"/]
v3 --o bind2
bind2 --as--o v6
bind4[/"count(?count)"/]
v6 --o bind4
bind4 --as--o v5
bind5[/VALUES ?g/]
bind5-->v6
bind50(["wd:Q6581097"])
bind50 --> bind5
v2 --"wdt:P106"--> c2
v2 --"wdt:P451"--> v3
v2 --"wdt:P21"--> v6
bind7[/"count(?p)"/]
v3 --o bind7
bind7 --as--o v6
bind9[/"count(?count)"/]
v6 --o bind9
bind9 --as--o v6