Re: powerloom.PLI and concepts

Thomas Russ <[email protected]>
Newsgroups gmane.comp.ai.powerloom
Message-ID <[email protected]>
On Mar 8, 2005, at 5:33 AM, Krzysztof Janowicz wrote:

> hello,
>
> i have a very basic question about how to use the PLI class to create 
> new concepts. in cases such as (DEFCONCEPT PERSON) it is very easy 
> using PLI.createConcept(....), but how to handle cases such as:
> (defconcept parent (?p)
>   :<=> (and (person ?p) (exists ?c (parent-of ?p ?c))))
> or more complex ones?
> This is not possible using the method above.
> Shall I first define the concept and use assert then? how?

To use the more sophisticated parts of the PowerLoom language via
the Java PLI interface, you will need to use the "sEvaluate"  method.

This method takes a String argument that is then evaluated, so
one would therefore call it like this:

PLI.sevaluate("(defconcept parent (?p) :<=> (and (person ?p) (exists ?c 
(parent-of ?p ?c))))",
               "MY-MODULE", null);

> As i can write statements like that one above into a file and load 
> them into powerloom i hoped that it is possible with the java 
> interface too.
> are there any (simple) codeing examples available? they will be very 
> useful.

I don't have a fully self-contained example, but I will send
you (separately) a Java example file from one of our projects.

> thanks!
> kind regards
> k.janowicz
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.