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