Thanks,
runQueryStar() needs at least 2 args - query name and a variable of
valuevector type.
I don't want to pass any variable as shown in TekMark example in "Jess in
Action"
Iterator result = engine.runQuery("all-products", new ValueVector());
When I pass the same blank valuevector(), it doesn't work.
QueryResult result =
engine.runQueryStar("list-courses", new ValueVector());
My query is as follows:
(defquery list-courses
(subject (sub-name ?subname))
(module (parent-subject ?subname) (mod-name ?modname))
(topic (parent-module ?modname) (topic-name ?topicname))
(concept (parent-topic ?topicname) (concept-name ?conceptname))
(learning-object (parent-concept ?conceptname) (lo-name ?LOname))
)
On Wed, Jun 26, 2013 at 7:22 PM, Friedman-Hill, Ernest
<[email protected]>wrote:
> Don’t try to get the Token – hiding that sort of ugliness is the whole
> reason run-query* exists. Use a pattern binding instead:****
>
> ** **
>
> (defquery my-query****
>
> (declare (variables ?n))****
>
> ?f <- (room (number ?n)))****
>
> ** **
>
> (bind ?r (run-query* my-query 100))****
>
> (while (?r next)****
>
> (bind ?fact (?r getObject f))****
>
> ;; … now do something with your fact ****
>
> ** **
>
> *From:* [email protected] [mailto:[email protected]] *On
> Behalf Of *Rejaul Barbhuiya
> *Sent:* Wednesday, June 26, 2013 6:22 AM
> *To:* jess-users
> *Subject:* Re: JESS: [EXTERNAL] Creating an eLearning system following
> TekMart example****
>
> ** **
>
> Thanks Ernest.****
>
> ** **
>
> In my program, I was using runQuery(arg0, arg1) and storing the result in
> a Iterator as shown below. Then I am storing the result in token and from
> token to fact.****
>
> ** **
>
> Iterator sno = engine.runQuery("session-number",new
> ValueVector().add(sidValue));****
>
> if (sno.hasNext()) {****
>
> Token token = (Token) sno.next();****
>
> Fact fact = token.fact(1);****
>
> ** **
>
> Now, I want to use runQueryStar(). But I don't know how to read the Query
> Result.****
>
> ** **
>
> QueryResult sno = engine.runQueryStar("session-number",new
> ValueVector().add(sidValue));****
>
> if (sno.next()) {****
>
> Token token = (Token) sno.*????*; *what function should I use here?*****
>
> Fact fact = token.fact(1);****
>
> ** **
>
> ** **
>
> ** **
>
> On Mon, Jun 24, 2013 at 11:06 PM, Friedman-Hill, Ernest <
> [email protected]> wrote:****
>
> You can use a query to easily find your facts; see
> http://www.jessrules.com/jess/docs/71/queries.html and in particular,
> http://www.jessrules.com/jess/docs/71/queries.html#in_java
>
>
>
>
> --------------------------------------------------------------------
> 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]