query-8808974feefc13d4fb2f4f69c9c42b62

rq turtle/ttl

However, if BIND is used, the equivalent query times out

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT (COUNT(DISTINCT ?a) AS ?count) WHERE {
    BIND (wd:Q3305213 AS ?class) .
    ?a wdt:P31/wdt:P279* ?class .
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?a"):::projected v1("?class") v3("?count") a1((" ")) bind0[/"'wd:Q3305213'"/] bind0 --as--o v1 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> v1 bind2[/"count(?a)"/] v2 --o bind2 bind2 --as--o v3