2.2.2. Relation

[Tip]Description

A relation is a model element. It is one of the base components of the VPM; a model space is composed of typed entities and relations between them.

[Important]Syntax
RelationAST ::= QualifiedTypeNameAST RelationBodyAST 
RelationBodyAST ::= ( PatternVariableDefRefAST , PatternVariableRefAST , PatternVariableRefAST ) 

A relation is identified by a pattern variable.

It can have a relation type , which is either a local name or a fully qualified name). A type identifies another relation of the model space; it can be referenced with the local name only if its namespace is imported. In the most general case, the type is relation .

The first parameter of a relation defines a pattern variable, which acts as an identifier for the relation in the pattern.

The description of a relation contains two additional references to model elements. The second parameter is the source pattern variable reference of the relation, while the third parameter is the targetpattern variable reference of the relation. Both the source and target of a relation can be an entity or another relation independently of each other.

[Note]Semantics

The description of a relation can appear in the context of a pattern body. It either references an existing relation (when is used as part of the precondition pattern) or it may define a new relation to be created (when used in the postcondition pattern).

[Warning]Warning

The vpm namespace with vpm.entity and vpm.entity.relation (which were present in previous VIATRA releases as a metamodeling core) is no longer supported. Please use simple relation instead.

Remark.  The containment of a relation cannot be defined or constrained explicitly since every relation is contained by its source model element.

Used By:  create rule

See Also:  entity, local pattern body element, namespace import