How to use ExtendedEntityClass and Implicit Entity Class in 13.2.1
How to use ExtendedEntityClass and Implicit Entity Class in 13.2.1
Today, I revisited the Entity Framework to compute certain properties.
In Mathematica version 12 we could define an ExtendedEntityClass and use an implicitly defined entity class to filter certain properties.
In version 13, this will give errors and no result.
In Mathematica version 12 we could define an ExtendedEntityClass and use an implicitly defined entity class to filter certain properties.
In version 13, this will give errors and no result.
Example
Example
Find the first 5 countries in Europe with the largest population density.
The approach in version 12 was:
Define an ExtendedEntityClass by adding a new computed property named “PopDensity” (to distinguish it from the built-in “PopulationDensity” EntityProperty) with the EntityFunction.
Define an implicity defined EntityClass based on the ExtendedEntityClass where we will take the largest 5 PopDensity.
Get the PopDensity as an EntityAssociation.
A picture of the expressions and its result when run on Mathematica version 12, is shown below:
The approach in version 12 was:
Define an ExtendedEntityClass by adding a new computed property named “PopDensity” (to distinguish it from the built-in “PopulationDensity” EntityProperty) with the EntityFunction.
Define an implicity defined EntityClass based on the ExtendedEntityClass where we will take the largest 5 PopDensity.
Get the PopDensity as an EntityAssociation.
A picture of the expressions and its result when run on Mathematica version 12, is shown below:
Result in version 12
Result in version 12
Issue in version 13
Issue in version 13
In version 13, the operation gives errors and no result:
In[]:=
data=ExtendedEntityClass,"PopDensity"->EntityFunctiona,aa;EntityClass[data,{"PopDensity"->TakeLargest[5]}]["PopDensity","EntityAssociation"]
Out[]=
EntityClassExtendedEntityClass,PopDensityEntityFunctiona,,{PopDensityTakeLargest[5]}[PopDensity,EntityAssociation]
a
a
Workaround
Workaround
The following is a workaround in version 13 :
In[]:=
ExtendedEntityClass,"PopDensity"->EntityFunctiona,aa["PopDensity","EntityAssociation"]//TakeLargest[5]//ReverseSort
Out[]=
,,,,
Is this an issue or am I missing some changes in version 13?
Mathematica Version
Out[]=
13.2.1 for Microsoft Windows (64-bit) (January 27, 2023)

