R817 - modelint/shlaer-mellor-metamodel GitHub Wiki
R817 / 1c:Mc-1
Relation Flow casts to zero, one or many Instance Flow
Instance Flow casts from zero or one Relation Flow
Given some Relation Flow defined by a set of Table Attributes, we can convert its content via relational projection to yield an Instance Flow conveying references to corresponding instances of some Class.
To do this, a subset of the Table Attributes must match a set of Identifier Attributes of some Identifier of a Class. So, let's say that a Table Flow (subclass of Relation Flow) is typed with the Table Attributes:
{ Floor: Level Name, Shaft: Shaft ID, Bank: Bank Name, Height: Distance }
And let's say there are two tuples in this Table Flow:
{ L, S1, Express, 2.5m },
{ Roof, S1, Express, 32.3m }
Now let's say we want to generate an Instance Flow for the Class named `Accessible Shaft Level'.
Identifier I1 of this class (it only has one in this example, but we could have chosen I2 instead if it was defined) has the Identifier Attributes:
{ Floor: Level Name, Shaft: Shaft ID }
Since this is a subset of the Table Flow type (header), we can project on the Identifier of Accessible Shaft Level to yield the instance references:
{ L, S1 },
{ Roof, S1 }
But we're not done yet!
Those two instances must exist in the population of the Accessible Shaft Level Class, otherwise they are not instance references at all!
So we must ensure not only that we can project the Table Flow on some Identifier of a Class, but also that the projection is a subset of the Class's Identifier population.
Any given Instance Flow may or may not be projected from a Relation Flow.
Any given Relation Flow can be used to project any number of Instance Flows within the same Activity.