Search Mailing List Archives
[protege-owl] How to determine the execution sequence of swrl rules?
yfaith at 163.com
Wed Aug 1 18:42:45 PDT 2007
I am very appreciated for the answers of Martin and Timothy!
But generating SWRL queries for those rules can only examine the sequence of
execution, and it seems you still
can not control the sequence of execution.
Maybe I should not use the thinking of programming language-placing too much
emphasis on the procedure of process-to write the SWRL Rules.
As Timothy said, it seems Rules are allowed to fire at any time when
their preconditions have been met.
Recently, I am always thinking about this problem, and I think I do not have
a good appreciation to first logic.:confused:
Martin O'Connor wrote:
> One approach is to partition rules into different abstraction layers,
> with rules in lower level layers computing fairly straightforward
> abstractions and higher level layers using those computed results to
> generate successively more complex abstractions.
> In general, if you if there are complex interrelationships between
> rules, the rule base is going to be hard to debug - and the problem will
> only get worse as the number of rules increases.
> That said, you can determine what each rule is doing during an inference
> run by generating SWRL queries for those rules to examine the
> information matched during each successful firing.
> Say we have the following two rules:
> A(?a) ^ B(?b) -> C(?c)
> C(?c) -> D(?d)
> We can determine what ?a and ?bs were matched for each successful firing
> of the first rule by cloning the rule in the editor and replacing the
> head with a query built-in:
> A(?a) ^ B(?b) -> query:select(?a, ?b)
> Queries and rules are executed simultaneously in the SWRLTab so when you
> examine the results of this query in the SWRLQueryTab you will see
> exactly what values each variables were bound to when the rule fired.
> You could even just add the query built-in to the original rule head:
> A(?a) ^ B(?b) -> C(?c) ^ query:select(?a, ?b)
> but in general it is probably best to separate queries and rules.
> Timothy Redmond wrote:
>>I can give a generic rule-system answer.
>>The usual answer with rule systems is that you should not and can not
>>predict the sequence. Rules are allowed to fire at any time when
>>their preconditions have been met. The advice that is usually given
>>is to not think procedurally or about the sequence. Just try to make
>>each rule be a valid statement of what is supposed to happen
>>regardless of the timing.
>>In practice there are occasions where this is hard to do. Some rule
>>systems have facilities to help the user constrain rule execution
>>sequence when it absolutely becomes necessary (e.g. rule priorities
>>and rule modules). But I don't know how or if this could be applied
>>On Aug 1, 2007, at 2:43 AM, daphne wrote:
>>>I am very curious about how to determine the execution sequence of
>>>Sometimes the execution of one rule lies in the reasoning results
>>>However, I find sometimes it does not work as I expected, in that I
>>>decide which is the first to execute.
>>>If anyone can give me an answer, I will be very appreciated!
>>>View this message in context: http://www.nabble.com/How-to-
>>>Sent from the Protege - OWL mailing list archive at Nabble.com.
>>>protege-owl mailing list
>>>protege-owl at lists.stanford.edu
>>>Instructions for unsubscribing: http://protege.stanford.edu/doc/
>>protege-owl mailing list
>>protege-owl at lists.stanford.edu
>>Instructions for unsubscribing:
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> Instructions for unsubscribing:
View this message in context: http://www.nabble.com/How-to-determine-the-execution-sequence-of-swrl-rules--tf4199055.html#a11957008
Sent from the Protege - OWL mailing list archive at Nabble.com.
More information about the protege-owl