query-419cab014db4a9ca2f2909302747d70f

rq turtle/ttl

Query 2: counting only, works with 260k items SELECT (COUNT(*) as ?ct) { ?item wdt:P31 wd:Q5 OPTIONAL { ?item wdt:P21 ?dummy } FILTER(!bound(?dummy) ) }

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#Query 2: counting only, works with 260k items
SELECT (COUNT(*) as ?ct)
{
  ?item wdt:P31 wd:Q5
  OPTIONAL { ?item wdt:P21 ?dummy } FILTER(!bound(?dummy) ) 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?ct") v1("?dummy") v2("?item") c2(["wd:Q5"]):::iri f0[["not bound(?dummy)"]] f0 --> v1 v2 --"wdt:P31"--> c2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P21".-> v1 end bind2[/"count(*)"/] bind2 --as--o v3