Re: Nearest Common Ancestor Report (XDb1's $1000 Challenge)

From: Hugo Kornelis <hugo_at_pe_NO_rFact.in_SPAM_fo>
Date: Thu, 27 May 2004 23:30:32 +0200
Message-ID: <87ncb014k5l0sgtphvdvi2um783hdhs0e8_at_4ax.com>


On 26 May 2004 09:39:29 -0700, Neo wrote:

>> If the requirements had even allowed two things of the same class to share
>> the same name (e.g. two persons named 'john'), I would have asked for more
>> information, because an RDBMS requires a possibility to identify each
>> individual row in a table. (I don't know if XDb1 has such a requirement; I
>> hope it does, because there is not much use in storing data about things
>> if you have no way of knowing WHICH thing you're storing data about
>
>XDb1 allows user to store two persons with the same properties (ie.
>named john) in db. If the user doesn't want this to happen, the burden
>falls upon the user to verify a similar thing does not already exist
>before creating new one. XDb1's NLI, GUI and API allow the user to do
>so. Below is psuedo code that allows user to limit entry to just one
>person named john.
>
>// Find number of persons named john in db
> cntr = 0
> while ( pT = X("(person) john") ){
> cntr = cntr + 1;
> }
>
>// If no persons named john exist, create one
> if (cntr == 0) {
> pJohn = T_create()
> T_relate(pJohn, rCls, pPerson)
> T_Name_relate(pJohn, "john")
> }

Can this code be put into the database, like a CHECK clause or a TRIGGER in a RDBMS?

If not, what's the point? I can do all the error checking I like in my front end application, but if the end user can still enter buggy data through the NLI interface, it won't help.

>> if there are two persons named john in my office,
>> what use is the statement 'john is 35' to me?)
>
>If there are two or more johns in the db, XDb1's GUI responds 'john is
>ambigious, please select it'. Via code, user can determine that there
>are more than one john and can choose to modify none, all, or prompt
>user for further help.

When I created two things named john (one a person and one a dog) and entered 'john is 35.', I got no prompt at all. XDb1 just selected one of the johns to relate to 35.

Best, Hugo

-- 

(Remove _NO_ and _SPAM_ to get my e-mail address)
Received on Thu May 27 2004 - 23:30:32 CEST

Original text of this message