Count the number of distinct literals used in the object position of triples (in a pre bound graph) (qlever optimized form)
SELECT
(COUNT(?object) AS ?objects)
WHERE {
{
SELECT DISTINCT ?object {
GRAPH ?graph {
?subject ?predicate ?object .
FILTER (isLiteral(?object))
}
}
}
}
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?graph")
v1("?object"):::projected
v5("?objects")
v3("?predicate")
v2("?subject")
f0[["isLiteral(?object)"]]
f0 --> v1
v2 -->v3--> v1
bind2[/"count(?object)"/]
v1 --o bind2
bind2 --as--o v5