Re: Storing data and code in a Db with LISP-like interface
Date: 27 Apr 2006 21:35:32 -0700
Message-ID: <1146198932.067812.184870_at_j33g2000cwa.googlegroups.com>
Ok, now I see why representing "john likes tomato1" could be considering "re-engineering" similar to that required to implement a spec stating "The file should be opened" and "The corresponding items have to be moved".
> > // Create john likes tomato1.
> > (create john like tomato1)
>
> Except for the 'create' part it is ok with me, that is, indepedendent enough for me for now. It 'll do. Going off into babble such as this doesn't help:
Ok, I didn't expect someone familiar with RM/RMDBs/SQL to have such difficulties with 'create'.
> Establish the fact that a person by the name of john likes tomato1. What does he like? Is it a type of tomato or are we talking about this one? Does he like it as food? Does he like the colour? Ad infinitum. That's why IRL I prefer real lists of, with real explanations by, the people who know what they are keeping track of, and know why they must. "john likes tomato1" looks like something an amateur cook would like to know when he invites some friends over for dinner. I can make some sense out of it, so it'll do.
Now I see why you had to re-engineer when you saw "create john likes tomato1".
> Not sure. While I collected the prolog clauses it really felt like re-engineering.
Ok, re-engineering it is then.
> >>>[ person (john) ] how does one determine the name of the relationship via code?
> >
> >>There is no [way], because I did not provide a name for this relationship.
> >
> > It seems there maybe yet another reason. Prolog may not provide a
> > method to determine the function given one set of parameter already
> > specified. Can some experiences Prologer correct me on this?
>
> Can you make your statement in a way which is more test-friendly?
Then when prolog is asked, what is the relationship between john and johnny, it should respond similar to "john's son johnny" and vice versa. Here is how to do it in dbd:
(create johnny parent john)
(create john child johnny)
// Following displays parent.
(msgbox (& (select verb instance *) (select johnny * john)) )
// Following displays child.
(msgbox (& (select verb instance *) (select john * johnny)) )
In dbd, one can also represent the relationship between verbs, ie parent and child as
(create parent reciprocal child)
(create child reciprocal parent)
Unlikely, my concept of thing is the most general possible.
Your concept of thing is more limited than mine.
So that one can determine the relationship between any two things.
> > So that the Prolog solution could answer the questions: what is the
> > relationship between john and person; and what is the relationship
> > between person and john.
>
> I'll re-ask: for what purpose do you need to know it?
> Which information need are you satisfying/preempting whith it?
> This would shed some light on what to record.
Imagine an andriod is introduced to a group of humans. The droid is told john's girlfriend is sally, sally mom is martha, martha's sister is ellen, etc. Later when the droid happens to meet john and sally together, it can query the relationship between the two, tailor the conversation for them or make better sense of things in context of the fact they are related as girlfriend/boyfriend :) Received on Fri Apr 28 2006 - 06:35:32 CEST