Skip to manual
gluon

GOL language

LinkType

A LinkType connects two object types, names the role at each end and says which data backs the link.

Model author or developer

Where it goes

Contoso keeps SupplierIsOrganization in domains/party/objects.yaml. The loader reads every YAML file under the package root, so folders are a convention you can change. Name it in PascalCase. The name must be unique within its domain across all type kinds.

Fields

The keys under spec. Nested shapes follow LinkTypeSpec in the GOL JSON Schema.

FieldPresenceShape
semanticsOptionalenum: association, aggregation, composition
fromRequiredlinkEnd
toRequiredlinkEnd
backingRequiredobject
propertiesOptionalpropertyMap
traitsOptionalobject
onDeleteOptionalobject

Syntax and rules

The examples are fragments. Put them in a package next to the resources they reference. A ... stands for a CEL expression you write yourself.

6. LinkType

GOL · YAML
kind: LinkType
metadata: { name: SupplierHoldsContract }
spec:
  semantics: association # association | aggregation | composition
  from: { type: party.Supplier, role: supplier, multiplicity: "1" }
  to: { type: Contract, role: contracts, multiplicity: "0..*" }
  backing: { kind: foreignKey, holder: to, property: supplierId }
  onDelete: { from: restrict } # restrict | cascade | detach

role is the name under which that end is reached from the other end: contract.supplier, supplier.contracts. Multiplicities use UML notation: 1, 0..1, 0..*, 1..*, n..m.

Backing kinds:

backing.kindUseExtra keys
foreignKeyone side holds the other's keyholder, property, references
joinTablemany to many from a datasetsource, table, fromKey, toKey
objectassociation entity with identity of its own (DDD: the relationship is a concept)type, fromRole, toRole
derivedcomputed, read onlyexpr or function
inferredmined "hidden relationship"minConfidence, evidenceRequired
GOL · YAML
# polymorphic end, edge properties, inferred backing, traits
kind: LinkType
metadata: { name: Explains, status: proposed }
spec:
  from: { type: comms.Message, role: explainedBy, multiplicity: "0..*" }
  to: { anyOf: [Contract, finance.Invoice, core.Agreement], role: explains, multiplicity: "0..*" }
  backing: { kind: inferred, minConfidence: 0.8, evidenceRequired: true }
  properties:
    confidence: { type: double, required: true }
    authority: { type: EvidenceAuthority } # approved-policy | discussion | rumour
    validFrom: date
    validTo: date
  traits:
    {
      temporal: { from: validFrom, to: validTo },
      symmetric: false,
      transitive: false,
      acyclic: false,
    }

An end may be an ObjectType, an Interface or anyOf. Self links are legal; traits.acyclic: true makes cycles a data-quality alert at runtime.

Check your package

Shell
gluon validate examples/contoso
gluon test examples/contoso

validate reports each problem with a GLN code and its place in the file. test runs the package's Test resources. See the language guide and the diagnostics.

Contoso's SupplierIsOrganization LinkType in the designer's YAML pane, with its validation status.
Contoso's SupplierIsOrganization LinkType in the designer's YAML pane, with its validation status.