(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")
Thanks, Eunice Palmeira
