Element Types Reference
All model content in Farkitect is stored as elements with a discriminated kind field. This page describes each element kind.
Package
Section titled “Package”A container for organising other elements, diagrams, and catalogs.
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Display name |
| layer | ”M3” / “M2” / “M1” | Yes | MOF layer |
| packageKind | ”standard” / “common” | No | Package classification |
| isReadOnly | Boolean | No | Prevents modification |
| imports | String[] | No | Names of imported M2 packages |
Package roles (M2 only): elementTypes, elementTypeLayer, relationshipTypes, enumerations, views
Class (Element Type / Element Instance)
Section titled “Class (Element Type / Element Instance)”The primary element kind — used for both M2 type definitions and M1 instances.
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Display name |
| layer | ”M3” / “M2” / “M1” | Yes | MOF layer |
| classifierId | Reference | M1 only | Points to the M2 element type |
| isAbstract | Boolean | No | M2 only — hides from Palette |
| superclasses | Reference[] | No | M2 only — generalization |
| notation | Object | M2 only | Visual appearance definition |
| palette | Object | M2 only | Palette entry configuration |
At M2, a Class defines an element type with notation, properties, and constraints. At M1, a Class is an instance of an M2 type.
Property
Section titled “Property”A typed field definition owned by a Class (at M2 level).
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Property name |
| propertyType | String | Yes | Data type — primitive name or enumeration $id |
| multiplicity | [min, max] | Yes | [0,1] = optional, [1,1] = required |
| defaultValue | String | No | Default value for new instances |
| format | String | No | Format hint: “multiline”, “url”, “email” |
DataType
Section titled “DataType”A primitive data type definition (at M3 level).
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Type name (String, Integer, etc.) |
| primitiveKind | String | Yes | The primitive kind identifier |
Enumeration
Section titled “Enumeration”A type with a fixed set of named literal values.
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Enumeration name |
| literals | Array | Yes | List of {name, value} pairs |
Relationship
Section titled “Relationship”A directed connection between two elements.
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Display name / label |
| sourceId | Reference | Yes | Source element |
| targetId | Reference | Yes | Target element |
| classifierId | Reference | M1 only | Points to M2 relationship type |
At M2, a Relationship with kind.type = "Relationship" defines a relationship type. At M1, relationships are instances classified by M2 types.
Common Fields (All Elements)
Section titled “Common Fields (All Elements)”| Field | Type | Description |
|---|---|---|
| name | String | Display name |
| layer | ”M3” / “M2” / “M1” | MOF layer |
| packageId | Reference | Parent package |
| ownerId | Reference | Owner element (for owned/subordinate elements) |
| projectId | Reference | Project scope (undefined for system M2/M3) |
| audit | {createdAt, updatedAt} | Timestamps |