Re: RA with MV attributes

From: David <davidbl_at_iinet.net.au>
Date: 20 Jan 2007 06:25:11 -0800
Message-ID: <1169303110.907920.79030_at_m58g2000cwm.googlegroups.com>


Marshall wrote:
> On Jan 19, 4:12 pm, "David" <davi..._at_iinet.net.au> wrote:
> > That's an incorrect inference. That's not what a tuple means. If you
> > have the tuple
> >
> > Names = {Fred, Bill}, Cars = {}, CarColour = {green}
> >
> > Then you are meant to read out propositions by taking the cross product
> > of the sets. The cross product is of course empty.
>
> "meant to read out propositions by taking the cross product?" Says who?

Please regard it as a definition. In my original post I briefly mentioned the idea that a set of tuples with MV attributes could be mapped to a set of 6NF propositions (with single valued attributes). I had this cross product idea in mind to formalise that.

Consider a relation on the attributes {Name,Car,CarColour}. Towards formalising the meaning of the relation it is assumed there are a number of associated predicates. In this case there are 5

    person(Name)
    car(Car)
    colour(Colour)
    owns(Name,Car)
    hascolour(Car,Colour)

Each predicate is associated with some subset of the attributes of the relation. For each tuple we generate a set of propositions by taking cross products. The "meaning" of a relation is defined to be the union of all the propositions over all tuples in the relation.

For example, the following tuple

    Names = {fred, bill}, Cars = {car1, car2}, CarColour = {red}

would give the following propositions

    person(fred).
    person(bill).
    car(car1).
    car(car2).
    colour(red).

    owns(fred,car1).
    owns(fred,car2).
    owns(bill,car1).
    owns(bill,car2).

    hascolour(car1,red).
    hascolour(car2,red).

However, it is also interesting to consider a derived predicate

  ownscarwithcolour(Name,Car,CarColour)

Note firstly that this can be written as a conjunction. In prolog we would write

ownscarwithcolour(Name,Car,CarColour) :-

    owns(Name,Car), hascolour(Car,CarColour).

If we take cross products as I've described we will implicitly filter out those tuples containing empty sets (which a number of people have regarded with extreme suspicion in this thread).

What is interesting is that after joining r1(Names,Cars) with r2(Cars, CarColours) to yield r3(Names,Cars,CarColours), and then using the cross products idea to extract the propositions for ownscarwithcolour, you will find that it has done precisely a *natural* join on the underlying predicates of the conjunction. This is despite the fact that the join operation I defined in the original post looks more like a full outer join when you look at the generated tuples!

> Anyway, that doesn't make a lot of sense. It introduces a new
> discipline, tuple normalization, because the tuple
>
> Names = {Fred, Bill}, Cars = {}
>
> has the same information content as
>
> Names = {}, Cars = {}

No. The first tuple states that Fred and Bill exist.

Nevertheless I agree that MV attributes lead to non-uniqueness of representation because you can always group in different ways. I would hope that the DB programmer generally deals with relations in a set-theoretic way and therefore doesn't care about the non-uniqueness in the tuples.

Note that relation union and difference allow for asserting new relationships and retracting existing relationships. This shows that updates can be performed despite the non-uniqueness of tuple representation.

> Why does having RVAs mean I have to introduce this new
> semantics for tuples? What was wrong with the old one?

Does it possess nice properties? Received on Sat Jan 20 2007 - 15:25:11 CET

Original text of this message