SPARQL/Aggregate functions

Aggregate functions are used in combination with modifier.

Available aggregate functions are:
 * : the number of elements. You can also write  to simply count all results.
 * , : the sum or average of all elements, respectively. If the elements aren't numbers, you'll get weird results.
 * , : the minimum or maximum value of all elements, respectively. This works for all value types; numbers are sorted numerically, strings and other types lexically.
 * : any element. This is occasionally useful if you know there's only one result, or if you don't care which one is returned.
 * : concatenates all elements.

Aggregate functions with
See modifier  for examples.

When using aggregate functions of a label, all labels should be defined explicitly in the SERVICE.

Additionally, you can add a  modifier for any of these functions to eliminate duplicate results. For example, if there are two results but they both have the same value in, then   will return   but   will only return. You often have to use  when your query can return the same item multiple times – this can happen if, for example, you use , and there are multiple paths from   to  : you will get a new result for each of those paths, even though all the values in the result are identical. (If you're not grouping, you can also eliminate those duplicate results by starting the query with  instead of just  .)

Aggregate functions with
Aggregate functions can also be used with the  modifier.

See for instance this query to check for duplicate IATA codes for airports: