Skip to content

References

Leon Starr edited this page Jul 30, 2026 · 1 revision

A referential column names the relationship it formalizes rather than an attribute. The value supplied beneath it is an @alias pointing at an instance declared elsewhere in the file.

The grammar is:

ref_list = ref (', ' ref)*
ref = rnum '>' icaps_name

So a reference is a relationship number, a > character, and the name of the class on the other end. There are no spaces around the >R1 > Bank will not parse.

Why bother

Compare two ways of populating the same kind of thing. Bank Level writes out its identifying values literally:

Bank Level
Bank | Floor
--
PPH  { [Penthouse]    [PH] }
P8   { [Penthouse]    [8] }
LF7  { [Lower Floors] [7] }
--

Top Bank Level is a subclass of Bank Level across relationship R38, and rather than repeating those two values it points at the instance by its alias:

Top Bank Level
R38>Bank Level | Calling down
--
{ @PPH [false] }
{ @LF7 [false] }
--

Two things are happening here. The @PPH reference stands in for the whole identifier of the referenced instance, which in this case is the pair of values Penthouse and PH — one alias covers both, so a multi-attribute identifier does not have to be transcribed into every referencing row. And the R38> prefix records which relationship the reference formalizes, which the engine needs in order to know that this row is the Top Bank Level end of R38.

Contrast that with Accessible Shaft Level, which formalizes R3 in the class model but writes its columns as plain attribute names:

Accessible Shaft Level
Shaft | Floor | Bank | Stop requested
--
{ [S6] [PH] [Freight] [false] } > NOT REQUESTED
--

That is perfectly legal. Marking a column with an rnum is not required just because the underlying attribute is referential. Use the rnum and alias form when you want to point at an instance defined elsewhere in the file, and plain columns with literal values when writing the values out is clearer.

Several relationships in one column

The ref_list term allows more than one rnum on a single column, separated by a comma and a single space:

R38>Bank Level, R39>Floor | Calling down

This covers the case where one referential value formalizes more than one relationship at once, which arises in Shlaer-Mellor models wherever a single attribute carries more than one referential tag. The single @alias in that position satisfies every relationship listed for the column.

Ordinal relationships

Since an rnum allows a leading O, an ordinal relationship such as OR7>Floor is accepted here too. That is the letter O, not a zero.

What the parser does with them

Each reference is reported as an {'rnum': 'R38', 'to class': 'Bank Level'} pair, and a reference column is reported as a list of those pairs so that a single-rnum column and a multi-rnum column look the same to the consumer. The @alias in the row comes back as {'ref to': 'PPH'}.

The parser does not resolve the alias. @nosuch parses without complaint and the dangling name is passed straight through, so matching aliases to the instances that declared them is the consumer's job. See Parser output.

Clone this wiki locally