I think Andreas Andreakis wrote:
> 
> I defined the following Fact:
> 
> (deftemplate triple
>     (slot subject)
>     (slot property)
>     (slot object))
> 

Yuk. This is like deciding that an entire Java application is going to
use only this class:

class Triple {
  public String subject;
  public String property;
  public String object;
}

You wouldn't do that, would you?

...

> I?m currently experiencing a performance problem

Yes. Jess has to root through all your data to find anything.


> In my usecase it would be semanticly correct if rule1 fires first until 
> no other facts are available and then rule2. 

That may well be, but it won't impact performance at all. Your
performance issue is in pattern matching, not in rule firing. Rule
firing is rarely the issue.

> So I need an execution Control.

No, you need better data structures! Define separate templates for
"weblog entries" and "entry tags" and "weblog tags" and such.


> (defrule RULE-2
>         (MAIN::triple (subject ?X) (property "Weblog.tag") (object ?T))
>         (MAIN::triple (subject ?T) (property "Tag.value") (object ?V))
>         (MAIN::triple (subject ?Y) (property "Weblog.tag") (object ?G))
>         (MAIN::triple (subject ?G) (property "Tag.value") (object ?V))


The above could be improved by reversing the third and fourth
patterns; the sooner the join of the two "?Vs" is done, the fewer
partial matches will be formed, and that's good for performance
too. This will hold true even after you change to using more specific
templates. 


---------------------------------------------------------
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://herzberg.ca.sandia.gov

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to