SameTestProperties

SameTestProperties

is an option for set operations on entity classes whose setting gives the properties that are used to decide whether two given entities are the same.

Details

  • The default setting of SameTestProperties is Automatic. This means that equality between entities is defined as equality between Entity expressions as returned by EntityList with a single argument.
  • SameTestProperties{{prop11,prop12,},{prop21,prop22,},} means that propiα in classi has to be equal to all propjα in classj.
  • In UnionedEntityClass[,SameTestPropertiesFalse], no two entities are ever considered the same. The classes are effectively joined to one another.

Examples

open allclose all

Basic Examples  (4)

The default setting of Automatic compares Entity expressions:

With the default setting, different entity types are always considered to be different:

A movie and a book can be considered the same if they have the same "Name" property:

In UnionedEntityClass, you can set SameTestProperties to False to keep duplicate entries:

Scope  (1)

SameTestProperties is supported on SQL-backed entity stores:

Properties & Relations  (1)

SameTestProperties could be simulated less efficiently using SameTest:

However, the resulting entities will have the type of the first class, and because of that, only the properties of the first type:

Introduced in 2020
 (12.1)