Re: Another view on analysis and ER

From: Jon Heggland <>
Date: Thu, 06 Dec 2007 09:37:32 +0100
Message-ID: <fj8cd2$1l3$>

Quoth David BL:
> By contrast I think a relationship is characterised as only being
> identified by the entities that it relates.
> Now I see the same distinction being made in a propositional
> encoding.
> 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

So you intend that Location is necessary for identification? What if Location does not correspond to an entity type? I assume that might be the case if it were simply a spatial coordinate. Is marriage still a relationship? If not, what is is?

(And "merely" a relationship? Are entities better than relationships in some way?)

> 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)
> Now whether one "thinks in ER" or "thinks in propositional encodings",
> there has to be good reason to introduce a MarriageId.

Perhaps marriage certificates has a unique number stamped on them, and you want to record this in your database.

Anyway, your first predicate breaks down if two people can marry each other more than once on the same location, which is the case in many parts of the world. I'd suggest you add a DateTime as well. Does that make the predicate an entity? Assuming monogamy, it can be identified by { Husband, DateTime }, { Wife, DateTime } or perhaps even { Location, DateTime } if we preclude mass weddings. What if the DateTime "corresponds to an entity type"? (What determines whether there is such a correspondence?)

> 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 fail to see how that is possible.

You define relationships as anything that can be identified /only/ by its related entitites---if there is an alternate key, the thing is an entity. Correct? What is the rationale behind this rule?

(And what if the alternative means of identification is also a combination of entities?)

Received on Thu Dec 06 2007 - 09:37:32 CET

Original text of this message