Re: Simple Example, How To Model It In RM

From: Tony Andrews <andrewst_at_onetel.com>
Date: 30 Jun 2005 05:12:14 -0700
Message-ID: <1120133534.642106.73140_at_g14g2000cwa.googlegroups.com>


Neo wrote:
> Feel free to model with more appropriate classifications.
>
> > Also, do you expect to be able to handle more complex statements like
> > "((Sue likes John) and (Sue likes Mary)) because (Mary isFriendOf John)"?
>
> Yes, and if you would like to accommodate for those in the initial RM
> schema/query, that would be OK.

Well, I could post a relational equivalent (I will, if you insist), but there's probably no point. Of course the data can be modelled easily enough in RM, any data can, but it would then require a fairly complex application using recursion to navigate the data so that it could be easily queried by a user. You have already built such an application (Xdb), so I'm sure you know what is involved in that. I won't be attempting it.

If I ever want an application that let me store information like "((John because Mary) likes (Sue friend John)) because Sue)" then I will definitely opt for Xdb over building my own relational database ;-)

To put the boot on the other foot, what would the Xdb script look like for a simple, typical relational schema like this?:

create table department
( deptno integer primary key check (deptno between 1 and 999) , dname varchar(60) not null
);

create table employee
( empno integer primary key check (empno between 1 and 9999)

, name varchar(60) not null
, date_of_birth date not null check (date_of_birth > date '1900-01-01')
, salary number(10,2) check (salary >= 0)
, deptno references department not null

);

insert into department (deptno, dname) values (1, 'IT'); insert into department (deptno, dname) values (2, 'HR');

insert into employee (empno, name, date_of_birth, salary, deptno) values (1234, 'Mary', date '1970-01-21', 12000, 1); Received on Thu Jun 30 2005 - 14:12:14 CEST

Original text of this message