Search Mailing List Archives
[protege-discussion] Algernon - :count
mhewett at evincii.com
Tue Mar 27 09:22:29 PDT 2007
Your rule will fire when the name of an instance of Box changes
and (maybe) when an instance of Box is created.
The first step is to verify that the rule actually fires. You could
do that by putting a :PRINTLN statement after the :NAME statement.
Second, turn on tracing (:TRACE :VERBOSE) and you can
watch the rule firing to see what is going wrong. Remember that
Algernon error messages are printed to the console, not to the
Algernon Tab window. You can also trace specific rules.
Tracing usually prints enough information to tell what is going wrong.
The next level of tracing (:TRACE :DETAIL) will give you a little
more information. Use (:TRACE :NORMAL) to return to normal
p.s. You also said that a Box has an "Items" slot but in the rule
you call it "Item".
Robert Dave wrote:
> I would like to use in Algernon a rule which counts the number of items in a
> multiple slot and them write the number in a integer slot. I tried the following
> code, but it doesn't work :
> (tell ((:add-rule Box
> ((:Name ?c ?f)(:count ?num ?p (Items ?c ?p))
> -> (Number_of_Items ?c ?num)
> Box has two slots : Item (multiple) and Number_of_Items (single)
> Thx in advance,
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
More information about the protege-discussion