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.

Returns: any

Table 1.

Parameter

Type

Description

value

any

The values to be counted.



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 ]
}

Try the query

Table 1. Results

approx_distinct

5