HP System Dictionary/XL General Reference Manual Vol 1 (32256-90004)
3- 21
named WINERY contains a field named VINTAGE by creating the relationship WINERY contains VIN-
TAGEusing the relationshiptype FORM contains ELEMENT. This dictionary definition documents the
true connection between the form and the field.
• Relationships describe a context in which an entity is used. As already mentioned, an entity has at-
tribute values that provide a general description of an object. Relationships also have attribute values.
They document the entity in a specific context or usage.
A relationship definition has three parts:
• An ordered list of the entities involved in the relationship.
• A relationship type, a dictionary category to which the relationship belongs. A relationship type is an
ordered list of entity types paired with a connecting name called a relationship class.
• Attribute values that further define and characterize the relationship (or, in some cases, one of the en-
tities in the relationship).
These relationship components are discussed next.
Specifying Entity Lists
A relationship does not have a name. It has a list of names representing the entities involved in the
relationship. Before you can create a relationship, all the entities in the entity list must already exist.
Also, if you delete one of the entities involved in a relationship, System Dictionary automatically deletes
the relationship. The order of the entity list is significant. The relationship CUSTOMER-ADDRESS
contains LAST-NAME, for example, is not the same as LAST-NAME contains CUSTOMER-ADDRESS.
Specifying Relationship Types
Relationships belong to categories called relationship types. A relationship type has two parts: an ordered
list of entity types that serves as a template for defining the entity list, and a relationship class that
expresses the action or connection of the relationship. When you create or access a relationship, you must
specify the relationship type.
For example, RECORD contains ELEMENT is a relationship type in the System Dictionary core set. This
relationship type requires that all relationships of this type must involve two entities. The first entity
must be of type RECORD, and the second must be of type ELEMENT. The relationship class (contains)
expresses the fact that the record contains the element.
When you create or access a relationship, you must use a relationship type that already exists in the
dictionary or System Dictionary issues an error. System Dictionary comes with a built-in set of
relationship types called core set relationship types. You can also add an extended set of relationship
types. You can create relationships using any relationship type in the core set or extended set. Figure 3-4
illustrates an example of a relationship type and a relationship occurrence of that relationship type. In the
example, IMAGE-DATABASE and IMAGE-DATASET are the entity types of the relationship type,
CONTAINS is the relationship class, and SCOPE-OWNER, IMAGE-DATABASE-TYPE, and IMAGE-
DATASET-TYPE are attributes of the entity types. SCOPE-OWNER and CAPACITY are attributes of the
relationship type.
In the RELATIONSHIP shown, ENGINEERING, TURBO, and MANUAL are the attribute values of the
entities CORP and R&D, while ENGINEERING and 117 are the attribute values of the relationship.
Click here to view figure.