Skip to main content

approx_distinct

approx_distinct calculates an approximate count of the number of distinct values. It provides an approximation to count(distinct) but is much faster. approx_distinct should produce a standard error of 2.3%, the standard deviation of the error distribution over all input sets. approx_distinct does not guarantee a bound on the error for any specific input set.

Parameter

Type

Description

value

any

the values to be counted

Returns: any

Example

Query:

PREFIX : <https://ddw-doccorp.linked.data.world/d/sparql-aggregation-sample-queries/>
PREFIX agg: <http://data.world/function/aggregate#>

SELECT (agg:approx_median(?foo) AS ?approx_median)
{
    [ :col-aggregations-foo ?foo ]
}

Run query

Result:

approx_distinct

5