Jess Defquery Functions
List of Defquery functions that can be executed by Jess.
8.34. (count-query-results <query-name> <expression>+)
- Package:
-
MiscFunctions
- Arguments:
-
An atom, and zero or more additional expressions
- Returns:
-
INTEGER
- Description:
-
Runs a defquery and returns a
count of the matches. See the documentation
for defquery for more
details. Also see run-query for caveats
concerning calling count-query-results on a rule RHS.
8.122. (run-query <query-name> <expression>+)
- Package:
-
MiscFunctions
- Arguments:
-
An atom, and zero or more additional expressions
- Returns:
-
java.util.Iterator, as an EXTERNAL_ADDRESS
- Description:
-
Runs a defquery and returns a
java.util.Iterator of the matches. See the documentation
for defquery for more
details. Note that run-query can lead to backwards chaining, which can
cause rules to fire; thus if run-query is called on a rule RHS, other
rules' RHSs may run to completion before the instigating rule
completes. Putting run-query on a rule RHS can also cause the count of
executed rules returned by run to be low.