Hi,

I am trying to get the real deftemplate of a fact belonging to a
sub-deftemplate. Something like this:

(deftemplate t
    (slot foo) )
(deftemplate t1 extends t
    (slot bar))
(deftemplate t2 extends t
    (slot qwe))

; The facts
(t1 (foo 1) (bar 2))
(t2 (foo 2) (qwe 1))

Now, I am trying to get the real deftemplate name for a fact:

(defrule r
    (t (foo 1))
    =>
    (printout t "The real deftemplate name for this fact is "
???t1_or_t2??? crlf))

I want to get this from Java, so I thought of defining a defquery and
access its results (is there an easier way, e.g. through the Rete class
API?).

(defquery get-real-deftemplate-name
    (declare (variables ?foo))
    ?context <- (t (foo ?foo))
    ; NOW WHAT?
)

There is probably an easy way to do this, right?

Thanks,

Henrique

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