SWRLTab non-functional

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

SWRLTab non-functional

rujie
Dear all, I am new to protege, and have some questions when I’m using it.
(1)I've built the classes, individuals, properties , and SWRL, but when I
reopen the owl file, the SWRLTab was non-functional with blank gui, and the
log is partly shown blew. What should I do to solve this problem? I am
running Protege5.5.0 on MacOS 10.14.6 by the way.
  "ERROR  14:45:54  Error updating SWRLTab
org.swrlapi.exceptions.SWRLRuleEngineException: Error creating rule engine
Drools. "
(2)how to calculate "sum" in SWRL?

Your help will be greatly appreciated.

Thanks and Regards,
Rujie.




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SWRLTab non-functional

Martin O'Connor-2
Send me the OWL file (off list) and I will take a look.

Martin

> On Feb 25, 2020, at 08:00, rujie <[hidden email]> wrote:
>
> Dear all, I am new to protege, and have some questions when I’m using it.
> (1)I've built the classes, individuals, properties , and SWRL, but when I
> reopen the owl file, the SWRLTab was non-functional with blank gui, and the
> log is partly shown blew. What should I do to solve this problem? I am
> running Protege5.5.0 on MacOS 10.14.6 by the way.
>  "ERROR  14:45:54  Error updating SWRLTab
> org.swrlapi.exceptions.SWRLRuleEngineException: Error creating rule engine
> Drools. "
> (2)how to calculate "sum" in SWRL?
>
> Your help will be greatly appreciated.
>
> Thanks and Regards,
> Rujie.
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> 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 non-functional

Michael DeBellis-2
In reply to this post by rujie
One thing to keep in mind is that you can actually ignore those buttons on the bottom of the SWRLTab unless you want to run Drools. If you don't know what Drools is then I would just completely ignore those buttons. All you need to do to get your rules to run is to run the reasoner (and make sure to use the Pellet reasoner) and any SWRL rules you have written will run just the same as any DL statements on classes, inverses on properties, etc. 

Also, you might want to check the Reasoner>Configure option. The default is that some of those boxes aren't checked. For small ontologies where you are just learning the tool I think it is best to check them all so you get the full power of the reasoner and then as you get to bigger ontologies you can scale back if the reasoner is taking too long to run. Although, I've run it with all the boxes checked and ontologies with thousands of objects and it works fine.

Finally, you might want to check out my SWRL tutorial. This is specifically for using the SWRLTab in Protege and it gives some examples of how to do things like sum two numbers in a rule. Although I would recommend you do the Pizza tutorial first if you haven't already done so to make sure you are well grounded in the basics of OWL before you start using SWRL. My SWRL tutorial can be found here:  https://www.michaeldebellis.com/post/swrl_tutorial

On Tue, Feb 25, 2020 at 8:00 AM rujie <[hidden email]> wrote:
Dear all, I am new to protege, and have some questions when I’m using it.
(1)I've built the classes, individuals, properties , and SWRL, but when I
reopen the owl file, the SWRLTab was non-functional with blank gui, and the
log is partly shown blew. What should I do to solve this problem? I am
running Protege5.5.0 on MacOS 10.14.6 by the way.
  "ERROR  14:45:54  Error updating SWRLTab
org.swrlapi.exceptions.SWRLRuleEngineException: Error creating rule engine
Drools. "
(2)how to calculate "sum" in SWRL?

Your help will be greatly appreciated.

Thanks and Regards,
Rujie.




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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 non-functional

rujie
Thank you so much for helping me.
But still one more question, what if I need to create some new rules? 




On 02/25/2020 17:02[hidden email] wrote:
One thing to keep in mind is that you can actually ignore those buttons on the bottom of the SWRLTab unless you want to run Drools. If you don't know what Drools is then I would just completely ignore those buttons. All you need to do to get your rules to run is to run the reasoner (and make sure to use the Pellet reasoner) and any SWRL rules you have written will run just the same as any DL statements on classes, inverses on properties, etc. 

Also, you might want to check the Reasoner>Configure option. The default is that some of those boxes aren't checked. For small ontologies where you are just learning the tool I think it is best to check them all so you get the full power of the reasoner and then as you get to bigger ontologies you can scale back if the reasoner is taking too long to run. Although, I've run it with all the boxes checked and ontologies with thousands of objects and it works fine.

