Model: Property Type

Components, entity types and relation types define which properties they contain. The so-called property types define the name, the data type and whether the property is an input or an output.

Data Model

FieldDataTypeDescriptionExample
NameStringThe name of the propertyname
DescriptionStringTextual description of the propertyThe name of something.
DataTypeDataTypeThe data type of the propertystring
SocketTypeSocketTypeThe socket typeinput
MutabilityMutabilityDefines if the property is mutable or immutableimmutable
ExtensionsVec<Extension>The extensions contains additional information about the property type

ER Diagram

erDiagram
    Property-Type {
        string name
        string description
        enum DataType
        enum SocketType
        enum Mutability
    }
    Extension {
        string namespace
        string name
        JSON extension
    }
    Property-Type ||--}o Extension : has
    Component ||--}o Property-Type : defines
    Entity-Type ||--}o Property-Type : defines
    Relation-Type ||--}o Property-Type : defines
    Flow-Type ||--}o Property-Type : defines

Enum Data Type

A property has a data type. This is derived from serde_json::Value and maps JSON values or documents.

ValueDescription
NullRepresents a JSON null value
BoolRepresents a JSON boolean
NumberRepresents a JSON number, whether integer or floating point
StringRepresents a JSON string
ArrayRepresents a JSON array.
ObjectRepresents a JSON object.
AnyRepresents any type (relations)

Enum Socket Type

The socket type determines whether a property serves as an input or an output. It is also possible that a property is neither an input nor an output. Caution: At runtime, it is not prevented if an input is used as an output or an output is used as an input.

ValueDescription
NoneThe property doesn't act as input or output socket
InputThe property acts as input socket and accepts incoming connections
OutputThe property acts as output socket and accepts outgoing connections

Enum Mutability

Defines if the property is either mutable or immutable.

ValueDescription
MutableThe property is mutable
ImmutableThe property is immutable

Where is the value???

A property type only contains the definition of a property, but no data, since it is a type.

When an entity instance or a relation instance is created, the property types are used to create property instances. The property instances then contain a data stream and the last value.