Re: SQWRL expressions not supported in SWRLDroolsTab

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

Re: SQWRL expressions not supported in SWRLDroolsTab

Martin O'Connor-3

As Samson mentioned, SQWRL operators are not designed to be used in rules to assert new knowledge. The Jess implementation may have inadvertently allowed SQWRL operators in rules (though its behaviour is likely to have been unpredictable).

While a programatic or JessTab-based approach may be preferable, you might also be able to make use of the SWRLX built-in library [1].

Martin 


On Feb 10, 2014, at 9:54 AM, Samson Tu <[hidden email]> wrote:

Hi,

My understanding of SQWRL is that you cannot make changes to to the ontology based on results of making SQWRL queries. From [1]:


SQWRL queries operate on known individuals in the currently loaded OWL ontology. It is very important to note that SQWRL provides no way of accessing the information it accumulates from within a rule so query results cannot be written back to the ontology. There is no way, for example, to insert the result of a computed aggregate count back into the ontology.

I think this is true of the Jess-based implementation of SWRL/SQWRL too, not just the Drools-based implementation. Jess (the Java-based rule system) is not SWRL, and what is true of JessTab has no relevance to SWRLTab.

As you said, the rule with sqwrl:select(?x) on the RHS is supported.  That’s because it makes no change to the ontology based on the results of closed-world computation. 

Others may have better idea. For making changes to the ontology based SQWRL query results I think you have get query results and make new assertions programmatically.

Or you can write rules in JessTab. That’s what I did in one of my projects. Choose tools appropriate for the problem. OWL/SWRL is not necessarily the right solution for every problem.

With best regards,
Samson


[1] http://protege.cim3.net/cgi-bin/wiki.pl?SQWRL
On Feb 10, 2014, at 4:11 AM, Edmond Jajaga <[hidden email]> wrote:

Please answer this question.

Sent from my Xperia™ smartphone 

Edmond Jajaga <[hidden email]> wrote:

Dear all,

I was trying to implement a rule that combines SWRL with SQWRL expressions for inferring new individuals for classes in Protege latest release (3.5), but when I press the OWL+SWRL->Drools button the number of SWRL rules exported to rule engine is 0 and running Drools and then pressing Drools->OWL does not asserts new individuals to appropriate classes. Note that this feature was available with Jess.

Example rule which is not supported in SWRLDroolsTab: 
SampleClass1(?x)∧ hasValue(?x, ?val)∧ sqwrl:makeSet(?vs, ?val) ∧ sqwrl:avg(?avg, ?vs)swrlb:greaterThan(?avg, 10) → SampleClass2(?x)  

The same rule modified on the THEN part of the rule to select the resulting individuals gives the expected results:
SampleClass1(?x)∧ hasValue(?x, ?val)∧ sqwrl:makeSet(?vs, ?val) ∧ sqwrl:avg(?avg, ?vs)swrlb:greaterThan(?avg, 10) → sqwrl:select(?x)  

My question is: why SWRLDroolsTab does not support expressing rules which include SQWRL expressions, which was previously supported by JessTab? If it is not supported in SWRLDroolsTab how can we express these kind of rules (requiring Closed World Assumption) in Protege?

Best regards,
Edmond
_______________________________________________
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


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

Re: SQWRL expressions not supported in SWRLDroolsTab

edi
Dear Martin and Samson,

Thank you for your answer. 

Using SQWRL clauses in SWRL rules was allowed (as you said inadvertently) in Protege previous version's JessTab. You may refer to my paper [1] in which is showed an implementation of fact assertion with rules containing SQWRL calculations. In current Protege version it is not possible and that's because JessTab is now using OWL 2 RL-based reasoner to perform reasoning. In Protege, can I switch back to its native reasoning engine for the JessTab? And as you both said, there is alternative programatic approach - can you please refer me how can I interact programatically with Protege?

Thank you in advance.

Best regards,
Edmond

[1] L. Ahmedi, and E. Jajaga, Normalization of relations and ontologies, 2011.


