Skip to main content

sum

Returns the sum of all numeric values in a specified column which are not unbound and can only be used with numeric data. data.world's sum differs from the default SPARQL sum in that it ignores unbound values. In standard SPARQL, if any of the values are unbound then the result is unbound.

Parameter

Type

Description

value

decimal, double

all of the values added together

Returns: decimal

Example

Query:

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

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

Run query

Result:

sum

107