EntityList

Listing of Entity Types »

EntityList[class]

gives a list of entities in the specified entity class.

EntityList["type"]

gives a list of entities of the specified type.

EntityList[class,simplify]

gives a list of entities; simplify determines whether to reduce entities to the simplest possible type.

Details

Examples

open allclose all

Basic Examples  (4)

Get a list of all countries:

Find all planets:

EntityList can also be used on EntityClass expressions:

EntityList can be used on many types of entity classes:

Use EntityList with a second argument to decide whether to simplify the entities:

Scope  (2)

EntityList can also be used on EntityClass expressions:

Some entity classes cannot be simplified:

Properties & Relations  (6)

EntityList can be used with FilteredEntityClass:

EntityList can be used with SampledEntityClass:

EntityList can be used with SortedEntityClass:

EntityList can be used with ExtendedEntityClass, but it will not simplify:

When other heads that can be simplified appear around ExtendedEntityClass, they will be simplified:

EntityList can be used with AggregatedEntityClass, but it will not simplify:

EntityList can be used with CombinedEntityClass, but it will not simplify:

Possible Issues  (3)

In general, it is best to avoid calling EntityList before EntityValue, as two separate calls will have to be performed:

This will have consequences in performance, and also in atomicity when dealing with external databases:

When EntityList returns a list of Entity objects with complex first arguments, those might stop existing if the data changes:

Update the value of "p1" so that the condition is no longer met:

When dealing with external databases, one might encounter a database where the primary key was not set for some tables:

When this happens, EntityStore will emit a message. This means that some functionality involving single entities will be disabled:

But EntityValue will generally keep working:

The only way around this problem is to set the primary key constraint in the external database.

Introduced in 2014
 (10.0)
 |
Updated in 2019
 (12.0)