Re: Another view on analysis and ER

From: David BL <davidbl_at_iinet.net.au>
Date: Thu, 6 Dec 2007 11:49:33 -0800 (PST)
Message-ID: <0b089c8d-2ed7-4d9d-a35a-e0adc54ee4b3_at_a39g2000pre.googlegroups.com>


On Dec 6, 7:29 pm, JOG <j..._at_cs.nott.ac.uk> wrote:
> On Dec 6, 4:33 am, David BL <davi..._at_iinet.net.au> wrote:
>
> > On Dec 6, 10:47 am, JOG <j..._at_cs.nott.ac.uk> wrote:
>
> > > Either we are crossing terminology, or this has already been
> > > highlighted earlier in the thread with reference to marriages. E/R
> > > forces one to pick a single conceptual viewpoint (marriage as
> > > relationship/marriage as entity, etc), whereas a propositional
> > > encoding is neutral on the topic.
>
> > There is something I may be misunderstanding - can you put me right?
>
> I'll certainly lend you my point of view. I offer no guarantees that
> its right :)
>
>
>
> > I think an entity is characterised as something in the real world that
> > we want to be able to reference using a reasonably small identifier.
>
> I agree with the identification aspect, but see a small identifer as
> being an attractive quality as opposed to a definitional one.

Ok.

> > Typically an entity is subject to change over time, and we may not
> > have convenient access to a nice, convenient, small number of
> > measurable attributes that uniquely identifies it.
>
> Sure. And if the identifier is a large unwieldy set of attributes for
> ease we might invent a surrogate to represent that set.

Yes.

> > Nevertheless we
> > believe that the identifier can be used successfully in the real
> > world. This could depend on the population statistics, such as the
> > way we identify people around us by their facial characteristics, and
> > it is helpful that people don't tend to have extensive plastic
> > surgery, exchange body parts on a regular basis or cross dress. This
> > allows them to be identified by names like "John".
>
> I'm not sure I'm following this entirely David. "John" is just another
> attribute, and it can be used to refer to someone, but we know it
> wouldn't identify them uniquely. The reason we can get away with using
> it in day to day conversation is because humans are incredibly good at
> resolving context (whereas a computer is not). We'd only use someone's
> first name alone when we know its use will not be ambiguous.

My only point is that in particular contexts we are comfortable with thinking of humans as entities that we are able to identify.

> > By contrast I think a relationship is characterised as only being
> > identified by the entities that it relates.
>
> Well, coupla things. Relationships can have attributes too, and they
> can be part of the identifying set.

Agreed, but that can be accommodated without upsetting the distinction I'm alluding to.

> And second, the attributes of an
> entity... well why can't they too be entities? Consider a 'team'
> entity say. It could be identified by the players in it. And those
> players are all entities themselves right? Perhaps there is a formal
> distinction between relationships and entities but I'm yet to read
> one, so until then, I have to posit that there is no difference
> between them.

I doubt whether there is a *formal* difference.

In the above example, a team that is independently identified would be regarded as an entity not a relationship, despite the fact that it could be identified by the players in it.

> > Now I see the same distinction being made in a propositional
> > encoding.
>
> I'm not sure why - there are no entities in a propositional encoding,
> just roles and values.

The RM formalism has attributes, domains, tuples and relations. Are roles part of the formalism or outside?

I see entities come into the propositional encoding in the instantiations of the intentional definitions of the predicates. This is outside the mathematical formalism. However, of what practical use is a relation without a well defined intensional definition?

> > The intensional definition of the following predicate implicitly
> > assumes Husband, Wife and Location correspond to entity types that can
> > be identified using domain values. Evidently marriage is merely a
> > relationship between them.
>
> > married(Husband, Wife, Location) :- Husband married Wife at
> > Location
>
> > By contrast the following predicates are consistent with thinking of a
> > marriage itself as an entity
>
> > husband(MarriageId, Husband).
> > wife(MarriageId, Wife).
> > location(MarriageId, Location).
>
> > or maybe just
>
> > married(MarriageId, Husband, Wife, Location)
>
> Summarizing the above I gathered that you are saying that:
> RELATIONSHIP: married(Husband, Wife, Location)
> ENTITY: married(MarriageId, Husband, Wife, Location)

> So the only difference is that the entity has a marriageID? I am not
> clear why you think the addition of this surrogate would change a
> relationship into an entity!

In the first case the marriage is a relationship because it is only identified indirectly by the entities that are involved. In the second case the marriage has been directly identified. That seems like a significant difference in the logical layer. It shows up in the intensional definitions where a marriage takes on a "role" as an entity.

In the second case there must be some underlying reason to introduce a marriage identifier. That reason points at a significant difference in requirements. Don't assume the marriage identifier is a surrogate id! Instead assume this is a well conceived design, and it's a natural identifier.

> > Now whether one "thinks in ER" or "thinks in propositional encodings",
> > there has to be good reason to introduce a MarriageId.
>
> I'm not clear at all why you have introduced a MarriageID. If the
> 'relationship' is identifiable by {H,W} say then so is the 'entity'.
> Why have you introduced the surrogate?

Circumstances are different in the second case, and that's what made the DBA come up with a different logical design. Maybe {H,W} doesn't identify a marriage. Maybe the model needs to store detailed information about polygamous marriage ceremonies and the MarriageId is a stable, natural key.

> > Aren't you implying that a propositional encoding doesn't commit you
> > to a decision about whether a marriage is implicitly or explicitly
> > identified?
>
> I certainly hope not ;) All things are identified by their
> attributes, so I don't really see this implicit/explicit split.
Received on Thu Dec 06 2007 - 20:49:33 CET

Original text of this message