Skip to main content

count_if

Aggregates boolean values. Returns the number of TRUE boolean values.

Parameter

Type

Description

value

boolean

The values to count

Returns: integer

Example

Query:

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

SELECT (agg:countIf(?foo > 3) AS ?count_if)
{
    [ :col-aggregations-foo ?foo ]
}

Run query

Result:

count_if

4