Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / General DB Topics / General DB Topics / November 2004

Tip: Looking for answers? Try searching our database.

Demo: John, Mary and R2D2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Neo - 10 Nov 2004 03:10 GMT
The following example (www.xdb2.com/Example/Ex113.asp)
represents/queries the following things:

john is a person whose profession is gardener.
mary is a horse whose breed is mustang.
r2d2 is a robot whose cpu is 8051.
mary bite r2d2 before breakfast.
r2d2 hit mary during lunch.
(r2d2 hit mary during lunch) because (mary bite r2d2 before
breakfast).
john reboot r2d2 after dinner.
(john reboot r2d2 after dinner) because (r2d2 hit mary during lunch).

The above things are created by the script below:

// Create profession class
CREATE2 *profession.cls = thing;

// Create breed class
CREATE2 *breed.cls = thing;

// Create cpu class
CREATE2 *cpu.cls = thing;

// Create person named john who is a gardener
CREATE2 *person.cls = thing;
CREATE2 *john.cls = person;
CREATE2 john.profession = +gardener;

// Create horse named mary who is a mustang
CREATE2 *horse.cls = thing;
CREATE2 *mary.cls = horse;
CREATE2 mary.breed = +mustang;

// Create robot named r2d2 powered by a 8051 cpu
CREATE2 *robot.cls = thing;
CREATE2 *r2d2.cls = robot;
CREATE2 r2d2.cpu = +8051;

// Create verbs
CREATE2 *like.cls = verb;
CREATE2 *bite.cls = verb;
CREATE2 *hit.cls = verb;
CREATE2 *reboot.cls = verb;
CREATE2 *because.cls = verb;

// Create prepositions
CREATE2 *before.cls = preposition;
CREATE2 *during.cls = preposition;
CREATE2 *after.cls = preposition;

// Create meals
CREATE2 *meal.cls = thing;
CREATE2 *breakfast.cls = meal;
CREATE2 *lunch.cls = meal;
CREATE2 *dinner.cls = meal;

// Create a story
CREATE2 john.like = mary;
CREATE2 mary.like = john;
CREATE2 (john.like=mary).because = (mary.like=john);
CREATE2 mary.bite = r2d2 @before = breakfast;
CREATE2 r2d2.hit = mary @during = lunch;
CREATE2 (r2d2.hit=mary @during=lunch).because = (mary.bite=r2d2
@before=breakfast);
CREATE2 john.reboot = r2d2 @after = dinner;
CREATE2 (john.reboot=r2d2 @after=dinner).because = (r2d2.hit=mary
@during=lunch);

// Queries

// Who did mary bite?
// Finds r2d2.
SELECT2 mary.bite = %;

// Who hit mary?
// Finds r2d2.
SELECT2 %.hit = mary;

// What did r2d2 do to mary?
// Finds hit
SELECT2 r2d2.% = mary;

// What kind of thing likes john?
// Finds horse (not mary).
SELECT2 %.cls=thing & %.inst=(%.like=john);

// Why did r2d2 hit mary?
// Finds mary.bite=r2d2 before breakfast.
SELECT2 (r2d2.hit=mary).because = %;

// What did john do to r2d2 after dinner?
// Finds reboot.
SELECT2 john.%=r2d2 @after=dinner;
Neo - 16 Nov 2004 17:35 GMT
> From thread titled "Relational vs network vs hierarchic databases"
> Browne: Perhaps you should try finding something that _can't_ be easily
[quoted text clipped - 15 lines]
> Marshall: With regards to what set of operations? Otherwise I'm going to
> stick with my "string" answer, because it's easiest.

With regards to the below queries (on new data set: John, Mary, R2D2)

// Who did mary bite?
// Finds r2d2.
SELECT2 mary.bite = %;

// Who hit mary?
// Finds r2d2.
SELECT2 %.hit = mary;

// What did r2d2 do to mary?
// Finds hit
SELECT2 r2d2.% = mary;

