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 allclose all

Basic Examples  (3)

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

An equivalent computation, suitable for small datasets:

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

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

Compute the total amount of payments:

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

Scope  (2)

The third argument can be an EntityFunction:

Apply a function to the result, typically an aggregation function:

Use this to compute the mean value of the result:

Or create a pie chart with the result:

Properties & Relations  (2)

AggregatedEntityClass generates entities that correspond to groups:

Single entities obtained from AggregatedEntityClass effectively correspond to implicit entities:

Wolfram Research (2019), AggregatedEntityClass, Wolfram Language function, https://reference.wolfram.com/language/ref/AggregatedEntityClass.html.

Text

Wolfram Research (2019), AggregatedEntityClass, Wolfram Language function, https://reference.wolfram.com/language/ref/AggregatedEntityClass.html.

CMS

Wolfram Language. 2019. "AggregatedEntityClass." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AggregatedEntityClass.html.

APA

Wolfram Language. (2019). AggregatedEntityClass. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AggregatedEntityClass.html

BibTeX

@misc{reference.wolfram_2023_aggregatedentityclass, author="Wolfram Research", title="{AggregatedEntityClass}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/AggregatedEntityClass.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_aggregatedentityclass, organization={Wolfram Research}, title={AggregatedEntityClass}, year={2019}, url={https://reference.wolfram.com/language/ref/AggregatedEntityClass.html}, note=[Accessed: 19-March-2024 ]}