Re: Normalizing Every Thing with XDb2

From: x <x-false_at_yahoo.com>
Date: Wed, 28 Jul 2004 10:32:59 +0300
Message-ID: <410756ae$1_at_post.usenet.com>


  • Post for FREE via your newsreader at post.usenet.com ****

"Neo" <neo55592_at_hotmail.com> wrote in message news:4b45d3ad.0407271808.64463c9c_at_posting.google.com...
> > > www.xdb2.com/Example/BoxProperties.asp shows a box whose thickness is
1 cm,
> > > weighs 1 kg and costs 1 $. Each property references the same quantity
1.

> > x wrote: I looked at your example and I have only seen three pictures
that
> > means nothing.

> In general, when the tree shows:
> thing
> inst: box
> inst: box1
> thickness: 1cm
> qty: 1
> unit: cm
> It means:
> thing's instance is box.
> box's instance is box1.
> box1's thickness is 1cm.
> 1cm's qty is 1.
> 1cm's unit is cm....

> >I have not seen the script you used to create the database.

> Below is the script to create the db:

>

> create *quantity cls thing. // *x => create a new thing and name it x.
> create *1 cls quantity.
>

> create *unit cls thing.
> create *cm cls unit.
> create *kg cls unit.
> create *$ cls unit.
>

> create *distance cls thing.
> create *. // Create a new thing.
> create * cls distance. // ' * ' refers last new thing created by
'*.'

> create * quantity 1.
> create * unit cm.
>

> create *mass cls thing.
> create *.
> create * cls mass.
> create * quantity 1.
> create * unit kg.
>

> create *money cls thing.
> create *.
> create * cls money.
> create * quantity 1.
> create * unit $.
>

> create *thickness cls relator.
> create *weight cls relator.
> create *cost cls relator.

> create *box cls thing.
> create *box1 cls box.
> create box1 thickness (distance)((quantity)1)((unit)cm). // Rel
expression
> create box1 weight (mass)(1)(kg). // Simplified relational
expression
> create box1 cost (money)(1)($).

> If someone could suggest a clearer syntax, I am open to suggestions.

When you insert 100 boxes with different quantities, you need to assert in two different places that each number is a quantity AND a measure for some box.
I suggest you change this.

Also I suggest you get rid of those parentheses.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

  • Usenet.com - The #1 Usenet Newsgroup Service on The Planet! *** http://www.usenet.com Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Received on Wed Jul 28 2004 - 09:32:59 CEST

Original text of this message