ExtendedEntityClass

ExtendedEntityClass[class,"name"f]

represents an entity class derived from class by adding a new computed property "name" whose value for each entity is obtained by applying the entity function f.

ExtendedEntityClass[class,{"name1"f1,"name2"f2,}]

adds the properties namei defined by the functions fi.

Details

  • In ExtendedEntityClass[class,"name"->f], the function f must be an EntityFunction object.
  • ExtendedEntityClass works with any EntityStore object, whether defined explicitly or based on a RelationalDatabase object.
  • ExtendedEntityClass[class,"new"->f] effectively represents a virtual database table derived from class, with a new column named new added, with values f[entityi] for each entity entityi.
  • For an extended entity class ExtendedEntityClass[class,"new"->f], the full name of the new property added is EntityProperty[ExtendedEntityClass[class,"new"f],"new"].
  • ExtendedEntityClass[class,"new"->f] adds a new computed property even if class already has a property whose name is "new". In this case, however, the new computed property must be referred to using the full name EntityProperty[ExtendedEntityClass[class,"new"f],"new"].
  • If the name of a new property does not conflict with the names of any existing properties, then EntityValue[class,"new"] can be used to get values of the new property.

Examples

open all close all

Basic Examples  (3)

Use ExtendedEntityClass to add a computed property to a class of entities:

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

Add an alias for a property:

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

When used with relational-database-backed entities, ExtendedEntityClass is equivalent to adding an expression in the SELECT statement:

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

Scope  (1)

Applications  (1)

Possible Issues  (1)

Neat Examples  (1)

Introduced in 2019
(12.0)