Re: Resiliency To New Data Requirements

From: Neo <neo55592_at_hotmail.com>
Date: 4 Aug 2006 09:19:17 -0700
Message-ID: <1154708356.981012.290750_at_75g2000cwc.googlegroups.com>


> ... illustrate what all the chicken scratching and ju-ju are doing...

Ok, we can do this by extending a prior example posted by you in "Poll: Expert user vs. Internals Expert". Below you used Tutorial D(?) to model that Bob and JayDee are sages, and Neo is a jerk, and that Bob's state is on, and Neo's state is off.

var sage real relation { name char } key { name } ; sage += relation {tuple { name 'Bob' }, tuple { name 'JayDee' } };

var jerk real relation { name char } key { name } ; jerk += relation {tuple { name 'Neo' } } ;

var state real relation { name char, state char } key { name } ; state += relation {tuple { name 'Bob', state 'on' }, tuple { name 'Neo', state 'off' } } ;

Below is dbd's roughly equivalent script:
(new 'bob 'sage)
(new 'jayDee 'sage)
(new 'neo 'jerk)

(new 'on 'state)
(new 'off 'state)

(create bob state on)
(create neo state off)

Now JayDee, could you to extend your initial example to match dbd's extension below:

(; Find bob's relationship to sage)
(; Finds class)
(select bob * sage)

(; Find sage's relationship to bob)
(; Finds instance)
(select sage * bob)

(; Represent that classifications sages and jerks are opposites)
(new 'opposite 'verb)
(create sage opposite jerk)
(create jerk opposite sage)

(; Find things whose classification is opposite of neo's)
(; Finds bob and jayDee)
(select (select (select neo class *) opposite *) instance *)

(; Represent that states on and off are opposites)
(; Note: the verb/relator opposite already exists in db)
(create on opposite off)
(create off opposite on)

(; Find things whose state is opposite of neo's)
(; Finds bob)
(select * state (select (select neo state *) opposite *))

Note: currently, dbd doesn't implement functions such as NOT, min, max, avg, sum, total, etc in it's select statements thus examples are limited to queries without them. Received on Fri Aug 04 2006 - 18:19:17 CEST

Original text of this message