Finally, you might want to check out my SWRL tutorial. This is specifically for using the SWRLTab in Protege and it gives some examples of how to do things like sum two numbers in a rule. Although I would recommend you do the Pizza tutorial first if you haven't already done so to make sure you are well grounded in the basics of OWL before you start using SWRL. My SWRL tutorial can be found here:  https://www.michaeldebellis.com/post/swrl_tutorial

On Tue, Feb 25, 2020 at 8:00 AM rujie <[hidden email]> wrote:
Dear all, I am new to protege, and have some questions when I’m using it.
(1)I've built the classes, individuals, properties , and SWRL, but when I
reopen the owl file, the SWRLTab was non-functional with blank gui, and the
log is partly shown blew. What should I do to solve this problem? I am
running Protege5.5.0 on MacOS 10.14.6 by the way.
  "ERROR  14:45:54  Error updating SWRLTab
org.swrlapi.exceptions.SWRLRuleEngineException: Error creating rule engine
Drools. "
(2)how to calculate "sum" in SWRL?

Your help will be greatly appreciated.

Thanks and Regards,
Rujie.




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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 non-functional

Michael DeBellis-2
Sorry, I guess I wasn't clear: my tutorial walks you through how to create new rules and gives you an example which if you follow should work fine and you will create several rules, including rules that do mathematical operations which you can use as a template for your own domain specific rules. If you get stuck on the tutorial feel free to email me directly but I think many people have done it now and it seems to work. The reason I mentioned configuring the reasoner is that one of the people who did the tutorial recently wasn't seeing the expected results and it was because his reasoner wasn't configured to do all the needed inferencing. 

If you are saying that you think there is some bug in your version of Protege such that the SWRLTab isn't working I think that is unlikely. What is more probable is that you've written a rule that causes an inconsistency or some other problem. Since you sent your ontology to Martin he will probably spot the error pretty quickly. In the future, as long as your ontology is not large, it's a good idea to include your ontology with your message to the list because it is much easier for us to help you debug your problems if we can see the actual ontology. 

On Tue, Feb 25, 2020 at 9:14 AM 2641587532 <[hidden email]> wrote:
Thank you so much for helping me.
But still one more question, what if I need to create some new rules? 




On 02/25/2020 17:02[hidden email] wrote:
One thing to keep in mind is that you can actually ignore those buttons on the bottom of the SWRLTab unless you want to run Drools. If you don't know what Drools is then I would just completely ignore those buttons. All you need to do to get your rules to run is to run the reasoner (and make sure to use the Pellet reasoner) and any SWRL rules you have written will run just the same as any DL statements on classes, inverses on properties, etc. 

Also, you might want to check the Reasoner>Configure option. The default is that some of those boxes aren't checked. For small ontologies where you are just learning the tool I think it is best to check them all so you get the full power of the reasoner and then as you get to bigger ontologies you can scale back if the reasoner is taking too long to run. Although, I've run it with all the boxes checked and ontologies with thousands of objects and it works fine.

Finally, you might want to check out my SWRL tutorial. This is specifically for using the SWRLTab in Protege and it gives some examples of how to do things like sum two numbers in a rule. Although I would recommend you do the Pizza tutorial first if you haven't already done so to make sure you are well grounded in the basics of OWL before you start using SWRL. My SWRL tutorial can be found here:  https://www.michaeldebellis.com/post/swrl_tutorial

On Tue, Feb 25, 2020 at 8:00 AM rujie <[hidden email]> wrote:
Dear all, I am new to protege, and have some questions when I’m using it.
(1)I've built the classes, individuals, properties , and SWRL, but when I
reopen the owl file, the SWRLTab was non-functional with blank gui, and the
log is partly shown blew. What should I do to solve this problem? I am
running Protege5.5.0 on MacOS 10.14.6 by the way.
  "ERROR  14:45:54  Error updating SWRLTab
org.swrlapi.exceptions.SWRLRuleEngineException: Error creating rule engine
Drools. "
(2)how to calculate "sum" in SWRL?

Your help will be greatly appreciated.

Thanks and Regards,
Rujie.




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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: SWRLTab non-functional

