<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>2.2.2. Relation</title><link href="style.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.72.0" name="generator"><link rel="start" href="index.html" title="The VIATRA2 Model Transformation Framework"><link rel="up" href="sec_LocalPatternlElementDescription.html" title="2.2. Local Pattern Body Elements"><link rel="prev" href="def_Entity.html" title="2.2.1. Entity"><link rel="next" href="def_Relationship.html" title="2.2.3. Relationships"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">2.2.2. Relation</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="def_Entity.html">Prev</a> </td><th align="center" width="60%">2.2. Local Pattern Body Elements</th><td align="right" width="20%"> <a accesskey="n" href="def_Relationship.html">Next</a></td></tr></table><hr></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="def_Relation"></a>2.2.2. Relation</h4></div></div></div><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Tip: Description"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Tip]" src="images/tip.png"></td><th align="left"><a name="def_Relation_Description"></a>Description</th></tr><tr><td valign="top" align="left"><p> | |
A <span class="strong"><strong>relation</strong></span> | |
<a name="N10A87" class="indexterm"></a> | |
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. | |
</p></td></tr></table></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important: Syntax"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Important]" src="images/important.png"></td><th align="left"><a name="def_Relation_Syntax"></a>Syntax</th></tr><tr><td valign="top" align="left"><pre class="programlisting"> | |
RelationAST ::= <a href="def_ModelElementName.html" title="5.7.1. Model Element Name">QualifiedTypeNameAST</a> RelationBodyAST | |
RelationBodyAST ::= <span class="token">(</span> <a href="def_PatternVariable.html" title="2.1.6. Pattern Variable">PatternVariableDefRefAST</a> <span class="token">,</span> <a href="def_PatternVariable.html" title="2.1.6. Pattern Variable">PatternVariableRefAST</a> <span class="token">,</span> <a href="def_PatternVariable.html" title="2.1.6. Pattern Variable">PatternVariableRefAST</a> <span class="token">)</span> | |
</pre><p> | |
A <span class="strong"><strong>relation</strong></span> | |
is identified by a pattern | |
<a href="def_Variable.html" title="5.7.2. Variable">variable</a>. | |
</p><p> | |
It can have a | |
<span class="strong"><strong>relation type</strong></span> | |
<a name="N10ABF" class="indexterm"></a>, | |
which is either a <a href="def_ModelElementName.html" title="5.7.1. Model Element Name">local</a> | |
name or a <a href="def_ModelElementName.html" title="5.7.1. Model Element Name">fully qualified name</a>). | |
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 | |
<code class="computeroutput">relation</code> | |
. | |
</p><p> | |
The first parameter of a relation defines a | |
<a href="def_PatternVariable.html" title="2.1.6. Pattern Variable">pattern variable</a>, | |
which acts as an identifier for the relation in the pattern. | |
</p><p> | |
The description of a relation contains two additional references to model elements. The second parameter is | |
the <span class="emphasis"><em>source</em></span> <a href="def_PatternVariable.html" title="2.1.6. Pattern Variable">pattern variable reference</a> | |
of the relation, while the third parameter is the <span class="emphasis"><em>target</em></span><a href="def_PatternVariable.html" title="2.1.6. Pattern Variable">pattern variable reference</a> | |
of the relation. Both the source and target of a relation can be an entity or another relation independently | |
of each other. | |
</p></td></tr></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note: Semantics"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Note]" src="images/note.png"></td><th align="left"><a name="def_Relation_Semantics"></a>Semantics</th></tr><tr><td valign="top" align="left"><p> | |
The description of a | |
<span class="strong"><strong>relation</strong></span> | |
<a name="N10AF3" class="indexterm"></a> | |
can appear in the context of a <a href="def_PatternBody.html" title="2.1.2. Pattern Body">pattern body</a>. | |
It either references an existing relation (when is used as part of the | |
<a href="def_GTRuleDef.html" title="3.1.1. Graph Transformation Rule Definition">precondition pattern</a>) | |
or it may define a new relation to be created (when used in the | |
<a href="def_GTRuleDef.html" title="3.1.1. Graph Transformation Rule Definition">postcondition pattern</a>). | |
</p></td></tr></table></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning: Warning"><tr><td valign="top" align="center" rowspan="2" width="25"><img alt="[Warning]" src="images/warning.png"></td><th align="left"><a name="def_Relation_Warning"></a>Warning</th></tr><tr><td valign="top" align="left"><p> | |
The <code class="computeroutput">vpm</code> namespace with | |
<code class="computeroutput">vpm.entity</code> and <code class="computeroutput">vpm.entity.relation</code> | |
(which were present in previous VIATRA releases as a metamodeling core) is | |
no longer supported. Please use simple <code class="computeroutput">relation</code> instead. | |
</p></td></tr></table></div><div class="highlights"><a name="def_Relation_Remark"></a><p><b>Remark. </b> | |
The containment of a relation cannot be defined or constrained explicitly since every relation is | |
contained by its source model element. | |
</p></div><div class="highlights"><a name="def_Relation_UsedBy"></a><p><b>Used By: </b> | |
<a href="def_CreateRule.html" title="4.4.2. Create Rule">create rule</a> | |
</p></div><div class="highlights"><a name="def_Relation_SeeAlso"></a><p><b>See Also: </b> | |
<a href="def_Entity.html" title="2.2.1. Entity">entity</a>, | |
<a href="def_PatternBody.html" title="2.1.2. Pattern Body">local pattern body element</a>, | |
<a href="def_NamespaceImport.html" title="1.1.3. Namespace Import">namespace import</a> | |
</p></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="def_Entity.html">Prev</a> </td><td align="center" width="20%"><a accesskey="u" href="sec_LocalPatternlElementDescription.html">Up</a></td><td align="right" width="40%"> <a accesskey="n" href="def_Relationship.html">Next</a></td></tr><tr><td valign="top" align="left" width="40%">2.2.1. Entity </td><td align="center" width="20%"><a accesskey="h" href="index.html">Home</a></td><td valign="top" align="right" width="40%"> 2.2.3. Relationships</td></tr></table></div></body></html> |