Re: MultiValue Databases

From: Neo <neo55592_at_hotmail.com>
Date: 8 Jun 2005 08:39:06 -0700
Message-ID: <1118245146.123728.31340_at_g43g2000cwa.googlegroups.com>


Again, thanks for posting RM script to allow a comparison. As indicated, one needs to use a different RM schema to support the additional data/queries requested after the initial db/schema was completed. Also, in some circumstances, one might need to either move the original data to new db or update existing db rather then recreate the entire db from scratch. Notice that xrdb did not require such changes to accommodate additional data/query in this particular case. I am proposing that this results from xrdb's data model being more general than RM. I am aware that one cannot draw such a definitive conclusion from one trivial example (my conclusion in based on my understanding of both models). In fact, Lee suspects that I rig the examples to my advantage. I propose that a neutral party specify some data requirements and then add/modify them in several stages and see how xrdb and RM handle them. In the past, I suggested example 123
(www.xrdb.com/example/default.asp). It models 10 computer systems, each
quite different. Once someone posts a script for the first 10, a neutral party can specify more, each being different than the prior, each being known only after the prior has be stored in order to show how the two models handle schema evolution. Example 117 (Property Listings) would also be another good candidate to highlight db flexibility and schema evolution.

I have consolidated the current xrdb and RM scripts below to allow a clearer comparison. Note that I have made some minor additions to the RM script, however it is still not quite equivalent. Could someone update it? See details below.

  • xrdb script ***********************************************
    (CREATE type inst *person & dir item it)
    (CREATE type inst *phone#)
    (CREATE person inst *john)
    (CREATE john phone# +111-1111)
    (CREATE john phone# +222-2222)
    (CREATE person inst *mary & it phone# +222-2222)
    (CREATE person inst *bob)
    (SELECT * phone# 111-1111 & * phone# 222-2222) // returns john.

// Additional data/query that was not known when db was first created.
(CREATE verb inst *like)
(CREATE john like mary)
(SELECT john * mary) // Query returns like.
(SELECT john * 111-1111) // Query returns phone#.

  • RM script **************************************************** Note: This script creates a new db from scratch rather than updating original db with data. Note: The query to find person with phone#s is missing. Note: The RM schema stores verbs in a redundant manner where as they are normalized in xrdb. This type of redundancy might require one to update the RM schema under certain new data requirements (ie adding attributes to verbs). We can explore this situation if someone is willing.

CREATE TABLE entities (id, name);

INSERT INTO entities VALUES(1, "John");
INSERT INTO entities VALUES(2, "Mary");
INSERT INTO entities VALUES(3, "Bob");
INSERT INTO entities VALUES(4, "111-1111");
INSERT INTO entities VALUES(5, "222-2222");

CREATE TABLE relationships (subject_id, object_id, verb);

INSERT INTO relationships VALUES(1, 4, "has the phone number");
INSERT INTO relationships VALUES(1, 5, "has the phone number");
INSERT INTO relationships VALUES(2, 5, "has the phone number");
INSERT INTO relationships VALUES(1, 2, "likes");

// ??? Query to find persons with phone# 111-1111 and 222-2222 ??? // Could someone provide this?

// Find relationship between John and Mary. SELECT verb
FROM relationships,

       entities AS subject,
       entities AS object

WHERE relationships.subject_id = subject.id AND relationships.object_id = object.id AND subject.name = "John"
AND object.name = "Mary";

// Find relationship between John and "111-1111": SELECT verb
FROM relationships,

       entities AS subject,
       entities AS object

WHERE relationships.subject_id = subject.id AND relationships.object_id = object.id AND subject.name = "John"
AND object.name = "111-1111";

> Perhaps you could answer
> Lee's questions to show good faith in the debate.

Which question are you referring to?

> An interesting Third Year Project for a student might be to implement > xrdb using relational algebra.

:)

> I'm happy to provide [above] answer ..., but it will be the last.

Would someone else be willing to add extension numbers, operational days of the weeks and hours to the phone numbers (ie ph# 111-1111 ext# 123 answered Monday from 9AM to 11AM and 1PM to 4PM) to see the impact on xrdb vs RMDB (if someone were to design a generic/universal schema initially, they might reduce the need to make future schema changes). Received on Wed Jun 08 2005 - 17:39:06 CEST

Original text of this message