Hello Kevin,

Although I'm not really sure if I understand your question completely, this
is how I handle facts that have objects as parameters:

For example I have an object that represents the predicate Have, with two
slots: the owner and the possession. Owner is an object (of class Being) and
possession is also an object (of class PhysicalObject):

class Have
{
        public Being            m_owner;
        public PhysicalObject   m_possession;
}

I use defclass and definstance to transform a Have object into a Jess fact,
that looks something like this:
(MAIN::have (class <External-Address:java.lang.Class>) (owner
<External-Address:storyagents.storyworldontology.Being>) (possession
<External-Address:storyagents.storyworldontology.PhysicalObject>)  (OBJECT
<External-Address:storyagents.storyworldontology.Have>))

When I want to match on this fact in a rule, I could do the following thing:

(defrule John-has-something
        (have (owner ?o) (possession ?p))
        =>
        (if (eq (call ?o getName) "John) etc....
)

So the real check is performed after the =>. I don't know if this is the
right way to handle this and maybe there are more efficient methods, but I
don't know them ;-(

Bye,
Sander



> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On
> Behalf Of Kevin Kelly Aug
> Subject: JESS: Using complex java types in JESS
>
> I am attempting to create a java system that uses JESS as the back end
> knowledge base.  I am allowing facts to use any java object as the
> parameters of the fact.  Doing that in JESS is very straight forward.
> What I can't seem to figure out is how to match on those facts in a
> rule.  Since the rule can only be created using the executeCommand
> method, I need to convert a match with java objects into some sort of
> JESS language string.  I can't figure out how to do that.
> Does anybody
> know how to do this?


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to