You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following SPARQL query allows to fetch the number of distinct subjects in the database:
SELECT (COUNT(DISTINCT ?s) as ?count) WHERE {
?s ?p ?o .
}
However, there's doesn't seem to be a way to translate that query in HSparql.
An equivalent way would be to translate it as a sub query such as:
SELECT (COUNT(?s) as ?count) WHERE {
SELECT DISTINCT ?s WHERE {
?s ?p ?o .
}
}
Which can be translated to HSparql as:
countSubjsQuery :: Query SelectQuery
countSubjsQuery = do
s <- var
p <- var
o <- var
subQuery_ $ do
triple_ s p o
distinct_
selectVars [s]
c <- var
select [count r `as` c]
Possible enhancement in order to use the distinct function with the count function to produce a SPARQL query similar to the first one ?
The text was updated successfully, but these errors were encountered:
The following SPARQL query allows to fetch the number of distinct subjects in the database:
However, there's doesn't seem to be a way to translate that query in HSparql.
An equivalent way would be to translate it as a sub query such as:
Which can be translated to HSparql as:
Possible enhancement in order to use the
distinct
function with thecount
function to produce a SPARQL query similar to the first one ?The text was updated successfully, but these errors were encountered: