Re: The OverRelational Manifesto. VOCIFEROUS IGNORANCE vs. NUMB DOGMA.(the sequel)

From: U-gene <grigoriev-e_at_yandex.ru>
Date: 29 May 2006 11:46:23 -0700
Message-ID: <1148928383.767407.160890_at_y43g2000cwc.googlegroups.com>


Once again. You can use

>> MyType { //Here I describe just tuple
>> myIdentifer INT;
>> balance DOUBLE;
>> }
>>
>>
>> ObjectType2 {
>> ...
>> SetValuedField SET OF MyType //
>> CONSTARIN myIdentifer Key;
>> ...
>> }
>>

Or you can use something like

>>
>>CREATE RelationType MyType { //Here I used "RealtionType"

                                           //what means SET already

>> myIdentifer INT;
>> balance DOUBLE;
>> } CONSTARIN myIdentifer Key
>>
>>
>> ObjectType2 {
>> ...
>> SetValuedField MyType;
>> ...
>> }
>
>But in this example field SetValuedField is one-valued. In order to
>define it as a set-valued component we need to define it as follows:
>
>ObjectType2 {
>    ...
>    SetValuedField AS SET OF MyType;
>    ...
>}

In first case I define just tuple. In second case I define MyType as something that I called "RelationType". It already means SET of tuples and constrains for it. I can rewrite second case as

CREATE MyType AS SET OF{ //This type is already a SET(!)

   myIdentifer INT;
   balance DOUBLE;
} CONSTARIN myIdentifer Key

ObjectType2 {

    ...
    SetValuedField MyType;
    ...
}

Conserning your example....

> ITEM {
>  itemId INT;
>    ...
>    price DOUBLE;
>    ...
>}
>
> ORDER {
>    orderId INT;
>    ...
>    items AS SET OF ITEM; // Ordered products
>    mainItem ITEM; // The main product
>    ...
> }

....I just want say that you cannot use SET without definition of keys. It's all I wanted to say. So you must just add key CONSTRAIN after AS SET OF ITEM in your example

> ORDER {
>    orderId INT;
>    ...
>    items AS SET OF ITEM // Ordered products
             KEY itemId;            //
>    mainItem ITEM; // The main product

> ...
> }

...to get right object type definition.

(Of course you cannot define keys when you describe tuple, because it is just tuple - not set yet).

> Could you show how this could be described using your approach (object
> types vs. valued types etc.)? In particular, how can I define two
> properties taking values from one domain:
> - a single-valued property, and
> - a multiple-valued property

It 's possible but you have to define keys when you define SETs. I've shown it.

> If this example is not very appropriate then probably you can modify it
> in order to clarify the following issue:
>
> - why do we need to distinguish between object types and valued types?
>
> I mean that we used to define types of *entities* as a number of
> *properties* which can be either *one-valued* or *set-valued*.

It is possible.

>  In your
> approach we introduce more basic notions and I am not able to construct
> an example which would demonstrate their importance and advantages.
>

 No "more basic properties". I'm just about keys here.You can describe tuple first and then SET OF these tuples or you can define SET OF {tuple schema} directly - as you wish. Received on Mon May 29 2006 - 20:46:23 CEST

Original text of this message