2.2.3. Relationships

[Tip]Description

A relationship is a special relation that is model independent and is defined as part of the VPM. It describes either inheritance (i.e. supertype-subtype) or instantiation (i.e. type-instance) relation.

[Important]Syntax
RelationshipAST ::= InheritanceAST | InstantiationAST
    
InheritanceAST ::= supertypeOf RelationshipBodyAST 
                 | subtypeOf RelationshipBodyAST 
	
InstantiationAST ::= typeOf RelationshipBodyAST 
                   | instanceOf RelationshipBodyAST 

RelationshipBodyAST ::= ( PatternVariableRefAST , PatternVariableRefAST )

A relationship is either an inheritance or an instantiation .

In each case two model element is referenced by pattern variables references: a parent reference, and a child reference.

In case of inheritance the parent is the supertype and the child is the subtype.

In case of instantiation the parent is the type and the child is the instance.

In case of both relationships both the parent and the child can be an entity or a relation.

[Note]Semantics

The description of a relationship can appear in the context of a pattern body. It either references an existing relationship if it is used in pattern matching or defines a new relationship.

In case of inheritance both and refers to the same relationship; only the order of the parameters are different.

In case of instantiation both and refers to the same relationship; only the order of the parameters are different.

[Caution]Constraints

The parent and the child of the relationships must refer to the same type of model element, i.e. either both refer to entities or both refer to relations.

Defined In:  local pattern body element

Used By:  create rule, delete rule

See Also:  pattern body, entity