Count the number of distinct Blanknodes used in the subject position of triples in the default graph
SELECT
(COUNT(DISTINCT ?subject) AS ?subjects)
WHERE {
?subject ?predicate ?object .
FILTER(isBlank(?subject))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?object")
v2("?predicate")
v1("?subject"):::projected
v4("?subjects")
f0[["isBlank(?subject)"]]
f0 --> v1
v1 -->v2--> v3
bind2[/"count(?subject)"/]
v1 --o bind2
bind2 --as--o v4