query-9c23a93161314579d454a8a6e2dcf6ac

rq turtle/ttl

The component queries seem to execute speedily

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
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

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?count"):::projected v5("?fnumber") v1("?g"):::projected v2("?item") v3("?p") c2(["wd:Q177220"]):::iri bind0[/VALUES ?g/] bind0-->v1 bind00(["wd:Q6581072"]) bind00 --> bind0 v2 --"wdt:P106"--> c2 v2 --"wdt:P451"--> v3 v2 --"wdt:P21"--> v1 bind2[/"count(?p)"/] v3 --o bind2 bind2 --as--o v4 bind4[/"count(?count)"/] v4 --o bind4 bind4 --as--o v5