in

The ORM Foundation

Get the facts!

Implicit disjunctive mandatory constraint

Last post Wed, Apr 1 2015 18:31 by Terry Halpin. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • Wed, Apr 1 2015 11:20

    Implicit disjunctive mandatory constraint

    Per pages 161 and 164 of the BBB, primitive entity types must play at least one reference role and at least one fact role.  I'd like to clarify a couple details about this rule in ORM:

    (1) Are the roles played by an entity type in a compound reference scheme considered reference roles?

    (2) Per page 246, this rule doesn't apply to subtypes.  However, I can see two possibilities for how this rule might affect subtype instances:

    • A subtype instance must play at least 1 fact role played by its primitive supertype, but need not play any fact roles played only by the subtype
    • A subtype instance must play at least 1 fact role in the disjunction of all of its fact roles (including inherited fact roles).
    I strongly suspect the former is the intended rule, but I'd appreciate a confirmation.
     
    Thanks,
    Matt 

  • Wed, Apr 1 2015 14:05 In reply to

    Re: Implicit disjunctive mandatory constraint

    Hi Matt,

    I don't have the book with me, so I'll try to answer without it:

    First off, a primitive entity type does not need to play a non-existential (reference) role. Country(.Code) is a valid as a complete and properly formed ORM model where Country plays only the existential role attaching it to the CountryCode value type.

    For a compound reference scheme all of the played roles that are part of the reference scheme are considered existential. The simple reference scheme is just a degenerate case of the compound.

    For a subtype, you can consider subtyping at two different meta levels. The first is a type-level relationship, representing the normal supertype/subtype relationship between types. The second relationship is at the instance level, there the subtype instance has a 1-1 relationship with the supertype, with a mandatory constraint on the subtype role. We've been referring to this as the identity fact type in recent standardization exercises. Note that NORMA always creates this identify fact type, and actually infers the type-level relationship from its existence in the model. If you expand any subtype in the Fact Types section of the model browser you'll the associated roles and constraints.

    So, the only requirement for a subtype is that it is an instance of its supertype, as represented by the mandatory constraint on the identity fact type role connected to the subtype. These mandatory subtype roles are not treated as existential, so all subtypes play a non-existential mandatory role and never have an implicit disjunctive mandatory.

    So, in general, I think in all cases you're overstating the requirements for primitive and subtypes to play additional roles. The mandatory constraints will tell you what must be played (including the ever-present mandatory constraint for a subtype). If a primitive type plays non-existential roles none of which are simply or disjunctively mandatory, and the type is not marked as independent, then an implicit (simple or disjunctive) mandatory constraint is added automatically. These are always in-memory in NORMA and reflected in generation targets and population validation, but you won't seem them otherwise displayed in the UI. However, if the 'IsIndependent' property is enabled and false then you can assume there is an implicit mandatory constraint exists (assuming non-existential roles)

    -Matt 

     

  • Wed, Apr 1 2015 14:37 In reply to

    Re: Implicit disjunctive mandatory constraint

     Hi Matt (Nizol)

    Matt Curland's response is quite correct and should clarify the issue for you. 

    Please note however, that the BBB does not claim that elementary fact roles are mandatory for a primitive entity type. The p. 161 reference you mentioned includes the following condition "unless declared independent". Also, the p. 166 reference you mentioned needs to be interpreted with the understanding that by default object types are not independent.

    Cheers

    Terry 

  • Wed, Apr 1 2015 17:19 In reply to

    Re: Implicit disjunctive mandatory constraint

    Hi Terry and Matt,

    Thank you very much for your responses.  Below is my new understanding of the implicit disjunctive mandatory constraint:

    If some object type:

     

      1. Is primitive
      2. Is non-independent
      3. Plays at least one non-existential role
      4. Has no non-existential roles covered by a simple or disjunctive mandatory constraint

     

    Then all of that object type's non-existential roles are covered by an implicit disjunctive mandatory constraint.

    Is that accurate?  I assume that all roles played by a value type are considered non-existential, and so the above would hold for value types as well.

    I have a couple of follow-up questions.  

    (1) Matt wrote, "for a compound reference scheme all of the played roles that are part of the reference scheme are considered existential."  Does that include the roles played by the identifying type(s)?  For example, is the role played by Study in "Treatment is part of Study" in the below model considered an existential role?

    (2) It sounds like the existence of a subtype instance implies the existence of a distinct supertype instance.  For example, if for some instance of the below model there is an Active Drug object "X", then there is a distinct Treatment object "X", and the two "X" objects are related by the identity fact type (I would have previously conceptualized a single "X" object that was both an Active Drug and a Treatment).  The Treatment "X" must play a role in the "Patient receives Treatment" fact type (because that is the only non-existential role played by Treatment, assuming that the below model is the full schema), but the Active Drug "X" need not play a role in the unary fact type "Active Drug is accepted."  Is my understanding correct?

    Thanks again,

    Matt 


  • Wed, Apr 1 2015 18:31 In reply to

    Re: Implicit disjunctive mandatory constraint

     Hi Matt

     Your initial statement of your new understanding of  implicit disjunctive mandatory role constraints is basically accurate. As a fine point, we now say that an object type "hosts" a role, whereas an object instance "plays" a role. 

    Regarding your first follow-up question, the role hosted by Study is not existential. The term "existential role" is relative to its host type, not absolute. The following extract from our ORM 2013 Workshop paper "Recent Enhancements to ORM" will hopefully clarify this issue for you.

    A referential role (or existential role) of an entity type is a role that it hosts in one of its existential fact types, i.e. a fact type in its preferred reference scheme. Note that implied, objectification link fact types [15, p. 442] that are used in the reference scheme for the objectified entity type are existential fact types for that entity type.

    A non-referential role of an object type is a role that is hosted by that object type but is not referential for that object type. All roles hosted by a value type are non-referential because value types have no reference scheme. A non-referential role is a role that is not a referential role of any object type.  

     Regarding your second follow-up question, the existence of a subtype instance (in a model's population) does NOT imply the existence of a distinct supertype instance (in the model's population). For example, if LargeCountry is subtype of Country, a model in which the population of Country and LargeCountry is simply the single country Australia is legal. The implicit identity relationship in this case simply asserts that the large country Australia equals (is identical to) the country Australia. I'm talking conceptually here, not necessarily about how NORMA might implement the identity relationship.

    Regarding your Treatment - ActiveDrug example, each instance of ActiveDrug is conceptually an instance of Treatment, so must play each role that is mandatory for Treatment. As a communication heuristic to avoid misunderstanding, if a diagram displays a non-independent entity type's composite reference scheme, I prefer to explicitly display the implied mandatory role constraint.

    Cheers

    Terry 

     

     

Page 1 of 1 (5 items)
© 2008-2024 ------- Terms of Service