Re: Demo: Modelling Cost of Travel Paths Between Towns

From: Neo <neo55592_at_hotmail.com>
Date: 21 Nov 2004 10:19:47 -0800
Message-ID: <4b45d3ad.0411211019.646e3e_at_posting.google.com>


Neo: Demo XDb2's flexibility compared to RM. In particular, that XDb2's query ("SELECT %.age & %.name=john;") to find any thing with age and name john, written once at design-time, continues to work forever regardless of what things have to be represented later. Assume RMDM and R2D2 are two robots sent to Mars. RMDM is based on RM and uses Alan's initial schema shown below. R2D2 is based on XDb2 which doesn't require user to specify a schema.

Alan's initial RM schema:
CREATE TABLE test (class VCHAR PK, name VCHAR PK, age NUMBER);

Alan's initial RM query to find things with age and name john ???: SELECT * FROM test WHERE age > 0;

Neo: Suppose RMDM and R2D2 meet a martian who doesn't have a name and his age is unknown. Here is how R2D2 represents him using XDb2:

CREATE *martian.cls = thing; // Create a martian class
CREATE *;                    // Create a thing
CREATE it.cls = martian;     // Classify it as a martian

// Execute query, finds nothing (for now) SELECT %.age & %.name=john;

Alan: RM's equivalent is...
INSERT INTO test VALUES(whatever they are, but name='Neotest1', age='-1')
SELECT * FROM test WHERE age > 0;

Neo asserts: Provided RM schema incurrs NULLs in the above case which are being masked over by "Neotest1" and "-1" leading to 3VL. See
"Missing Info" chapter in CJ Date's "Intro to Db Systems" which ends
with "NULLs and 3VL undermine the entire foundation of the relational model".

Alan asserts: There are no NULLs, but unknowns are represented by
"Neotest1" and "-1" and are known by users and progammers of the
system.

Neo: Next case, suppose RMDM and R2D2 meet a second life form. It can be classified as a martian and plutonian, he has two names and three ages. Here is how R2D2 represents him using XDb2:

CREATE *plutonian.cls = thing; // Create plutonian
CREATE *age.cls = thing;       // Create age
CREATE *;                      // Create a thing
CREATE it.cls = martian;       // Classify it as a martian
CREATE it.cls = plutonian;     // Classify it as a plutonian
CREATE it.name = mary;         // Set its 1st name
CREATE it.name = john;         // Set its 2nd name
CREATE it.age = +1;            // Set its 1st age
CREATE it.age = +2.5;          // Set its 2nd age
CREATE it.age = +thirty;       // Set its 3rd age

// Execute query, finds the above life form SELECT %.age & %.name=john;

Could you show how RMDM handles above case, else provide updated RM schema and query.

Note: I didn't include script to type the ages; however, a similar case is posted at www.xdb2.com/example/ex110.asp Received on Sun Nov 21 2004 - 19:19:47 CET

Original text of this message