Regarding SWRL rules generation with SWRLAPI

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

Regarding SWRL rules generation with SWRLAPI

zalan mahmood

Hello,

I am a student at the University of Birmingham and working on my final year project. I working on ontology, which I have to make swrl rules for my ontology. I have the swrl rules in a text file, which are around 1500 in numbers. And now I am looking for an automated way to enter these rules in my ontology. I am using protege to make ontology but in protege in swrl Tab there is no option to import rules from a file, therefore, I thought to use the SWRLAPI to generate the swrl rules. I would like to know, how can I use the SWRLAPI to create the swrl rules? or if there is any other way in which I do not have to use the swrlAPI so please mention it as well. As I am actually a mechanical engineer and I am do not have much knowledge about Java programming.


Thank you in advance,

Zalan Mahmood



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

Re: Regarding SWRL rules generation with SWRLAPI

Michael DeBellis-2
Zalan, 1500 is one heck of a lot of SWRL rules. I don't know how to add them via the API since I always use the SWRLTab. Although if you aren't an experienced Java programmer (e.g., have you regularly used Eclipse or some other equivalent Java IDE?  Have you used Jena so that you know how to create Java objects from an OWL ontology?) I think it sounds like a very challenging learning curve.

I would recommend that before you try doing that you first find some subset of your rules and ontology that you can enter via the SWRLTab and make sure the rules are working as you expect them to. Even for people experienced with other rule-based systems SWRL can take some getting used to due to OWL features such as the Open World Assumption and not supporting Negation as Failure. 

Also, if at all possible try to find someone who has used OWL and SWRL before to take a look at your rules.  As I said 1500 is IMO a huge amount of rules. Perhaps there is a way to write the rules differently so you can get by with fewer rules or to divide your problem into sub-problems that are easier to test than 1500 rules all in one ontology. 

Michael

On Mon, Aug 13, 2018 at 4:38 AM, zalan mahmood <[hidden email]> wrote:

Hello,

I am a student at the University of Birmingham and working on my final year project. I working on ontology, which I have to make swrl rules for my ontology. I have the swrl rules in a text file, which are around 1500 in numbers. And now I am looking for an automated way to enter these rules in my ontology. I am using protege to make ontology but in protege in swrl Tab there is no option to import rules from a file, therefore, I thought to use the SWRLAPI to generate the swrl rules. I would like to know, how can I use the SWRLAPI to create the swrl rules? or if there is any other way in which I do not have to use the swrlAPI so please mention it as well. As I am actually a mechanical engineer and I am do not have much knowledge about Java programming.


Thank you in advance,

Zalan Mahmood



_______________________________________________
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: Regarding SWRL rules generation with SWRLAPI

Martin O'Connor-2

I’m also intrigued. That may be the biggest SWRL rules base that I have heard of. How was it created?

SWRL rules are not ‘standalone’ and generally only make sense in the context of an OWL ontology.

For example, the SWRL rule:

Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> Adult(?p)

requires that there is an associated OWL ontology that defines the Person and Adult classes and the hasAge data property.

Can you post a sample of the rules so that we can what they look like.

Martin


On Aug 13, 2018, at 10:16 AM, Michael DeBellis <[hidden email]> wrote:

Zalan, 1500 is one heck of a lot of SWRL rules. I don't know how to add them via the API since I always use the SWRLTab. Although if you aren't an experienced Java programmer (e.g., have you regularly used Eclipse or some other equivalent Java IDE?  Have you used Jena so that you know how to create Java objects from an OWL ontology?) I think it sounds like a very challenging learning curve.

I would recommend that before you try doing that you first find some subset of your rules and ontology that you can enter via the SWRLTab and make sure the rules are working as you expect them to. Even for people experienced with other rule-based systems SWRL can take some getting used to due to OWL features such as the Open World Assumption and not supporting Negation as Failure. 

Also, if at all possible try to find someone who has used OWL and SWRL before to take a look at your rules.  As I said 1500 is IMO a huge amount of rules. Perhaps there is a way to write the rules differently so you can get by with fewer rules or to divide your problem into sub-problems that are easier to test than 1500 rules all in one ontology. 

Michael

On Mon, Aug 13, 2018 at 4:38 AM, zalan mahmood <[hidden email]> wrote:

Hello,

I am a student at the University of Birmingham and working on my final year project. I working on ontology, which I have to make swrl rules for my ontology. I have the swrl rules in a text file, which are around 1500 in numbers. And now I am looking for an automated way to enter these rules in my ontology. I am using protege to make ontology but in protege in swrl Tab there is no option to import rules from a file, therefore, I thought to use the SWRLAPI to generate the swrl rules. I would like to know, how can I use the SWRLAPI to create the swrl rules? or if there is any other way in which I do not have to use the swrlAPI so please mention it as well. As I am actually a mechanical engineer and I am do not have much knowledge about Java programming.


