Customizing the metamodel > Keywords for USRPROPS > RELATE (BY), RELATED (BY)
  
RELATE (BY), RELATED (BY)
The default relationship type for a reference property is “uses”. The RELATE BY keyword is used to override this default with a different relationship (such as “keyed by”) or no relationship (when “RELATE BY nothing” should be coded).
The following relationships can be used with the RELATE BY keyword.
The relationship name must be in double quotation marks, for example: “uses”.
Relationship
Description
uses
The default. The definition contains definition.
used by
A data (element or structure) is used by an expression.
defined by
Is defined by a definition.
defines
A definition defines a symbol.
is a
A definition “is an instance of” a definition (for example, a column is a data element)
instantiated by
A definition is instantiated by a definition.
identifies
A definition identifies a definition.
is keyed by
A definition is identified by a definition.
is parent in
A definition is a parent of a definition in a parent child relationship.
has parent of
A definition has a parent definition in a parent child relationship.
is child in
A definition is a child of a definition in a parent child relationship.
has child of
A definition has a child definition in a parent child relationship.
comprises
An object comprises objects (for example, model comprises entities, relationships, and so on, Categorization comprises Category Relations).
is part of
A definition is part of a definition. This is used with a OneOf or ListOf.
is categorization of
A categorization definition categorizes a generic entity definition.
has categorization
A generic entity definition has categorization of a categorization definition.
is category in
A entity definition is a category in a categorization.
has category of
A categorization has a category of an entity definition.
is index of
A definition is an index to another definition.
is indexed by
A definition is indexed by another definition.
originated from
A definition originated from a definition.
is origin of
A definition is origin of a definition.
is based on
A definition is based on a definition (usually a data element).
is basis for
A definition is basis for derived definition.
describes
A diagram describes a definition.
is described by
A definition is described by diagram.
Example
In the following example, the first KEY EDIT indicates that the “Use Case Name” property is a key property of the Use Case Step definition. That “Use Case Name” property refers to a Use Case definition: the ONEOF "Use Case" specifies this. You must specify the full key of that Use Case (that the step is being keyed to); in this case you use the KEYED BY command to specify the keys, which are the package that the Use Case is contained in, and the Name of the Use Case itself. Finally, you must specify that the Use Case Step is keyed by this Use Case, which is what the RELATE BY "is keyed by" command does. The RELATE BY clause is added because the default relationship type for a reference property is "uses". If a different relationship type is wanted (such as "keyed by"), then the default must be overridden.
The second KEY EDIT specifies that the "Package" property is also a key of the Use Case Step definition: specifically, the Use Case Step is keyed by a package definition. However, a package definition is not itself keyed by any additional properties besides its own name, therefore the KEYED BY command is not used. The package is related to a Use Case Step by the "is keyed by" relationship.
Definition "Use Case Step"
{
PROPERTY "Use Case Name"
{ KEY EDIT ONEOF "Use Case" KEYED BY {"Package", Name}
RELATE BY "is keyed by" READONLY
HELP "Name of Owning Use Case" }
PROPERTY "Package"
{ KEY EDIT ONEOF "Package" RELATE BY "is keyed by" READONLY}
}
See also
Keywords for USRPROPS