Lorenz Buehmann

The initial question 2) w.r.t. sum is ambiguous so my two cents:

Not sure if it was already mentioned, but at least an aggregate sum is not part of SWRL. Just keep this in mind. It's what you can use in SQWRL but SWRL itself is monotonic, so there is no way for aggregate functions. You can go with the SQWRL and the collections functions Martin added to SWRL API.

So my comment is just regarding sum aggregate operator, not swrlb:add which indeed exists

On 25.02.20 18:56, Michael DeBellis wrote:
Sorry, I guess I wasn't clear: my tutorial walks you through how to create new rules and gives you an example which if you follow should work fine and you will create several rules, including rules that do mathematical operations which you can use as a template for your own domain specific rules. If you get stuck on the tutorial feel free to email me directly but I think many people have done it now and it seems to work. The reason I mentioned configuring the reasoner is that one of the people who did the tutorial recently wasn't seeing the expected results and it was because his reasoner wasn't configured to do all the needed inferencing. 

If you are saying that you think there is some bug in your version of Protege such that the SWRLTab isn't working I think that is unlikely. What is more probable is that you've written a rule that causes an inconsistency or some other problem. Since you sent your ontology to Martin he will probably spot the error pretty quickly. In the future, as long as your ontology is not large, it's a good idea to include your ontology with your message to the list because it is much easier for us to help you debug your problems if we can see the actual ontology. 

On Tue, Feb 25, 2020 at 9:14 AM 2641587532 <[hidden email]> wrote:
Thank you so much for helping me.
But still one more question, what if I need to create some new rules? 




On 02/25/2020 17:02[hidden email] wrote:
One thing to keep in mind is that you can actually ignore those buttons on the bottom of the SWRLTab unless you want to run Drools. If you don't know what Drools is then I would just completely ignore those buttons. All you need to do to get your rules to run is to run the reasoner (and make sure to use the Pellet reasoner) and any SWRL rules you have written will run just the same as any DL statements on classes, inverses on properties, etc. 

Also, you might want to check the Reasoner>Configure option. The default is that some of those boxes aren't checked. For small ontologies where you are just learning the tool I think it is best to check them all so you get the full power of the reasoner and then as you get to bigger ontologies you can scale back if the reasoner is taking too long to run. Although, I've run it with all the boxes checked and ontologies with thousands of objects and it works fine.

Finally, you might want to check out my SWRL tutorial. This is specifically for using the SWRLTab in Protege and it gives some examples of how to do things like sum two numbers in a rule. Although I would recommend you do the Pizza tutorial first if you haven't already done so to make sure you are well grounded in the basics of OWL before you start using SWRL. My SWRL tutorial can be found here:  https://www.michaeldebellis.com/post/swrl_tutorial

On Tue, Feb 25, 2020 at 8:00 AM rujie <[hidden email]> wrote:
Dear all, I am new to protege, and have some questions when I’m using it.
(1)I've built the classes, individuals, properties , and SWRL, but when I
reopen the owl file, the SWRLTab was non-functional with blank gui, and the
log is partly shown blew. What should I do to solve this problem? I am
running Protege5.5.0 on MacOS 10.14.6 by the way.
  "ERROR  14:45:54  Error updating SWRLTab
org.swrlapi.exceptions.SWRLRuleEngineException: Error creating rule engine
Drools. "
(2)how to calculate "sum" in SWRL?

Your help will be greatly appreciated.

Thanks and Regards,
Rujie.




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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: SWRLTab non-functional

Joel Valim
In reply to this post by Michael DeBellis-2
Michael,

I am going through a similar issue in swrl tab while using protege 5.5.0
with swrl tab 2.0.8.

I have more specific issue regarding to class expression rules.

Im trying to make up a rule kind of... *Person(?x), /hasChildren some
Person(?c) /-> isParent(?x, ?c)*

but specifically that italic part it will not allow me to do ... it seems it
does not recognize it as a valid swrl...

If could you give some enlightening in this matter I would thank you very
much.

And last but not least I would like very much to take a look at your
tutorial wich you mentioned but it seems links are broken to google drive.

thanks



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SWRLTab non-functional

Lorenz Buehmann

