thanks Brian, your explanation regarding role sequences clarifies the matter. maybe one day the constraint should be re-named 'sequence constraint'
for anyone who might be interested in the exercise left to the reader on the last page of Lab 4,
I did the following tests.
Test 1
Thing is a real thing
Thing is a tangible thing
- unary roles.
then i set the equality constraint
1.1 is a tangible thing
2.1 is a real thing
which give this sensible reading:
For each Thing,
that Thing is a tangible thing if and only if that Thing is a real thing.
Test 2
now i create two fact types that share the same predicate object:
Perp(name) is booked on Date(ymd)
Perp is fingerprinted on Date
i set the [Perp] [is booked on] role as mandatory and UC spanning both roles
and UC for [Perp] [is fingerprinted on] role.
then i add Equality constraint as follows:
Perp is fingerprinted on (first role) |1.1|..| and
Perp is booked on (first role) |2.1|..|
Note that both Date roles are empty.
This constraint gives a sensible reading with no errors:
For each Perp,
that Perp is fingerprinted on some Date if and only if that Perp is booked on some Date.
What I noticed here is that if only the [Perp] [is booked on] role is mandatory, there is no error. But if I also make [Perp] [is released on] mandatory, this creates an error on the equality constraint:
Model Error: Constraint 'EqualityConstraint1' in Model 'ORMModel1' is implied by mandatory constraint(s).
Test 3
I exactly replicate the structure of "LanguageVersion" (sub) diagram in Lab 4 as follows:
TeddyBearType(code) is named TeddyBearName(name)
TeddyBearType has Size()
Size is a value type
UC:
TeddyBearType is named
TeddyBearType has
(first roles)
Mandatory:
... is named
(ommitted: ... has)
Equality Constraint:
... has |1.1|..|
... is named |2.1|..|
For each TeddyBearType,
that TeddyBearType has some Size if and only if that TeddyBearType is named some TeddyBearName.
observations:
making mandatory the [... has] role
creates the same "Implied by Mandatory Constraint" error.
Removing either one or both Mandatory constraints eliminates the error.
Conclusion:
1. When using Equality Constraints, Mandatory constraints are unnecessary and interfere with the equality constraint, at least in models analogous to tests 2 and 3.
2.The "LanguageVersion" subdiagram in Lab 4 has a red-herring. if you try to re-create it exactly as shown, errors are inevitable. Removing at least one of the mandatory constraints fixes the error.
3. When I was having problems recreating that diagram, I didn't think to put the equality constraint between the first roles only, because the PPT diagram shows the constraint lines attachted to the second roles, not the first roles or spanning both roles. If you to try to set the constraint as follows:
is of ... |..|1.1|
has ... |..|2.1|
you get Model Error: Constraint 'EqualityConstraint' in model 'ORMModel1' has role players with incompatible types.
-because one is an entity type and the other is a value type.
I hope this post helps other newbies out there who are trying to follow along.
Joe