Skip to content

Metamodel

Goal

Define an architecture to represent a breadth of real-world entities as structured data (models). Specify four operations to act on models: create, read, update and delete (CRUD). Design a rich system of types, costraints and invariants, such that any CRUD operation always yields a semantically correct model.

We will define the following concepts:

Types

The metamodel knows types. Types are sets representing possible values some expression can take. We denote the set of all types , which is a set of sets. We will define throughout this document.

Empty Type

The empty set is a type, representing the fact that an expression cannot take any valid value. An expression having as its type is an error.

Union Types

The union type of two types and is a type, representing either or :

Intersection Types

The intersection type of two types and is a type, representing both and :

Primitive Data

A primitive datum is the atomic building block out of which models are specified. ‘Atomic’ in the sense that a primitive datum is not composed of something else, and that it is indivisible.

Not Extensible

We currently don’t plan for the types of primitive data to be extensible. Instead, the available primitive data types are baked into the metamodel. We might revise this decision if a compelling use case for externally defined primitive data types is found.

The metamodel knows these primitive types:

Numbers
A number is any rational number. We denote the set of primitive numbers .
Strings
A string is a finite sequence of unicode characters. We denote the set of primitive strings .
Tags
Tags are well-known values, distinct from other primitive data. We denote the set of primitive tags .

Any primitive datum forms a type:

Models

Labels

A label asrcibes meaning to a datum. There are two types of labels:

Value-based labels
A sequence of unicode characters.

Reference-based labels :

We denote the set of labels .

Not Strings

Labels are distinct from primitive strings! An label also does not form a type.

Model Part

A model part assigns labels to data, thereby describing the data’s meaning. Formally, we define a model part as a function into whose domain is a non-empty, finite set of labels. We denote the set of all model parts .