Link Types

Typed relationships between ObjectTypes with cardinality constraints, directionality, and optional edge properties.

Builder Example

Rust
let controls = LinkType::builder("controls")
    .description("HVAC unit controls a zone")
    .source_type(hvac_type_id)
    .target_type(zone_type_id)
    .cardinality(Cardinality::OneToMany)
    .directionality(Directionality::Directed)
    .property(PropertyDef::new("priority", PropertyType::I64))
    .build();

let id = type_registry.register_link_type(controls)?;

Cardinality

VariantMeaningExample
OneToOneExactly one source → one targetFlight → Aircraft
OneToManyOne source → many targetsZone → HVAC Units
ManyToManyMany ↔ many (default)Train → Station

Directionality

VariantTraversal
DirectedSource → target only (default)
BidirectionalBoth directions traversable

Interfaces

Trait-like capability grouping. An Interface requires specific properties and actions to be present on implementing ObjectTypes.

Rust
let locatable = Interface::builder("Locatable")
    .description("Entity with geographic position")
    .require_property(PropertyDef::new("lat", PropertyType::F64).required())
    .require_property(PropertyDef::new("lon", PropertyType::F64).required())
    .require_action(move_action_id)
    .build();

Questions?

Reach out for help with integration, deployment, or custom domain codecs.