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

From: Neo <neo55592_at_hotmail.com>
Date: 20 May 2004 22:06:44 -0700
Message-ID: <4b45d3ad.0405202106.4d079b08_at_posting.google.com>


> > For example, if the user names the first person 'john' and the dog
> > also 'john', your current solution won't work.
>
> Indeed, it won't. And neither will XDb1. You obviously did not test
> this before you wrote this. Or you are a flat out liar ...

It does work. The steps you took to verify it were inappropriate. The easiest way is to use the populated db and rename fido to john. To do this, navigate to node thing/dog/fido. Click fido twice with a small delay between clicks to enter edit mode. Change fido to john and press enter. The report is as before except occurrences of 'fido' are replaced with 'john'. In this case, printing each thing's class (ie 'person/john', 'dog/john') would allow user to distinguish them.

The reason your steps did not work is because by modifying the script, you created a person named john who you then also classified as a dog. You never created a dog to rename. When you enter 'john isa person', XDb1 looks for something named john in the db. Since it does not find one, it creates a new instance of person and names it john. The same thing occurs with 'fido isa dog'. But you modified it to 'john isa dog'. Since XDb1 found a thing already named john, it thought you meant the existing person. Similar to human conversations, communication via english-like langauge can result in misinterpretation. Using the GUI or API reduces such ambiguities.

> I ended up copying and pasting the script line by line,
> but there's got to be a more efficient way, right?

Sorry, but the ability to process multiple lines is not enabled in the release version currently.  

> As I pointed out before
> - how the data is stored internally is completely irrelevant.

True, but the solution's genericness and level of data normalization is relevant because it can limit its scope. For instance the provided solution fails when two things have the same name. Received on Fri May 21 2004 - 07:06:44 CEST

Original text of this message