dbTalk Databases Forums  

Demo: John, Mary and R2D2

comp.databases.object comp.databases.object


Discuss Demo: John, Mary and R2D2 in the comp.databases.object forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Neo
 
Posts: n/a

Default Demo: John, Mary and R2D2 - 11-09-2004 , 09:10 PM






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;

Reply With Quote
  #2  
Old   
Neo
 
Posts: n/a

Default Re: Demo: John, Mary and R2D2 - 11-16-2004 , 11:35 AM






Quote:
From thread titled "Relational vs network vs hierarchic databases"
Browne: Perhaps you should try finding something that _can't_ be easily
modelled in a relational model, instead.

Neo: How would one represent the following without redundancy or NULLs?
john like mary.
mary like john.
(john like mary) because (mary like john).
bob hit mary on elbow.
john hit bob on shoulder during lunch.
(john hit bob on shoulder during lunch) because (bob hit mary on elbow).

Marshall: ... *representation* per se isn't that big of a problem.

Neo: Then please post it using RM observing good practices
such as avoiding NULLs and redundancy.

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".


Reply With Quote
  #3  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: Demo: John, Mary and R2D2 - 11-16-2004 , 10:46 PM



neo55592 (AT) hotmail (DOT) com (Neo) wrote:

[snip]

Quote:
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.


Reply With Quote
  #4  
Old   
Neo
 
Posts: n/a

Default Re: Demo: John, Mary and R2D2 - 11-19-2004 , 06:22 PM



Quote:
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.

Quote:
Have you ever had a job that involved data management?


Quote:
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?

Quote:
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).

Quote:
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?


Reply With Quote
  #5  
Old   
Marshall Spight
 
Posts: n/a

Default Re: Demo: John, Mary and R2D2 - 11-19-2004 , 09:05 PM



"Neo" <neo55592 (AT) hotmail (DOT) com> wrote

Quote:
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?
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




Reply With Quote
  #6  
Old   
Gene Wirchenko
 
Posts: n/a

Default Re: Demo: John, Mary and R2D2 - 11-19-2004 , 11:30 PM



neo55592 (AT) hotmail (DOT) com (Neo) wrote:

Quote:
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.


Reply With Quote
  #7  
Old   
Neo
 
Posts: n/a

Default Re: Demo: John, Mary and R2D2 - 11-20-2004 , 07:34 PM



Quote:
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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.