void-generator

count_distinct_literal_objects

rq turtle/ttl

Count the number of distinct Literals used in the object position of triples in the default graph

Use at


SELECT
    (COUNT(DISTINCT ?object) AS ?objects)
WHERE {
    ?subject ?predicate ?object .
    FILTER(isLiteral(?object))
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v1("?object"):::projected 
  v4("?objects")
  v3("?predicate")
  v2("?subject")
  f0[["isLiteral(?object)"]]
  f0 --> v1
  v2 -->v3--> v1
  bind2[/"count(?object)"/]
  v1 --o bind2
  bind2 --as--o v4