| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Storing data and code in a Db with LISP-like interface
Neo wrote:
>>...
It depends on your information need.
What do you want to know about the relationship?
Which questions are you going to ask about it?
> The following displays "class"
> (msgbox (and (select verb instance *) (select john * person)))
>
> And the following display "instance"
> (msgbox (and (select verb instance *) (select person * john)))
>
> How would one do this in Prolog?
What do the answers to both queries tell me?
I apologize for replying to your questions with other questions. I think that in order to be able to come up with a more definite answer, I need a better sense of the purpose of the questions.
>>>If "isa (john, person)" and "instance (person, john)" are possible, >>>can I relate isa and instance? >> >>In several ways.
If you are not going to try you will keep them.
>>>Can I write "opposite (isa, instance)" and "opposite (instance, isa)"? >> >>Not sure what you mean here.
>>>Can functions be parameters of other functions? >> >>Yes, second order logic is possible.
>>>>thing(X):-vegetable(X). >>> >>>Based on my limited knowledge of Prolog, >>>it is not clear if vegetable isa thing. >> >>Not according to this clause. This clause could read as: >>If X is a vegetable, it is a thing.
No, not Prolog's, just neof.pro's (as interpreted by prolog).
> thing
> -instance-
There was no mention of instance in neof.pro, because it was (and is) not clear to me how (and what of) "instance" is needed and how it is part of the universe of discourse.
> tomato1
That tomato1 is a thing was not given as a ground fact, but inferred. Does that matter?
> fruit
> -instance-
> tomato1
> vegetable
> -instance-
> tomato1
>
> The difference being, fruit and vegetables are not classied as things.
Catagories as things - do you need that?
> An app could not determine this based on things represented.
Which is not at all surprising because these categories weren't represented as things.
Why do you think it is noteworthy?
>>>isa thing. What does the following return? >>>?- thing(vegetable). >> >>I would expect prolog to return "No".
add "
thing(vegetable).
"
to your program/database and find out. I see no need.
>>>How do I express the following query in Prolog: >>>Find a person who likes a fruit and a vegetable. >>>(and (select person instance *) >>> (select * like (and (select vegetable instance *) >>> (select fruit instance *)))) >> >>?- person(P), likes(P, F), likes(P, V), fruit(F), vegetable(V).
P = john
Thing = tomato1 ;
No
>>>Can one add attributes to "likes" in Prolog? >> >>Did you try?
BTW flexibility in general is IMO not something to aim for.
> on user who know more than I can gather by briefly browsing over Prolog
> manuals :)
Give it a few hours. Download some prolog and play with just neof.pro and some queries. I really think you will not regret that. I am not claiming prolog is the perfect tool for you, but I do think playing with it would give you some interesting perspectives on your quest.
>>>If you (or someone) can update the Prolog example and bring it closer
![]() |
![]() |