HP System Dictionary/XL General Reference Manual Vol 1 (32256-90004)

3- 23
relationship classes. You must use an existing pair, or System Dictionary issues an error stating that the
relationship type does not exist.
Relationship Attribute Values
Relationships have attribute values that describe the relationship definition itself, such as when it was
created, who "owns" it, and so on. You can also use the attribute values of a relationship to describe one of
the entities involved in the relationship. Attribute values can provide a description of the entity in a
particular context.
Table 3-3 shows some sample relationships of the type FORM contains ELEMENT. Each "row" in the table
represents a relationship involving two entities, shown in the first two columns. The other columns
contain values for the attributes SCOPE-OWNER and FIELD-ENHANCEMENT. The SCOPE-OWNER
attribute applies to the relationship definition itself (who owns it in the dictionary). The FIELD-
ENHANCEMENT value refers to an object.
N-Ary Relationships
System Dictionary allows relationships that involve up to six entities. Relationships involving more than
two entities are called N-ary relationships.
An example of an N-ary relationship type is the core set type IMAGE-DATASET ELEMENT ELEMENT
IMAGE-DATASET IMAGE-DATABASE chains. This relationship type defines an IMAGE data base chain
by including the detail data set, search item, sort item, master set, and data base in a single relationship.
An N-ary relationship allows you to define multiple relationships in a single definition. It also prevents
part of the definition from being left out. You cannot create an N-ary relationship unless you specify all the
entities. If it is necessary to omit one of the entities in an N-ary relationship, you may use a slash (/) to
indicate a null entity.
Creating and Accessing Relationships
You can create, delete, modify, and retrieve relationships. To create, delete, or modify a relationship, the
dictionary must be open in shared or exclusive update mode. To retrieve a relationship, the read and read
only mode are sufficient.
When you create a relationship, you must specify a list of already existing entities that will be involved in
the relationship. You must specify the relationship type as an ordered list of entity types corresponding to
the entity list. If the entity type list you specify is not unique in the dictionary (for example, ELEMENT
ELEMENT), you must qualify the entity type list by relationship class (for example, contains). When you
create a relationship, you can specify a list of attributes and their values. The list may contain any
attribute associated with the entity type, plus any alias attribute. Variable-length attribute values are to
be assigned later, after you create the relationship.
Table 3: Relationships of type FORM contains ELEMENT
FORM ELEMENT SCOPE-OWNER FIELD-ENHANCEMENT
CUSTOMERS LAST_NAME DA N
SALES PURCHASE_PRICE RON HI
BURGERS PURCHASE_PRICE KELLY HIU
CHEESE_CODES NAME SAM B