Hello,
 
I have facts defined for deftemplate below:

(deftemplate Result
      (slot ClassRecognized (type STRING))
      (multislot Class)
      (slot Score (type INTEGER))
      (slot TotalScore (type INTEGER))
)

I would like get the fact-id where the slot ClassRecognized has a specified value, then a made the query:

(defquery search-result
       (declare (variables ?X))
       (Result  (ClassRecognized ?c&:(eq ?c ?X)))
 )


The follow function returns list of facts (<External-Address:jess.Fact>) for given query with one variable
and value of this variable:

(deffunction query-facts (?qry ?val)
       (bind ?i (run-query ?qry ?val))
       (bind ?r (create$))
       (while (?i hasNext)
              (bind ?r (create$ ?r (call (?i next) fact 1))))
       (return ?r))


(query-facts search-result "Artificial")

I need modify some values of slots of the specified facts, i don't know to get these values and the fact-id.
 
Somebody help me, please.
Thanks, Eunice Palmeira

Reply via email to