Thank you in advance,

Zalan Mahmood




_______________________________________________
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: Regarding SWRL rules generation with SWRLAPI

zalan mahmood

Dear Guys,

Thank you for your replies.

The rules are extracted from a decision tree model, which was made on WEKA software. The decision tree was imported to MATLAB where the SWRL rules were extracted from them. I know it's a lot of rules. But I am just looking for an automated way to enter the rules in Protege SWRL Tab Plugin. So in future, if I keep continued my research, I do not have to enter them manually.


Two examples of the rules are given in the attached text file.


Thank you

Zalan


From: protege-user <[hidden email]> on behalf of Martin O'Connor <[hidden email]>
Sent: 14 August 2018 04:33:15
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 

I’m also intrigued. That may be the biggest SWRL rules base that I have heard of. How was it created?

SWRL rules are not ‘standalone’ and generally only make sense in the context of an OWL ontology.

For example, the SWRL rule:

Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> Adult(?p)

requires that there is an associated OWL ontology that defines the Person and Adult classes and the hasAge data property.

Can you post a sample of the rules so that we can what they look like.

Martin


On Aug 13, 2018, at 10:16 AM, Michael DeBellis <[hidden email]> wrote:

Zalan, 1500 is one heck of a lot of SWRL rules. I don't know how to add them via the API since I always use the SWRLTab. Although if you aren't an experienced Java programmer (e.g., have you regularly used Eclipse or some other equivalent Java IDE?  Have you used Jena so that you know how to create Java objects from an OWL ontology?) I think it sounds like a very challenging learning curve.

I would recommend that before you try doing that you first find some subset of your rules and ontology that you can enter via the SWRLTab and make sure the rules are working as you expect them to. Even for people experienced with other rule-based systems SWRL can take some getting used to due to OWL features such as the Open World Assumption and not supporting Negation as Failure. 

Also, if at all possible try to find someone who has used OWL and SWRL before to take a look at your rules.  As I said 1500 is IMO a huge amount of rules. Perhaps there is a way to write the rules differently so you can get by with fewer rules or to divide your problem into sub-problems that are easier to test than 1500 rules all in one ontology. 

Michael

On Mon, Aug 13, 2018 at 4:38 AM, zalan mahmood <[hidden email]> wrote:

Hello,

I am a student at the University of Birmingham and working on my final year project. I working on ontology, which I have to make swrl rules for my ontology. I have the swrl rules in a text file, which are around 1500 in numbers. And now I am looking for an automated way to enter these rules in my ontology. I am using protege to make ontology but in protege in swrl Tab there is no option to import rules from a file, therefore, I thought to use the SWRLAPI to generate the swrl rules. I would like to know, how can I use the SWRLAPI to create the swrl rules? or if there is any other way in which I do not have to use the swrlAPI so please mention it as well. As I am actually a mechanical engineer and I am do not have much knowledge about Java programming.


Thank you in advance,

Zalan Mahmood




_______________________________________________
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

