-
Notifications
You must be signed in to change notification settings - Fork 1
BaseTypes and BaseValues
Each BaseType (except ValueType) has a corresponding definer function, named define_<BaseTypeName>_type, which creates new types derived from that base. Examples include:
define_holon_typedefine_property_typedefine_string_type
Each definer accepts a specification struct, conventionally named <BaseTypeName>Spec, which includes the property values and relationships needed to define the new type. This struct provides the type-specific fields needed to characterize the new type.
Every MAP type is represented by a TypeHeader holon and an associated <BaseTypeName>Type holon that specifies base-type-specific details.
Together, the TypeHeader and <BaseTypeName>Type holons define the identity, structure, and constraints of a given type.
- Is a Holon described by the
TypeHeaderCore HolonType - Is OWNED_BY a
HolonSpace - Is a COMPONENT_OF a
Schema - Includes shared properties such as:
type_namelabeldescription-
base_type(aBaseTypevariant)
- Contains type-specific metadata or constraints
e.g. min/max for an integer, allowed variants for an enum, source/target types for a relationship
Together, they fully characterize the type and are created as a pair by the relevant definer function.
For types that involve scalar values, a third holon may participate in defining the type: a ValueType holon.
A complete type descriptor for a value-bearing type may involve:
-
TypeHeaderHolon — defines the identity and shared metadata (e.g., name, schema, ownership) -
<BaseTypeName>TypeHolon — defines type-specific structure (e.g., constraints) -
ValueTypeHolon — identifies the type as a scalar value type and serves as the target for relationships likeVALUE_TYPE_FORused in properties
This triad ensures that type definitions are:
- Modular (each aspect is clearly isolated)
- Compositional (components can be reused and extended)
- Queryable (all aspects live as holons with relationships)
The MAP Type System is structured in five layers, each building upon the one below it. This layered approach allows the system to evolve from simple, portable primitives into semantically rich, application-specific types — while preserving portability, extensibility, and validation guarantees.
| Layer | Role | Examples |
|---|---|---|
| Layer 1 | Portable, low-level types & runtime values |
BaseType::Value(String), MapInteger
|
| Layer 2 | Semantically meaningful core primitives |
HolonId, PropertyName, ValueType
|
| Layer 3 | Metadata & constraints for validating Layer 1/2 |
IntegerDescriptorType, StringDescriptorType
|
| Layer 4 | Reserved descriptors required by the MAP core |
PropertyNameType, SemanticVersionType
|
| Layer 5 | Agent-defined extension descriptors | Custom enum types, string formats, etc |
This multi-layered design enables strong typing, semantic expressiveness, and schema extensibility — from core infrastructure to custom applications.
BaseType and BaseValue represent the most primitive and portable types in the MAP system. These types form the foundation of all other types.
The BaseType enum specifies the full range of types the MAP is capable of storing and manipulating. This includes both structural and scalar types.
HolonCollectionPropertyRelationshipEnumVariantValue(ValueType)ValueArray(ValueType)
These are used in the description of a type to declare the intended storage representation for instances of the described type.
The BaseValue enum holds actual values of scalar ValueTypes:
StringValue(MapString)IntegerValue(MapInteger)BooleanValue(MapBoolean)EnumValue(MapEnumValue)
Each variant wraps a strongly-typed struct, ensuring consistent formatting, serialization, and conversion.
CoreTypes build upon BaseTypes to define semantically meaningful types used within the MAP core code.
- Always built using a
BaseTypeto ensure portability. - Represent common, semantically enriched primitives, such as names and identifiers.
- Used to parameterize descriptors, holon types, or system APIs.
PropertyName is a CoreType used throughout the MAP to name properties in a holon schema.
-
BaseType:
Value(ValueType::String) -
ValueType:
String -
Stored as:
BaseValue::StringValue(MapString)
This means:
- It is a scalar value, validated and constrained as a string.
- Its underlying value is stored using the
MapStringwrapper. - It can have additional constraints (like format or length) defined via a corresponding
DescriptorType.
In short:
PropertyNameis aValueType::Stringtype whose values are stored asBaseValue::StringValue(MapString).
MaxLength is a CorePropertyType used to define the maximum allowed length of a string-based value type (e.g., StringValueType).
-
BaseType:
Property -
ValueType:
Integer -
Stored as:
BaseValue::IntegerValue(MapInteger)
This means:
- It defines a property on a DescriptorType holon, not on a user-facing data holon.
- The value stored is an integer wrapped in
MapInteger. - It is typically used within a
StringDescriptorTypeto constrainMapStringvalues.
In short:
MaxLengthis a property whose values are stored asBaseValue::IntegerValue(MapInteger)and apply to types that areValueType::String.
SourceHolonType is a CoreRelationshipType used in a relationship descriptor to define which holon type is allowed to appear on the source side of a relationship.
-
BaseType:
Relationship -
Target Type:
HolonType -
Cardinality: Typically
exactly one(but defined per descriptor)
This means:
- The relationship originates from a relationship descriptor and points to a specific holon type (i.e., the type of the source holon in an actual relationship instance).
- It enables the MAP to validate whether a given relationship is well-formed based on its direction and endpoint types.
- It supports schema introspection: "What types of holons can originate this relationship?"
In short:
SourceHolonTypeis a relationship from aRelationshipDescriptorto aHolonType, used to define valid sources for that relationship.
CoreTypes are grouped by their function using the CoreType enum. Numbers in parentheses indicate the current number of types per group:
-
DanceType(TBD) -
EnumVariantType(16) -
HolonType(24) -
IndexedType(2) -
PropertyType(24) -
RelationshipType(27) -
ValueType(8)
DescriptorTypes specify metadata and constraints for types defined in Layers 1 and 2. Every BaseType has a corresponding DescriptorType.
- Describe how to validate and render values of a given type.
- Support properties like:
- Minimum/maximum length or value
- Formatting or pattern constraints
- Human-readable names, descriptions, and labels
-
IntegerDescriptorType: definesmin_value,max_valuefor integers. -
StringDescriptorType: definesmin_length,max_length,string_format.
CoreDescriptorTypes are reserved descriptor types that are required by the MAP core. They define constraints and metadata for types like HolonId, PropertyName, and SemanticVersion.
- Not user-extensible.
- Used internally to ensure system-wide consistency and compatibility.
- Often reused across multiple CoreTypes.
pub enum CoreStringDescriptorType {
#[default]
MapStringType,
PropertyNameType,
RelationshipNameType,
SemanticVersionType,
}ExtensionDescriptorTypes allow developers to define custom, agent-specific types dynamically — without modifying or recompiling the MAP core.
- Created and managed by agents to support their own data and application logic.
- Not part of the MAP core and do not require core approval or versioning.
- Can be added or updated without recompilation of MAP code or schema migrations.
- Live as holons in the MAP just like core descriptors.
- Support user-defined:
- Metadata
- Validation rules
- Semantic annotations
- Relationships to other types or schemas
- Agents cannot reuse names of any CoreDescriptorType (e.g.,
PropertyNameType) to avoid namespace collisions.