From: [hidden email]
Date: Mon, 10 Feb 2014 21:00:58 -0800
To: [hidden email]
Subject: Re: [protege-user] SQWRL expressions not supported in SWRLDroolsTab


As Samson mentioned, SQWRL operators are not designed to be used in rules to assert new knowledge. The Jess implementation may have inadvertently allowed SQWRL operators in rules (though its behaviour is likely to have been unpredictable).

While a programatic or JessTab-based approach may be preferable, you might also be able to make use of the SWRLX built-in library [1].

Martin 


On Feb 10, 2014, at 9:54 AM, Samson Tu <[hidden email]> wrote:

Hi,

My understanding of SQWRL is that you cannot make changes to to the ontology based on results of making SQWRL queries. From [1]:


SQWRL queries operate on known individuals in the currently loaded OWL ontology. It is very important to note that SQWRL provides no way of accessing the information it accumulates from within a rule so query results cannot be written back to the ontology. There is no way, for example, to insert the result of a computed aggregate count back into the ontology.

I think this is true of the Jess-based implementation of SWRL/SQWRL too, not just the Drools-based implementation. Jess (the Java-based rule system) is not SWRL, and what is true of JessTab has no relevance to SWRLTab.

As you said, the rule with sqwrl:select(?x) on the RHS is supported.  That’s because it makes no change to the ontology based on the results of closed-world computation. 

Others may have better idea. For making changes to the ontology based SQWRL query results I think you have get query results and make new assertions programmatically.

Or you can write rules in JessTab. That’s what I did in one of my projects. Choose tools appropriate for the problem. OWL/SWRL is not necessarily the right solution for every problem.

With best regards,
Samson


[1] http://protege.cim3.net/cgi-bin/wiki.pl?SQWRL
On Feb 10, 2014, at 4:11 AM, Edmond Jajaga <[hidden email]> wrote:

Please answer this question.

Sent from my Xperia™ smartphone 

Edmond Jajaga <[hidden email]> wrote:

Dear all,

I was trying to implement a rule that combines SWRL with SQWRL expressions for inferring new individuals for classes in Protege latest release (3.5), but when I press the OWL+SWRL->Drools button the number of SWRL rules exported to rule engine is 0 and running Drools and then pressing Drools->OWL does not asserts new individuals to appropriate classes. Note that this feature was available with Jess.

Example rule which is not supported in SWRLDroolsTab: 
SampleClass1(?x)∧ hasValue(?x, ?val)∧ sqwrl:makeSet(?vs, ?val) ∧ sqwrl:avg(?avg, ?vs)swrlb:greaterThan(?avg, 10) → SampleClass2(?x)  

The same rule modified on the THEN part of the rule to select the resulting individuals gives the expected results:
SampleClass1(?x)∧ hasValue(?x, ?val)∧ sqwrl:makeSet(?vs, ?val) ∧ sqwrl:avg(?avg, ?vs)swrlb:greaterThan(?avg, 10) → sqwrl:select(?x)  

My question is: why SWRLDroolsTab does not support expressing rules which include SQWRL expressions, which was previously supported by JessTab? If it is not supported in SWRLDroolsTab how can we express these kind of rules (requiring Closed World Assumption) in Protege?

Best regards,
Edmond
_______________________________________________
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


_______________________________________________ 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: SQWRL expressions not supported in SWRLDroolsTab

samsontu
Hi,

The Jess-based implementation of SWRL is still available in Protege 3.5 You need to install jess.jar in the ProtegeOWL plugin folder. 

The API for programmatically running SQWRL queries is described in [1]. Documentation for interacting with Protege 3 OWL API is described in [2].

With best regards,
Samson

p.s. Please stop referring to the Jess-based implementation of SWRLTab as “JessTab." JessTab is a separate Protege 3.x plugin that support the use of Jess with any Protege 3 ontology, including frame-based ontologies.


[1] http://protege.cim3.net/cgi-bin/wiki.pl?SQWRLQueryAPI

On Feb 11, 2014, at 1:51 PM, Edmond Jajaga <[hidden email]> wrote:

