AggregatedEntityClass

AggregatedEntityClass[class,"prop"f]

represents an entity class containing a single entity with the property prop whose value is the result of applying the function f to the whole specified entity class.

AggregatedEntityClass[class,{"prop1"f1,"prop2"f2,}]

constructs multiple properties propi obtained by applying fi to class.

AggregatedEntityClass[class,propspec,gprop]

forms groups of elements of class according to their values of the property gprop, then generates an entity class with an entity for each of these groups.

AggregatedEntityClass[class,propspec,"pname"f]

forms groups according to the values obtained by applying the entity function f, with the resulting property named pname.

AggregatedEntityClass[class,propspec,{gspec1,gspec2,}]

forms groups for which the set of values defined by the gspeci is distinct.

Details

Examples

open all close all

Basic Examples  (3)

Create an aggregation of all countries and compute their total area:

In[1]:=
Click for copyable input
Out[1]=

An equivalent computation, suitable for small datasets:

In[2]:=
Click for copyable input

Find the mean atomic mass for elements in each period class:

In[1]:=
Click for copyable input
Out[1]=

When used with relational-database-backed entities, a two-argument AggregatedEntityClass corresponds to using aggregate functions in the SELECT statement:

In[1]:=
Click for copyable input
Out[1]=

Compute the total amount of payments:

In[2]:=
Click for copyable input
Out[2]=

Compute the maximum credit limit by country (similar to a GROUP BY statement in SQL languages):

In[3]:=
Click for copyable input
Out[3]=

Scope  (2)

Properties & Relations  (2)

Introduced in 2019
(12.0)