The Entity statement declares an entity and introduces further statements that describe it in detail.
Index : Count
Index : Limit
Attributes, otherwise known as Entity Data, represent characteristics of the entity. Each attribute has an associated data domain type that defines the nature of the attribute and the range of values it may take on. This statement is optional.
Signals --> Pong
All relationships between objects are defined as unary relationships. They only define the relationship one way unlike associations which describe binary relationships. Two way relationships are achieved by simply specifying the reverse relationship in the other entity. This statement is optional.
A relationship is composed of a role such as "Owned by" followed by a relation type (as described below) and the target entity. No single object can be related more than once to the same object through the same role.
All specified relationships must be navigated.
Owns ->> Account
Governed_by --> Bank_Policy
Relationships are navigated in creation order. Currently, it is not possible to define an ordered relationship, but this will be implemented in due course.
In order of relationship "tightness", the permitted relationship types are:
|>> - Many Conditional - Each object in the source entity may be related to one or more objects in the target entity.
-|> - One Conditional - Each object in the source entity may be related to only one object in the target entity.
->> - Many Unconditional - Each object in the source entity must be related to one or more objects in the target entity.
--> - One Unconditional - Each object in the source entity must be related to only one object in the target entity.
>>> - All Unconditional - Each object in the source entity must be related to all objects in the target entity. This feature is undergoing consideration for inclusion into the language.
The NullEntity statement declares the entities in a domain that are without attributes, relationships or states. An object of the entity will have the single implicit state of "Exists" that all passive entities possess as default.
The minimum amount of work required to create an entity object is simply to give it a name. As the object has no outgoing relationships, it follows that it must have at least one incoming relationship from another object. This leads to the question of what is the use of such a object that lies at the end of a relation?
Any number of objects can be associated with a null entity. These can be created as usual via the CreatePassive or Object statements, but there is no way of distinguishing between the objects.
Although these objects are consistent within the Matrix language, unfortunately these non-unique objects break the rules of relational database theory. But by limiting the number of objects that belong to a null entity to one makes it consistent with that too.
However, since there can exist a link relation with a specific null object from another non-null object, it can be found and therefore identified from the other null objects contained by the null entity.