Dear Martin and Samson,

Thank you for your answer. 

Using SQWRL clauses in SWRL rules was allowed (as you said inadvertently) in Protege previous version's JessTab. You may refer to my paper [1] in which is showed an implementation of fact assertion with rules containing SQWRL calculations. In current Protege version it is not possible and that's because JessTab is now using OWL 2 RL-based reasoner to perform reasoning. In Protege, can I switch back to its native reasoning engine for the JessTab? And as you both said, there is alternative programatic approach - can you please refer me how can I interact programatically with Protege?

Thank you in advance.

Best regards,
Edmond

[1] L. Ahmedi, and E. Jajaga, Normalization of relations and ontologies, 2011.


From: [hidden email]
Date: Mon, 10 Feb 2014 21:00:58 -0800
To: [hidden email]
Subject: Re: [protege-user] SQWRL expressions not supported in SWRLDroolsTab


As Samson mentioned, SQWRL operators are not designed to be used in rules to assert new knowledge. The Jess implementation may have inadvertently allowed SQWRL operators in rules (though its behaviour is likely to have been unpredictable).

While a programatic or JessTab-based approach may be preferable, you might also be able to make use of the SWRLX built-in library [1].

Martin 


On Feb 10, 2014, at 9:54 AM, Samson Tu <[hidden email]> wrote:

Hi,

My understanding of SQWRL is that you cannot make changes to to the ontology based on results of making SQWRL queries. From [1]:


SQWRL queries operate on known individuals in the currently loaded OWL ontology. It is very important to note that SQWRL provides no way of accessing the information it accumulates from within a rule so query results cannot be written back to the ontology. There is no way, for example, to insert the result of a computed aggregate count back into the ontology.

I think this is true of the Jess-based implementation of SWRL/SQWRL too, not just the Drools-based implementation. Jess (the Java-based rule system) is not SWRL, and what is true of JessTab has no relevance to SWRLTab.

As you said, the rule with sqwrl:select(?x) on the RHS is supported.  That’s because it makes no change to the ontology based on the results of closed-world computation. 

Others may have better idea. For making changes to the ontology based SQWRL query results I think you have get query results and make new assertions programmatically.

Or you can write rules in JessTab. That’s what I did in one of my projects. Choose tools appropriate for the problem. OWL/SWRL is not necessarily the right solution for every problem.

With best regards,
Samson


[1] http://protege.cim3.net/cgi-bin/wiki.pl?SQWRL
On Feb 10, 2014, at 4:11 AM, Edmond Jajaga <[hidden email]> wrote:

Please answer this question.

Sent from my Xperia™ smartphone 

Edmond Jajaga <[hidden email]> wrote:

Dear all,

I was trying to implement a rule that combines SWRL with SQWRL expressions for inferring new individuals for classes in Protege latest release (3.5), but when I press the OWL+SWRL->Drools button the number of SWRL rules exported to rule engine is 0 and running Drools and then pressing Drools->OWL does not asserts new individuals to appropriate classes. Note that this feature was available with Jess.

Example rule which is not supported in SWRLDroolsTab: 
SampleClass1(?x)∧ hasValue(?x, ?val)∧ sqwrl:makeSet(?vs, ?val) ∧ sqwrl:avg(?avg, ?vs)swrlb:greaterThan(?avg, 10) → SampleClass2(?x)  

The same rule modified on the THEN part of the rule to select the resulting individuals gives the expected results:
SampleClass1(?x)∧ hasValue(?x, ?val)∧ sqwrl:makeSet(?vs, ?val) ∧ sqwrl:avg(?avg, ?vs)swrlb:greaterThan(?avg, 10) → sqwrl:select(?x)  

My question is: why SWRLDroolsTab does not support expressing rules which include SQWRL expressions, which was previously supported by JessTab? If it is not supported in SWRLDroolsTab how can we express these kind of rules (requiring Closed World Assumption) in Protege?

Best regards,
Edmond
_______________________________________________
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


_______________________________________________ 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


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