Count the number of distinct IRIs used in the object position of triples in graphs
SELECT
(COUNT(DISTINCT ?s) AS ?subjects)
(COUNT(DISTINCT ?o) AS ?objects)
WHERE {
?s ?p ?o .
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?o"):::projected
v5("?objects")
v2("?p")
v1("?s"):::projected
v4("?subjects")
v1 -->v2--> v3
bind2[/"count(?s)"/]
v1 --o bind2
bind2 --as--o v4
bind3[/"count(?o)"/]
v3 --o bind3
bind3 --as--o v5