Hello Ernest,

> OK, anyway, the trick is to use
> (have (possession-type (class (call Class forName "package.pencil"))))

Thanks for your quick answer :-)

Am I correct in assuming that to use this trick means to add an extra type
slot to my predicates for every existing slot? For example the predicate
(have) has two slots: (possession, owner). I should add two extra:
(possession, possession-type, owner, owner-type).
If this is the case, then is there an elegant way to do this from Java code?
Basically what my agent does is iterating a list of Java classes in the
ontology and for every class execute the defclass function with an optional
extends argument. Is it possible to not add the additional type-slots
(possession-type, owner-type) to the Java classes, but to add them while
defclassing the classes and connect them to the slots' class types?

For example the java class is:
class Have implements Predicate
{
        PhysicalObject  possession;
        HumanBeing              owner;
}

defclass generates the following deftemplate:
"(deftemplate MAIN::have extends MAIN::__fact \"$JAVA-OBJECT$
storyagents.storyworldontology.Have\"
 (slot class (default <External-Address:jess.SerializablePD>))
 (slot owner (default <External-Address:jess.SerializablePD>))
 (slot possession (default <External-Address:jess.SerializablePD>))
 (slot OBJECT (type 2048)))"

Is it possible to modify this template by adding the additional slots
(owner-type, possession-type) and connecting them to the class types of
(owner, possession)?

Bye,
Sander


--------------------------------------------------------------------
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