// What kind of thing likes john?
// Finds horse (not mary).
SELECT2 %.cls=thing & %.inst=(%.like=john);

// Why did r2d2 hit mary?
// Finds mary.bite=r2d2 before breakfast.
SELECT2 (r2d2.hit=mary).because = %;

// What did john do to r2d2 after dinner?
// Finds reboot.
SELECT2 john.%=r2d2 @after=dinner;

Let me know if you need me to convert XDb2's script to RM's equivalent
normalized/NULL-less schema in a manner similar to that in thread
titled "Demo: Db for Dummies".
Gene Wirchenko - 17 Nov 2004 04:46 GMT
[snip]

>Let me know if you need me to convert XDb2's script to RM's equivalent
>normalized/NULL-less schema in a manner similar to that in thread
>titled "Demo: Db for Dummies".

    Nope, not at all.

    Some money would be nice though.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
    I have preferences.
    You have biases.
    He/She has prejudices.
Neo - 20 Nov 2004 00:22 GMT
> From OT "A Normalization Question", Marshall wrote: I consider it telling
> that all the examples you come up with are nonsensical. WTF does
> "John obeys army" mean? How come your missing-data examples involve people
> with two different color eyes? "'brown' is a string" is a proposition?

Sensical examples are for limited data models.

> Have you ever had a job that involved data management?

:)

> Clearly not, which is why you don't have any examples that make any sense;
> you have no experience with the actual domain under discussion.

Could you tell me which of the examples listed at
www.xdb2.com/example/default.asp don't make any sense to you?

> Even the question of whether pizza toppings are ordered or not
> makes more sense than the stuff you come up with.

Here is a pizza example (www.xdb2.com/Example/Ex108.asp).

> Instead of making up new meanings for existing well-defined terms,
> howsabout you come up with a way to solve problems
> *people actually have* that's better than what they have now?

Try the one in the thread titled "Demo: Db for Dummies" or the one
posted at the start of this thread. Wouldn't you say it is better than
using strings?
Marshall Spight - 20 Nov 2004 03:05 GMT
> > From OT "A Normalization Question", Marshall wrote: I consider it telling
> > that all the examples you come up with are nonsensical. WTF does
[quoted text clipped - 25 lines]
> posted at the start of this thread. Wouldn't you say it is better than
> using strings?

Um, didn't I post that like, months ago? Have you been working on
your reply all this time?

BTW, the usual meaning of "OT" as an abbreviation is "off-topic."

Marshall
Gene Wirchenko - 20 Nov 2004 05:30 GMT
>> From OT "A Normalization Question", Marshall wrote: I consider it telling
>> that all the examples you come up with are nonsensical. WTF does
>> "John obeys army" mean? How come your missing-data examples involve people
>> with two different color eyes? "'brown' is a string" is a proposition?
>
>Sensical examples are for limited data models.

    Neo, here is a slogan for you to use in your marketing:
         XDb2: the DBMS for the demented and insane.
It is a gift.  Really.  Please do not send me any money for it, as
Hugo would get jealous.  You really should pay him first.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
    I have preferences.
    You have biases.
    He/She has prejudices.
Neo - 21 Nov 2004 01:34 GMT
> > Marshall: Your belief [that thinking about how you think results
> > in understanding intelligence] is invalid.
> > It's been tried many times;
> > it doesn't work.
>
> Neo: Are you reading what you are writing?

Marshall: Damn straight. I'm quite confident in it as well. I first
became aware of the impossibility of introspection as a valid tool for
understanding the nature of intelligence while aquiring a degree in
psychology from UC Berkeley, which I did on the side while also
pursuing a computer science degree. Introspection (and intuition) fail
even when applied to simple cognitive tasks.

You brain is hardwired to present you with the belief that you know
what's going on, and that your perception is valid. In cases where
incomplete input is available, it actually makes stuff up on a
best-guess basis and still presents it as fact. Anyone who ever saw a
pretty girl at a distance that turned out to be a mailbox when you got
close has experienced this phenomenon.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.