example rules.txt (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Regarding SWRL rules generation with SWRLAPI

Martin O'Connor-2

There is really no way to load these rules without writing some code.

There is a GitHub repo containing a skeleton SWRLAPI-based project here:


The code here:


could be adopted to create SWRL rules following the example here:


As mentioned, you will need an OWL ontology that defines all the OWL concepts that you reference in your SWRL rules. The rules cannot be processed without this ontology.

I would first load this ontology into Protege and then use the SWRLTab editor and paste a few rules in manually so see if they can be correctly processed.

Martin

On Aug 14, 2018, at 12:46 AM, zalan mahmood <[hidden email]> wrote:

Dear Guys,
Thank you for your replies.
The rules are extracted from a decision tree model, which was made on WEKA software. The decision tree was imported to MATLAB where the SWRL rules were extracted from them. I know it's a lot of rules. But I am just looking for an automated way to enter the rules in Protege SWRL Tab Plugin. So in future, if I keep continued my research, I do not have to enter them manually.

Two examples of the rules are given in the attached text file.

Thank you
Zalan

From: protege-user <[hidden email]> on behalf of Martin O'Connor <[hidden email]>
Sent: 14 August 2018 04:33:15
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 

I’m also intrigued. That may be the biggest SWRL rules base that I have heard of. How was it created?

SWRL rules are not ‘standalone’ and generally only make sense in the context of an OWL ontology.

For example, the SWRL rule:

Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> Adult(?p)

requires that there is an associated OWL ontology that defines the Person and Adult classes and the hasAge data property.

Can you post a sample of the rules so that we can what they look like.

Martin


On Aug 13, 2018, at 10:16 AM, Michael DeBellis <[hidden email]> wrote:

Zalan, 1500 is one heck of a lot of SWRL rules. I don't know how to add them via the API since I always use the SWRLTab. Although if you aren't an experienced Java programmer (e.g., have you regularly used Eclipse or some other equivalent Java IDE?  Have you used Jena so that you know how to create Java objects from an OWL ontology?) I think it sounds like a very challenging learning curve.

I would recommend that before you try doing that you first find some subset of your rules and ontology that you can enter via the SWRLTab and make sure the rules are working as you expect them to. Even for people experienced with other rule-based systems SWRL can take some getting used to due to OWL features such as the Open World Assumption and not supporting Negation as Failure. 

Also, if at all possible try to find someone who has used OWL and SWRL before to take a look at your rules.  As I said 1500 is IMO a huge amount of rules. Perhaps there is a way to write the rules differently so you can get by with fewer rules or to divide your problem into sub-problems that are easier to test than 1500 rules all in one ontology. 

Michael

On Mon, Aug 13, 2018 at 4:38 AM, zalan mahmood <[hidden email]> wrote:

Hello,
I am a student at the University of Birmingham and working on my final year project. I working on ontology, which I have to make swrl rules for my ontology. I have the swrl rules in a text file, which are around 1500 in numbers. And now I am looking for an automated way to enter these rules in my ontology. I am using protege to make ontology but in protege in swrl Tab there is no option to import rules from a file, therefore, I thought to use the SWRLAPI to generate the swrl rules. I would like to know, how can I use the SWRLAPI to create the swrl rules? or if there is any other way in which I do not have to use the swrlAPI so please mention it as well. As I am actually a mechanical engineer and I am do not have much knowledge about Java programming.

Thank you in advance,
Zalan Mahmood



_______________________________________________
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

<example rules.txt>_______________________________________________
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: Regarding SWRL rules generation with SWRLAPI

Csongor Nyulas
Administrator
Thanks for sending the rules, Zalan. That was very helpful to get an idea about what you are dealing with.

Just looking at the first rule I see several problems. For example:
- you bind the variable ?P to a value along the PRODUCT_VALUE property coming from the value of ?od six times. See them highlighted below.
- you compare the value of ?P to six different integers. In the example below all the "greater than or equals" could be replaced by
swrlb:greaterThanOrEqual(?P, "34.6"^^xsd:integer)
- REQUESTED_DELIVERY_DAYS(?od, ?R) appears twice. Then ?R is compared to two different values (63 and 168). Keeping only the greater value (168) would be enough
- QTY(?od, ?Q) also appears twice (although interestingly its value is provided both with lower bound and upper bound: it is supposed to be between 9 and 220)
- LOT_VALUE_in_Euros(?od, ?L) appears 3 times. The value of ?L is compared to 3 different values (it supposed to be greater than or equal to 277.2, 880 and 978.5 respectively)
- you don't bind anything to the supplier!!!



I think that there are either mistakes in your rules, which you should fix (e.g. use different variable names to bind different product values, quantities and lot values -- be aware though that there is no UNA in OWL, so different variable could still bind to the same value) OR you should try to somehow simplify your rules by preprocessing them, otherwise the rule engine will most likely fail to reason over them.

Assuming that the variable names are correct as they appear in your example, an equivalent simplification of the above rule, would be:

order(?od) ^
QTY(?od, ?Q) ^ swrlb:greaterThanOrEqual(?Q, "9"^^xsd:integer)^
               swrlb:lessThanOrEqual(?Q, "220"^^xsd:integer)^
OTD(?od, ?O) ^ swrlb:equal(?O, "ON_TIME")^
REQUESTED_DELIVERY_DAYS(?od, ?R) ^ swrlb:greaterThanOrEqual(?R, "168"^^xsd:integer)^
LOT_VALUE_in_Euros(?od, ?L) ^ swrlb:greaterThanOrEqual(?L, "978.5"^^xsd:integer)^
PRODUCT_VALUE(?od, ?P) ^ swrlb:greaterThanOrEqual(?P, "34.6"^^xsd:integer)^
                         swrlb:lessThanOrEqual(?P, "37.6"^^xsd:integer) -> supplier(?something_here?)


I am still not convinced that a rule engine can deal with 1500 such rules.
In any case I would encourage you to follow Martin and Micheal's advise regarding building an ontology and testing a few of your rules out before you worry about how would you import them all.

Good luck!
Csongor



On 08/14/2018 10:54 AM, Martin O'Connor wrote:

There is really no way to load these rules without writing some code.

There is a GitHub repo containing a skeleton SWRLAPI-based project here:


The code here:


could be adopted to create SWRL rules following the example here:


As mentioned, you will need an OWL ontology that defines all the OWL concepts that you reference in your SWRL rules. The rules cannot be processed without this ontology.

I would first load this ontology into Protege and then use the SWRLTab editor and paste a few rules in manually so see if they can be correctly processed.

Martin

On Aug 14, 2018, at 12:46 AM, zalan mahmood <[hidden email]> wrote:

Dear Guys,
Thank you for your replies.
The rules are extracted from a decision tree model, which was made on WEKA software. The decision tree was imported to MATLAB where the SWRL rules were extracted from them. I know it's a lot of rules. But I am just looking for an automated way to enter the rules in Protege SWRL Tab Plugin. So in future, if I keep continued my research, I do not have to enter them manually.

Two examples of the rules are given in the attached text file.

Thank you
Zalan

From: protege-user <[hidden email]> on behalf of Martin O'Connor <[hidden email]>
Sent: 14 August 2018 04:33:15
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 

I’m also intrigued. That may be the biggest SWRL rules base that I have heard of. How was it created?

SWRL rules are not ‘standalone’ and generally only make sense in the context of an OWL ontology.

For example, the SWRL rule:

Person(?p) ^ hasAge(?p, ?age) ^ swrlb:greaterThan(?age, 17) -> Adult(?p)

requires that there is an associated OWL ontology that defines the Person and Adult classes and the hasAge data property.

Can you post a sample of the rules so that we can what they look like.

Martin


On Aug 13, 2018, at 10:16 AM, Michael DeBellis <[hidden email]> wrote:

Zalan, 1500 is one heck of a lot of SWRL rules. I don't know how to add them via the API since I always use the SWRLTab. Although if you aren't an experienced Java programmer (e.g., have you regularly used Eclipse or some other equivalent Java IDE?  Have you used Jena so that you know how to create Java objects from an OWL ontology?) I think it sounds like a very challenging learning curve.

I would recommend that before you try doing that you first find some subset of your rules and ontology that you can enter via the SWRLTab and make sure the rules are working as you expect them to. Even for people experienced with other rule-based systems SWRL can take some getting used to due to OWL features such as the Open World Assumption and not supporting Negation as Failure. 

Also, if at all possible try to find someone who has used OWL and SWRL before to take a look at your rules.  As I said 1500 is IMO a huge amount of rules. Perhaps there is a way to write the rules differently so you can get by with fewer rules or to divide your problem into sub-problems that are easier to test than 1500 rules all in one ontology. 

Michael

On Mon, Aug 13, 2018 at 4:38 AM, zalan mahmood <[hidden email]> wrote:

Hello,
I am a student at the University of Birmingham and working on my final year project. I working on ontology, which I have to make swrl rules for my ontology. I have the swrl rules in a text file, which are around 1500 in numbers. And now I am looking for an automated way to enter these rules in my ontology. I am using protege to make ontology but in protege in swrl Tab there is no option to import rules from a file, therefore, I thought to use the SWRLAPI to generate the swrl rules. I would like to know, how can I use the SWRLAPI to create the swrl rules? or if there is any other way in which I do not have to use the swrlAPI so please mention it as well. As I am actually a mechanical engineer and I am do not have much knowledge about Java programming.

Thank you in advance,
Zalan Mahmood



_______________________________________________
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

<example rules.txt>_______________________________________________
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: Regarding SWRL rules generation with SWRLAPI

Jim Balhoff-3
> On Aug 14, 2018, at 5:54 PM, Csongor Nyulas <[hidden email]> wrote:
>
> I am still not convinced that a rule engine can deal with 1500 such rules.

I think he can probably find something that can work. We use around 1 million rules with the Arachne rule engine in the Gene Ontology Noctua editor, but these are translations of OWL axioms and may be somewhat simpler (and don’t support literal comparisons). Only a small number of rules are matched for any given dataset in Noctua, however all are loaded into the engine. I have used the same rules with RDFox and I suspect it could handle many more. The Jena rule engine does well with 1500 rules but slows down quite a bit above 100,000. Jena does probably support the needed literal comparisons.

Best regards,
Jim



____________________________________________
James P. Balhoff, Ph.D.
Renaissance Computing Institute (RENCI)
University of North Carolina at Chapel Hill



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

Re: Regarding SWRL rules generation with SWRLAPI

zalan mahmood

Dear Guys,

 

First of all thank you for your kind replies. After reading @Michael reply I was thinking may be the decision tree from which I have extracted these are rules is overfitting, which of course is of no use to me, therefore, I started to prune the tree as much as possible by compromising a bit on the accuracy. And Thankfully I reduce the rules to around 50, which can be typed at this occasion.

 

@Martin, I know I have to write some code to load rules to protégé. But I am not doing it right now. And indeed, I have stick to your advice, “I would first load this ontology into Protege and then use the SWRLTab editor and paste a few rules in manually so see if they can be correctly processed.”, and tried my new 50 rules on protégé. But didn’t get a result what I was expecting.

 

@Csonger and Martin, my new rules are bit change, one of them is stated below in the picture. And all I wanted this rule to do the thing which I have mentioned in the comment

However, these rules didn’t assigned any individual to the class s23410225( this is a supplier name for privacy I named them with s234...., I have 8 suppliers like this), but in fact, these 50 rules give me the result shown below in picture

And non of the Order individual is assigned to any supplier class.

Thank you

Zalan Mahmood

 


From: protege-user <[hidden email]> on behalf of Jim Balhoff <[hidden email]>
Sent: Tuesday, August 14, 2018 11:31:09 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
> On Aug 14, 2018, at 5:54 PM, Csongor Nyulas <[hidden email]> wrote:
>
> I am still not convinced that a rule engine can deal with 1500 such rules.

I think he can probably find something that can work. We use around 1 million rules with the Arachne rule engine in the Gene Ontology Noctua editor, but these are translations of OWL axioms and may be somewhat simpler (and don’t support literal comparisons). Only a small number of rules are matched for any given dataset in Noctua, however all are loaded into the engine. I have used the same rules with RDFox and I suspect it could handle many more. The Jena rule engine does well with 1500 rules but slows down quite a bit above 100,000. Jena does probably support the needed literal comparisons.

Best regards,
Jim



____________________________________________
James P. Balhoff, Ph.D.
Renaissance Computing Institute (RENCI)
University of North Carolina at Chapel Hill



_______________________________________________
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: Regarding SWRL rules generation with SWRLAPI

Martin O'Connor-2
Are you using the latests Protege 5.2 and the latest 2.0.5 version of the SWRLTab plugin?

There are a lot of odd ‘integers’ in your rules, e.g., “1.128”^^xsd:integer.

Unfortunately the SWRLAPI does not seem to be indicating errors here. I will look at that.

In any case, I would make sure you are using the correct datatypes for your literals.

You can also use SQWRL to debug your rules:


Martin


On Aug 15, 2018, at 2:53 AM, zalan mahmood <[hidden email]> wrote:

Dear Guys,

 

First of all thank you for your kind replies. After reading @Michael reply I was thinking may be the decision tree from which I have extracted these are rules is overfitting, which of course is of no use to me, therefore, I started to prune the tree as much as possible by compromising a bit on the accuracy. And Thankfully I reduce the rules to around 50, which can be typed at this occasion.

 

@Martin, I know I have to write some code to load rules to protégé. But I am not doing it right now. And indeed, I have stick to your advice, “I would first load this ontology into Protege and then use the SWRLTab editor and paste a few rules in manually so see if they can be correctly processed.”, and tried my new 50 rules on protégé. But didn’t get a result what I was expecting.

 

@Csonger and Martin, my new rules are bit change, one of them is stated below in the picture. And all I wanted this rule to do the thing which I have mentioned in the comment
<5DD2461B2FAA4270B5DA306DB1EEEA92.png>
<594340AA35894F738A3E5350A0183517.png>
However, these rules didn’t assigned any individual to the class s23410225( this is a supplier name for privacy I named them with s234...., I have 8 suppliers like this), but in fact, these 50 rules give me the result shown below in picture
<B5C027FBE27247C2A7DCCA372C601B5D.png>
And non of the Order individual is assigned to any supplier class.

Thank you
Zalan Mahmood

 


From: protege-user <[hidden email]> on behalf of Jim Balhoff <[hidden email]>
Sent: Tuesday, August 14, 2018 11:31:09 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
> On Aug 14, 2018, at 5:54 PM, Csongor Nyulas <[hidden email]> wrote:
> 
> I am still not convinced that a rule engine can deal with 1500 such rules. 

I think he can probably find something that can work. We use around 1 million rules with the Arachne rule engine in the Gene Ontology Noctua editor, but these are translations of OWL axioms and may be somewhat simpler (and don’t support literal comparisons). Only a small number of rules are matched for any given dataset in Noctua, however all are loaded into the engine. I have used the same rules with RDFox and I suspect it could handle many more. The Jena rule engine does well with 1500 rules but slows down quite a bit above 100,000. Jena does probably support the needed literal comparisons.

Best regards,
Jim



____________________________________________
James P. Balhoff, Ph.D.
Renaissance Computing Institute (RENCI)
University of North Carolina at Chapel Hill



_______________________________________________
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: Regarding SWRL rules generation with SWRLAPI

zalan mahmood

Yes Martin it seems to be problem in my variables.. Should I can it to Decimal?

 

Zalan Mahmood Ayaz Khan

 


From: protege-user <[hidden email]> on behalf of Martin O'Connor <[hidden email]>
Sent: Wednesday, August 15, 2018 5:08:07 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
Are you using the latests Protege 5.2 and the latest 2.0.5 version of the SWRLTab plugin?

There are a lot of odd ‘integers’ in your rules, e.g., “1.128”^^xsd:integer.

Unfortunately the SWRLAPI does not seem to be indicating errors here. I will look at that.

In any case, I would make sure you are using the correct datatypes for your literals.

You can also use SQWRL to debug your rules:


Martin


On Aug 15, 2018, at 2:53 AM, zalan mahmood <[hidden email]> wrote:

Dear Guys,

 

First of all thank you for your kind replies. After reading @Michael reply I was thinking may be the decision tree from which I have extracted these are rules is overfitting, which of course is of no use to me, therefore, I started to prune the tree as much as possible by compromising a bit on the accuracy. And Thankfully I reduce the rules to around 50, which can be typed at this occasion.

 

@Martin, I know I have to write some code to load rules to protégé. But I am not doing it right now. And indeed, I have stick to your advice, “I would first load this ontology into Protege and then use the SWRLTab editor and paste a few rules in manually so see if they can be correctly processed.”, and tried my new 50 rules on protégé. But didn’t get a result what I was expecting.

 

@Csonger and Martin, my new rules are bit change, one of them is stated below in the picture. And all I wanted this rule to do the thing which I have mentioned in the comment
<5DD2461B2FAA4270B5DA306DB1EEEA92.png>
<594340AA35894F738A3E5350A0183517.png>
However, these rules didn’t assigned any individual to the class s23410225( this is a supplier name for privacy I named them with s234...., I have 8 suppliers like this), but in fact, these 50 rules give me the result shown below in picture
<B5C027FBE27247C2A7DCCA372C601B5D.png>
And non of the Order individual is assigned to any supplier class.

Thank you
Zalan Mahmood

 


From: protege-user <[hidden email]> on behalf of Jim Balhoff <[hidden email]>
Sent: Tuesday, August 14, 2018 11:31:09 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
> On Aug 14, 2018, at 5:54 PM, Csongor Nyulas <[hidden email]> wrote:
> 
> I am still not convinced that a rule engine can deal with 1500 such rules. 

I think he can probably find something that can work. We use around 1 million rules with the Arachne rule engine in the Gene Ontology Noctua editor, but these are translations of OWL axioms and may be somewhat simpler (and don’t support literal comparisons). Only a small number of rules are matched for any given dataset in Noctua, however all are loaded into the engine. I have used the same rules with RDFox and I suspect it could handle many more. The Jena rule engine does well with 1500 rules but slows down quite a bit above 100,000. Jena does probably support the needed literal comparisons.

Best regards,
Jim



____________________________________________
James P. Balhoff, Ph.D.
Renaissance Computing Institute (RENCI)
University of North Carolina at Chapel Hill



_______________________________________________
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: Regarding SWRL rules generation with SWRLAPI

Martin O'Connor-2

Yup - xsd:decimal would work. Make sure you are consistent in your typing. For example, don’t try to compare decimals with integers.

Martin

On Aug 15, 2018, at 9:16 AM, zalan mahmood <[hidden email]> wrote:

Yes Martin it seems to be problem in my variables.. Should I can it to Decimal?
 
Zalan Mahmood Ayaz Khan
 

From: protege-user <[hidden email]> on behalf of Martin O'Connor <[hidden email]>
Sent: Wednesday, August 15, 2018 5:08:07 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
Are you using the latests Protege 5.2 and the latest 2.0.5 version of the SWRLTab plugin?

There are a lot of odd ‘integers’ in your rules, e.g., “1.128”^^xsd:integer.

Unfortunately the SWRLAPI does not seem to be indicating errors here. I will look at that.

In any case, I would make sure you are using the correct datatypes for your literals.

You can also use SQWRL to debug your rules:


Martin


On Aug 15, 2018, at 2:53 AM, zalan mahmood <[hidden email]> wrote:

Dear Guys,

 

First of all thank you for your kind replies. After reading @Michael reply I was thinking may be the decision tree from which I have extracted these are rules is overfitting, which of course is of no use to me, therefore, I started to prune the tree as much as possible by compromising a bit on the accuracy. And Thankfully I reduce the rules to around 50, which can be typed at this occasion.

 

@Martin, I know I have to write some code to load rules to protégé. But I am not doing it right now. And indeed, I have stick to your advice, “I would first load this ontology into Protege and then use the SWRLTab editor and paste a few rules in manually so see if they can be correctly processed.”, and tried my new 50 rules on protégé. But didn’t get a result what I was expecting.

 

@Csonger and Martin, my new rules are bit change, one of them is stated below in the picture. And all I wanted this rule to do the thing which I have mentioned in the comment
<5DD2461B2FAA4270B5DA306DB1EEEA92.png>
<594340AA35894F738A3E5350A0183517.png>
However, these rules didn’t assigned any individual to the class s23410225( this is a supplier name for privacy I named them with s234...., I have 8 suppliers like this), but in fact, these 50 rules give me the result shown below in picture
<B5C027FBE27247C2A7DCCA372C601B5D.png>
And non of the Order individual is assigned to any supplier class.

Thank you
Zalan Mahmood

 


 
From: protege-user <[hidden email]> on behalf of Jim Balhoff <[hidden email]>
Sent: Tuesday, August 14, 2018 11:31:09 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
> On Aug 14, 2018, at 5:54 PM, Csongor Nyulas <[hidden email]> wrote:
> 
> I am still not convinced that a rule engine can deal with 1500 such rules. 

I think he can probably find something that can work. We use around 1 million rules with the Arachne rule engine in the Gene Ontology Noctua editor, but these are translations of OWL axioms and may be somewhat simpler (and don’t support literal comparisons). Only a small number of rules are matched for any given dataset in Noctua, however all are loaded into the engine. I have used the same rules with RDFox and I suspect it could handle many more. The Jena rule engine does well with 1500 rules but slows down quite a bit above 100,000. Jena does probably support the needed literal comparisons.

Best regards,
Jim



____________________________________________
James P. Balhoff, Ph.D.
Renaissance Computing Institute (RENCI)
University of North Carolina at Chapel Hill



_______________________________________________
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: Regarding SWRL rules generation with SWRLAPI

zalan mahmood

Ok brother, let me try it. Thank you

 

Zalan Mahmood Ayaz Khan

 


From: protege-user <[hidden email]> on behalf of Martin O'Connor <[hidden email]>
Sent: Wednesday, August 15, 2018 5:19:56 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 

Yup - xsd:decimal would work. Make sure you are consistent in your typing. For example, don’t try to compare decimals with integers.

Martin

On Aug 15, 2018, at 9:16 AM, zalan mahmood <[hidden email]> wrote:

Yes Martin it seems to be problem in my variables.. Should I can it to Decimal?
 
Zalan Mahmood Ayaz Khan
 

From: protege-user <[hidden email]> on behalf of Martin O'Connor <[hidden email]>
Sent: Wednesday, August 15, 2018 5:08:07 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
Are you using the latests Protege 5.2 and the latest 2.0.5 version of the SWRLTab plugin?

There are a lot of odd ‘integers’ in your rules, e.g., “1.128”^^xsd:integer.

Unfortunately the SWRLAPI does not seem to be indicating errors here. I will look at that.

In any case, I would make sure you are using the correct datatypes for your literals.

You can also use SQWRL to debug your rules:


Martin


On Aug 15, 2018, at 2:53 AM, zalan mahmood <[hidden email]> wrote:

Dear Guys,

 

First of all thank you for your kind replies. After reading @Michael reply I was thinking may be the decision tree from which I have extracted these are rules is overfitting, which of course is of no use to me, therefore, I started to prune the tree as much as possible by compromising a bit on the accuracy. And Thankfully I reduce the rules to around 50, which can be typed at this occasion.

 

@Martin, I know I have to write some code to load rules to protégé. But I am not doing it right now. And indeed, I have stick to your advice, “I would first load this ontology into Protege and then use the SWRLTab editor and paste a few rules in manually so see if they can be correctly processed.”, and tried my new 50 rules on protégé. But didn’t get a result what I was expecting.

 

@Csonger and Martin, my new rules are bit change, one of them is stated below in the picture. And all I wanted this rule to do the thing which I have mentioned in the comment
<5DD2461B2FAA4270B5DA306DB1EEEA92.png>
<594340AA35894F738A3E5350A0183517.png>
However, these rules didn’t assigned any individual to the class s23410225( this is a supplier name for privacy I named them with s234...., I have 8 suppliers like this), but in fact, these 50 rules give me the result shown below in picture
<B5C027FBE27247C2A7DCCA372C601B5D.png>
And non of the Order individual is assigned to any supplier class.

Thank you
Zalan Mahmood

 


 
From: protege-user <[hidden email]> on behalf of Jim Balhoff <[hidden email]>
Sent: Tuesday, August 14, 2018 11:31:09 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
> On Aug 14, 2018, at 5:54 PM, Csongor Nyulas <[hidden email]> wrote:
> 
> I am still not convinced that a rule engine can deal with 1500 such rules. 

I think he can probably find something that can work. We use around 1 million rules with the Arachne rule engine in the Gene Ontology Noctua editor, but these are translations of OWL axioms and may be somewhat simpler (and don’t support literal comparisons). Only a small number of rules are matched for any given dataset in Noctua, however all are loaded into the engine. I have used the same rules with RDFox and I suspect it could handle many more. The Jena rule engine does well with 1500 rules but slows down quite a bit above 100,000. Jena does probably support the needed literal comparisons.

Best regards,
Jim



____________________________________________
James P. Balhoff, Ph.D.
Renaissance Computing Institute (RENCI)
University of North Carolina at Chapel Hill



_______________________________________________
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: Regarding SWRL rules generation with SWRLAPI

zalan mahmood

Dear all,

The issue has been resolved. @Martin, I have changed the integers to decimal and it worked.. Thank you.. Thank you all.

 

Zalan Mahmood Ayaz Khan

 


From: protege-user <[hidden email]> on behalf of zalan mahmood <[hidden email]>
Sent: Wednesday, August 15, 2018 5:21:36 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 

Ok brother, let me try it. Thank you

 

Zalan Mahmood Ayaz Khan

 


From: protege-user <[hidden email]> on behalf of Martin O'Connor <[hidden email]>
Sent: Wednesday, August 15, 2018 5:19:56 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 

Yup - xsd:decimal would work. Make sure you are consistent in your typing. For example, don’t try to compare decimals with integers.

Martin

On Aug 15, 2018, at 9:16 AM, zalan mahmood <[hidden email]> wrote:

Yes Martin it seems to be problem in my variables.. Should I can it to Decimal?
 
Zalan Mahmood Ayaz Khan
 

From: protege-user <[hidden email]> on behalf of Martin O'Connor <[hidden email]>
Sent: Wednesday, August 15, 2018 5:08:07 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
Are you using the latests Protege 5.2 and the latest 2.0.5 version of the SWRLTab plugin?

There are a lot of odd ‘integers’ in your rules, e.g., “1.128”^^xsd:integer.

Unfortunately the SWRLAPI does not seem to be indicating errors here. I will look at that.

In any case, I would make sure you are using the correct datatypes for your literals.

You can also use SQWRL to debug your rules:


Martin


On Aug 15, 2018, at 2:53 AM, zalan mahmood <[hidden email]> wrote:

Dear Guys,

 

First of all thank you for your kind replies. After reading @Michael reply I was thinking may be the decision tree from which I have extracted these are rules is overfitting, which of course is of no use to me, therefore, I started to prune the tree as much as possible by compromising a bit on the accuracy. And Thankfully I reduce the rules to around 50, which can be typed at this occasion.

 

@Martin, I know I have to write some code to load rules to protégé. But I am not doing it right now. And indeed, I have stick to your advice, “I would first load this ontology into Protege and then use the SWRLTab editor and paste a few rules in manually so see if they can be correctly processed.”, and tried my new 50 rules on protégé. But didn’t get a result what I was expecting.

 

@Csonger and Martin, my new rules are bit change, one of them is stated below in the picture. And all I wanted this rule to do the thing which I have mentioned in the comment
<5DD2461B2FAA4270B5DA306DB1EEEA92.png>
<594340AA35894F738A3E5350A0183517.png>
However, these rules didn’t assigned any individual to the class s23410225( this is a supplier name for privacy I named them with s234...., I have 8 suppliers like this), but in fact, these 50 rules give me the result shown below in picture
<B5C027FBE27247C2A7DCCA372C601B5D.png>
And non of the Order individual is assigned to any supplier class.

Thank you
Zalan Mahmood

 


 
From: protege-user <[hidden email]> on behalf of Jim Balhoff <[hidden email]>
Sent: Tuesday, August 14, 2018 11:31:09 PM
To: User support for WebProtege and Protege Desktop
Subject: Re: [protege-user] Regarding SWRL rules generation with SWRLAPI
 
> On Aug 14, 2018, at 5:54 PM, Csongor Nyulas <[hidden email]> wrote:
> 
> I am still not convinced that a rule engine can deal with 1500 such rules. 

I think he can probably find something that can work. We use around 1 million rules with the Arachne rule engine in the Gene Ontology Noctua editor, but these are translations of OWL axioms and may be somewhat simpler (and don’t support literal comparisons). Only a small number of rules are matched for any given dataset in Noctua, however all are loaded into the engine. I have used the same rules with RDFox and I suspect it could handle many more. The Jena rule engine does well with 1500 rules but slows down quite a bit above 100,000. Jena does probably support the needed literal comparisons.

Best regards,
Jim



____________________________________________
James P. Balhoff, Ph.D.
Renaissance Computing Institute (RENCI)
University of North Carolina at Chapel Hill



_______________________________________________
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