types/domains are redundant?

From: Mikito Harakiri <mikharakiri_at_iahu.com>
Date: Thu, 30 Oct 2003 17:00:28 -0800
Message-ID: <7Eiob.35$043.219_at_news.oracle.com>



"Mike" <Star.Point_at_mcsci.net> wrote in message news:a90c0da6.0304110155.1aacad7d_at_posting.google.com...
> tblLabor (Example)
>
> Amount StatisticTypeID
> ---------------------------------- -
> 25 Alpha-Microbes (count)
> .00048 Beta-Microbes (weight)
> 2 Alpha-Microbes (count)
> 8.5 Alpha-Microbes (count)
> 500,010 Gama-Micorbes (measurement)
> 3 People (count)
> 1 Charts (count)
> 5 Phone calls (count)
> ...

Let's organize all types into a separate relation:

Type Value
-------- -----
count 1
weight c*g/(s^2)
measmt 1

Lets add some more types:

Type Value Comment

--------  -----  ----------------------------------------
degrees  pi/90  for measuring angles; not temperature
float     1
string    null
c         null   centimeter
g         null   gramm
s         null   second

The idea is that every symbolic type occurrence can be substituted with the expression in the value column.

Now, back to relational theory. What is the predicate

<distance = 20 meters, time = 3 hours>

is really telling us? Is it really different from

<distance = 20*100 centimeters, time = 3*3600 seconds>

? Do we really have to code User-Defined Types in order to handle such trivial conversions? Let's extend the types relation a little bit more:

Type Value Comment

--------  -----  ----------------------------------------
meter    100*c
hour      3600*s

Then, substityting those constants into

<distance = 20*meter, time = 3*hour>

could be reduced to

<distance = 20*100*c, time = 3*3600*s>

This is trivial symbolic manipulation that the system should be able to do.

Next, notice null values left for some types. This reflects our incomplete understanding of those types. For example, if I were not aware of the identity

360 degrees = 2*pi

I might have chosen to enter null for the degree type as well.

Likewise, for a string datatype, I don't know how to reduce it to some more fundamental types. Maybe, I should consider a semigroup of all character strings, and try to find some nice identities, but I have decided not to, and just entered null.

Putting this idea to extreme, using fundamental physics equations it is possible to reduce physical CGS units to just some constants. Any quantity in those undimensional units is just some number.

The end user demands, however, query result to be presented in some units. Suppose, he queried the total weight of population of a city and got the answer:

34477.985

What units? The answer is not as meaningles, as it looks, however. If he wants the answer in pounds, then the system should solve the equation

34477.985 = x*lb

where the pound type must be defined in our types relation, and the definition must be free of nulls, of course. Received on Fri Oct 31 2003 - 02:00:28 CET

Original text of this message