Core Principles
Everything Is an Entity
Entity Types
An EntityType defines the schema for a class of entities. It is itself an entity of type entitytype/entitytype, which means it is created, versioned, and queried through the same API as any other entity.
Property Types
A PropertyType defines the data type and validation constraints of a property. All concrete property types inherit from the base property_type entity type. Property types are reusable -- define one once and attach it to many entity types.
Lists, Enums & Virtual Properties
Lists
Components (Structured Entities)
An entity type can own embedded, typed sub-entities via has_component. Such an entity is called a structured entity.
Relationship Types
A RelationshipType defines a typed, directional connection between entities. Because relationships are themselves entities (of type entitytype/relationshiptype), they can carry their own properties (edge properties) and participate in further relationships.
Variation Points
A variation point is a typed placeholder: an entity with its own permanent identity that says "in my place, something else should be". In the API it is called a variant (variant); in the source code it is also known as a ghost entity.
Actions & Hooks
Entity types can declare callable actions via hasaction and lifecycle hooks via hashook. Both point to an action entity (or one of its subtypes). Actions provide a mechanism to execute logic in the context of an entity -- either as inline Lua scripts or as calls to external HTTP services.
Traits
Traits are dynamic mixins that can be attached to any entity instance regardless of its type. Unlike properties and relationships declared on the entity type, traits are not part of the type schema -- they are added at the instance level.
Lifecycle
Entity types can be assigned a lifecycle map via haslcmap, governing the valid states and transitions of their instances. The lifecycle system controls which entities are considered released, which are read-only, and which state changes are permitted.
Branching & Version Numbers
EP keeps every saved change as an immutable commit. On top of that, two optional mechanisms organise the history of an entity:
Lua Scripting
Several features in the platform evaluate Lua scripts at runtime. Scripts are used to compute entity keys, display labels and virtual property values, and to implement actions and lifecycle hooks. All scripts receive the current entity instance via the self variable.