On 31.03.20 22:01, Joel Valim wrote:
> Michael,
>
> I am going through a similar issue in swrl tab while using protege 5.5.0
> with swrl tab 2.0.8.
>
> I have more specific issue regarding to class expression rules.
>
> Im trying to make up a rule kind of... *Person(?x), /hasChildren some
> Person(?c) /-> isParent(?x, ?c)*

1. the syntax would be (hasChildren some Person)(?c)

2. the ?c does **not** represent the object of the haschildren
relationship, it's always about the individuals that belong to this
class expression, i.e. have some child which is a person

3. what is the idea behind this rule? I mean, a class expression denotes
a set of individuals, nothing more nothing less. In your case, the rule
body would have two unconnected variables ?x and ?c . Why aren't you
writing the rule as intended? You have binary predicates in SWRL:

Person(?x), hasChildren(?x, ?c), Person(?c) -> isParent(?x, ?c)

>
> but specifically that italic part it will not allow me to do ... it seems it
> does not recognize it as a valid swrl...
>
> If could you give some enlightening in this matter I would thank you very
> much.
>
> And last but not least I would like very much to take a look at your
> tutorial wich you mentioned but it seems links are broken to google drive.
>
> thanks
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> 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 non-functional

Michael DeBellis-2
I agree with Lorenz about the obvious way to write the rule. I would just add a couple of points:

1) Class expressions are part of the SWRL standard but the SWRLTab in Protege doesn't support them yet. There is also a Rules pane in Protege that you can use to write SWRL rules with class expressions however, in practice I never use it. I like the SWRLTab and my impression is that it is more robust. Also, I've never encountered a situation where I really needed  to have a class expression in a rule. In any such cases I could always do what I want either with the standard binary predicates in SWRL or by creating a defined class. I discuss these issues in more detail with a simple example in my SWRL tutorial: https://www.michaeldebellis.com/post/swrl_tutorial  

2) Unless I'm misunderstanding your use case it seems to me you don't need SWRL or a class expression. This is simply a case of inverse properties. the hasChild property with domain Person and range Person and the inverse of hasChild: isChildOf   Just making these two properties inverses will I think do what you want to do and is much simpler. Another benefit: some of the commercial triple store products only support a subset of OWL. All of the ones that support any OWL that I know of support inverses on properties but some of them don't support SWRL or class expressions. So other things being equal the more you can stick to the simpler constructs like inverses the better. I think that's actually a good guideline anyway.

Actually, as I looked at your example again, I see I did misunderstand, it's not really an inverse. You seem to have two properties that are essentially identical: hasChildren and isParent.  I don't see why you would model things this way but if you need to I think a better way would be to just use the "Equivalent To" meta-property. On any property such as hasChild there is a meta-property called Equivalent To in the Property Description. You can click on the "+" sign for that property and add "isParent" as an equivalent property to hasChild which will do the same thing as I think you were trying to do with that rule. 

Cheers,
Michael

On Tue, Mar 31, 2020 at 11:50 PM Lorenz Buehmann <[hidden email]> wrote:

On 31.03.20 22:01, Joel Valim wrote:
> Michael,
>
> I am going through a similar issue in swrl tab while using protege 5.5.0
> with swrl tab 2.0.8.
>
> I have more specific issue regarding to class expression rules.
>
> Im trying to make up a rule kind of... *Person(?x), /hasChildren some
> Person(?c) /-> isParent(?x, ?c)*

1. the syntax would be (hasChildren some Person)(?c)

2. the ?c does **not** represent the object of the haschildren
relationship, it's always about the individuals that belong to this
class expression, i.e. have some child which is a person

3. what is the idea behind this rule? I mean, a class expression denotes
a set of individuals, nothing more nothing less. In your case, the rule
body would have two unconnected variables ?x and ?c . Why aren't you
writing the rule as intended? You have binary predicates in SWRL:

Person(?x), hasChildren(?x, ?c), Person(?c) -> isParent(?x, ?c)

>
> but specifically that italic part it will not allow me to do ... it seems it
> does not recognize it as a valid swrl...
>
> If could you give some enlightening in this matter I would thank you very
> much.
>
> And last but not least I would like very much to take a look at your
> tutorial wich you mentioned but it seems links are broken to google drive.
>
> thanks
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> 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