void-generator

find_predicates_count_objects

rq turtle/ttl

Count the number of distinct IRIs used in the object position of triples in graphs

Use at

SELECT 
  ?predicate
  (COUNT(?object) AS ?count) 
WHERE { 
  GRAPH ?graph { 
    ?subject ?predicate ?object
  }
} GROUP BY ?predicate
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?count")
  v4("?graph")
  v3("?object"):::projected 
  v2("?predicate"):::projected 
  v1("?subject")
  v1 -->v2--> v3
  bind1[/"count(?object)"/]
  v3 --o bind1
  bind1 --as--o v5