Skip to content
Leon Starr edited this page Sep 5, 2021 · 2 revisions

It is common practice to name a referential attribute and its reference target differently. To join two such class tables together we need to rename one of the attributes so that the names match up. We use the rename >> operator for this purpose.

For example, let’s say we have an Arrival class with attributes Aircraft and Airport representing all scheduled arrivals. Now we want to find all Aircraft not scheduled to arrive anywhere. We could do this:

non_arriving_ids #= Aircraft.Tail number - Arrival[Aircraft >> Tail number]

The complete table access format including rename is <table>fromName >> toName, ….(<projection>). You can omit any or all braced or parenthesized components if there is nothing to specify. The dot, however, is required when any projection is specified.

We use the >> rename operator on Arrival.Aircraft to yield a table whose header matches the projection on Aircraft.Tail number. Then we subtract the set of Arrival tail numbers from the set of all Aircraft tail numbers to yield all Tail numbers not scheduled to arrive.

Here’s one such example:

To create a table of ATC ID’s matched with station locations, we could do this:

atc locations #= (Duty Station ## On Duty Controller[Number >> Station].(ID, Location)

The common attribute in the join has a different name in each class. Either Station should be renamed as Number or vice versa. In the example above the Number attribute is renamed. Then, we project over ID and Location.

Introduction

Model semantics

Flows (as Variables)

Constants and literals

Structure of an activity

Accessing the class model

Data flow


Grammar and parsing notes

Components

Clone this wiki locally