SWRLTab: OWL 2 RL control panel

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SWRLTab: OWL 2 RL control panel

Zohreh Shams
Hello,

Is there any way to generate a trace of the OWL 2 RL inference rules that are triggered (inJess or Drools-based OWL 2 RL reasoners ) to answer a query?
Essentially what I’m after is a trace of inference rules applied.

Your help would be much appreciated.  

Best,
Zohreh


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SWRLTab: OWL 2 RL control panel

Michael DeBellis-2
Zohreh, I'm not sure if this is exactly what you are looking for but there are two things I can think of that might do what you need. First, if you have rules that are already working you should have some info in your ontology that is a result of the rules. Any information that is added to the ontology as a result of inferences from the Reasoner (which includes firing SWRL rules) is highlighted and has a "?" next to it. If you pick some assertion that you know is the result of the rules you want to trace and click on the "?" Protege will show you a trace of the inferencing that the reasoner went through to deduce that assertion which will include the rules that fired.

Another option is to use SQWRL. SQWRL is just like SWRL except SQWRL doesn't assert info into the ontology, it only  displays info. So a common trick is to write SQWRL rules where the left hand side is a SWRL rule you want to trace and the right hand side is replaced with a SQWRL select statement. 

So for example if you have a rule like:

Person(?p) ^ hasAge(?p, ?a) ^ swrlb:greaterThanOrEqual(?a, 18) -> LegalDrivingAge(?p)

and you want to see all the times that this rule fires you can write the SQWRL rule:

Person(?p) ^ hasAge(?p, ?a) ^ swrlb:greaterThanOrEqual(?a, 18) -> sqwrl:select(?p,?a)

And in the SQWRL pane you will see a trace for every time this rule fires and what the values of p and a are when it does. You can put as many variables as you want in the select statement,  as long as those variables are used in the left hand side of the rule. 

Michael

On Tue, Sep 4, 2018 at 3:31 AM Zohreh Shams <[hidden email]> wrote:
Hello,

Is there any way to generate a trace of the OWL 2 RL inference rules that are triggered (inJess or Drools-based OWL 2 RL reasoners ) to answer a query?
Essentially what I’m after is a trace of inference rules applied.

Your help would be much appreciated.  

Best,
Zohreh

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SWRLTab: OWL 2 RL control panel

Martin O'Connor-2
In reply to this post by Zohreh Shams

You would have to modify the Drools-based implementation of the OWL 2 RL reasoner to do this. (A Jess-based implementation is available only in the earlier 3.5 version of Protege.)

Here, for example, are the Drools rules representing the rules in the OWL 2 RL specification:


You would need to modify these rules to have some sort of hook in their consequents that would invoke a tracking mechanism. It could be a fairly involved task. 

This paper describes the overall operation of the SWRLAPI's OWL 2 RL engine:


Martin

On Sep 4, 2018, at 3:35 AM, Zohreh Shams <[hidden email]> wrote:

Hello,

Is there any way to generate a trace of the OWL 2 RL inference rules that are triggered (inJess or Drools-based OWL 2 RL reasoners ) to answer a query?
Essentially what I’m after is a trace of inference rules applied.

Your help would be much appreciated.  

Best,
Zohreh

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user