Re: Question on Multiplicity

From: jason.glumidge_at_gmail.com <Jason.Glumidge_at_gmail.com>
Date: 26 Oct 2005 10:40:25 -0700
Message-ID: <1130348425.226719.139110_at_f14g2000cwb.googlegroups.com>


Roy Hann wrote:
> "jason.glumidge_at_gmail.com" <Jason.Glumidge_at_gmail.com> wrote in message
> news:1130334318.730554.140170_at_f14g2000cwb.googlegroups.com...
> > Imagine you were knocking up a simple table of animals and their
> > predominant colors. Something of the order:
> >
> > ----------------------
> > animal | color
> > ----------------------
> > swan | white
> > lion | yellow
> > oranguatan | orange
> > ----------------------
>
> To see what is going on here, ask yourself what sentence you intend to plug
> these words into to form true statements. (i.e. what is the predicate?)
> Here are some suggestions:
>
> All <animal> are <color>.
> Food for <animal> is stored in warehouse zone <color>.
> A <animal> can be entirely <color>.
> A <animal> is >93% <colour>.
> A <animal> can be partly <color>.
> A <animal> can never be <color>.
> T-shirts with <animal> logo are <color>.
>

Many thanks for the reply. I think i still have a way to go to clarify the model in my mind, so that I instinctively encode information in the best possible way. I'm certainly starting to understand that it's not just a case of knowing you're way around SQL and the basics of normalization, and thinking you have expertise in relational modelling. With the above example the predicate I had in mind (although not explicitly - probably my first mistake), was:

"There is an animal:<A> with some fur colored <C>"

This may be a bad choice (i'm still not completely clear on this) - is the implication that such a predicate constrains my declaration of the world to all animals only having one fur-color?

> > Consider also that some animals that have multicolored fur. For
> > instance a zebra is black and white. Keeping the table nice and
> > normalized yields:
> >
> > ----------------------
> > animal | color
> > ----------------------
> > swan | white
> > lion | yellow
> > oranguatan | orange
> > zebra | black
> > zebra | white
> > ----------------------
>
> It would appear that you have a table but you don't know the predicate, or
> you know the predicate and the table is wrong.
>
> [snip]
> > Now my question is am I missing anything - is there any method of
> > making this distinction without having to introduce a new reference
> > column to resolve the ambiguity?
>
> You'll need to decide on the predicate, and it's not clear to me that you
> have one. You might even find you need multiple predicates (and multiple
> tables).
>

Just for the sake of completeness (even though this example is a bit contrived), here's the simple strategy that seemed intuitive



id | animal_name
1  | swan
2  | swan
3  | lion
4  | oranguatan
5  | zebra
-----------------



id | color
1  | white
2  | black
3  | yellow
4  | orange
5  | black
5  | white

Now this works fine, but i'm still a touch confused as to how my predicate choice could have altered this structure. I intended a one->many fur color, but seem to have a problem in that i don't have an observation between different types of swan - I'm assuming I just have their coloquial name.

As ever, I'm much obliged for any pointers. Received on Wed Oct 26 2005 - 19:40:25 CEST

Original text of this message