Queries are just like rules; the patterns you write have to match the
facts you actually have.
The pattern "(station ?station)" matches when the station multislot
contains exactly one station. "(station ?s1 ?s2)" matches when there
are exactly two. A multifield matches any number: "(station $?all)".
See "Jess in Action" page 103.
On Mar 25, 2007, at 12:27 AM, ricktee wrote:
Hi,
I just changed
(deftemplate match-muscle-machine
(slot body-part)
(multislot station) );;close
(asserrt (match-muscle-machine (body-part arms-
upperfront)
(station N5 N8 N10 C1)) )
to
(deftemplate match-muscle-machine
(slot body-part)
(slot station) );;close
(asserrt (match-muscle-machine (body-part arms-
upperfront)
(station N5)) )
and it works.
Is there any way for me to get a string from a multislot (station
N5 N8 N10
C1)) ) using defquery?
thanks
rick
ricktee wrote:
Good day,
The write query example at
http://herzberg.ca.sandia.gov/jess/docs/70/queries.html#write_query
shows that it is able to get variables from single slots. Does it
also
work with multislots? 'Cos I can't get mine to work.
I have this template & fact
(deftemplate match-muscle-machine
(slot body-part)
(multislot station) );;close
(asserrt (match-muscle-machine (body-part arms-upperfront)
(station
N5 N8 N10 C1)) )
I'm using this query
defquery search-relevant-machines "Get the relevant machines"
(declare (variables ?findx))
(match-muscle-machine
(body-part ?findx) (station ?station)) )
In java I'm using
QueryResult result =
r.runQueryStar("search-relevant-machines", new
ValueVector().add("arms-upperfront"));
if (result.next()) {
System.out.println( "\n query run is successful \n
" );
It has no errors but the program doesn't get to "System.out.println
( "\n
query run is successful \n " );"
How can I use query result on facts with multislots?
thanks
rick
--
View this message in context: http://www.nabble.com/Can-QueryResult-
result-work-with-multislots-facts--tf3461027.html#a9657250
Sent from the Jess mailing list archive at Nabble.com.
--------------------------------------------------------------------
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 owner-jess-
[EMAIL PROTECTED]
--------------------------------------------------------------------
---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://www.jessrules.com
--------------------------------------------------------------------
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]
--------------------------------------------------------------------