Wolfram Language

Aggregates for Entities

Aggregation is the process of reducing a list of values to a single value. Before aggregating, the list can be divided into chunks by grouping by a value. Here SPARQL is used to query and aggregate values.

To find the total population of all countries, first define a query that retrieves all country-population pairs.

Now compose (using RightComposition) this query with the SPARQLAggregate operator and apply the complete query to the "Country" entity domain.

To get the total population per continent, first define a query that retrieves, for all countries, both population and continent.

Then compose this query with an aggregate that specifies a group condition.

Make a Dataset.

Related Examples

de es fr ja ko pt-br zh