SWRL Rules with Math

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

SWRL Rules with Math

Alhusain
Hello Everyone,
Sorry to ask basic questions!!
I developed My ontology from scratch using Protege for my case study.
I have two questions:
Q1 - How could I represent and describe my ontology including (individuals, classes, subclasses, relationships, Equivalents, Disjoint,etc.,) when I write the article using Formulas.
I need a reference for the language and syntax that could be used for this description formula?

Q2- I have class TASK1 contains an individual  process11 with Data properties with entry data: length 10, width:25

I'd like to write SWRL rule to calculate the Area for process11 which is Area = length*width and show it as one of process11 data properties with the result value.
Did I need to create Area property and leave it empty to get the result from the Rule? if yes, I try to write the next swrl rules but it not working in 3.4 or 5.0.      
  Rule: Task(?x), Width(?x, ?w), Length(?x, ?l), swrlb:multiply(?a, ?w, ?l) -> Area(?x, ?a)
  Rule: Task(?x), Width(?x, ?w), Length(?x, ?l), swrlb:multiply(?a, ?w, ?l) -> sqwrl:select (?x, ?a,?w,?l)

 What is the right way to get the results?

Thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: SWRL Rules with Math

Martin O'Connor-2

I would use the latest 5.2.0 release of Protege. I would also make sure you update to the latest 2.0.0 version of SWRLTab plugin (via File->Check for plugins…).

The SWRL language FAQ is here:


SQWRL is described here:


There is also a mathematical built-in library that can be used for mathematical expressions. It is documented here:


Martin

On May 14, 2017, at 11:40 AM, Alhusain <[hidden email]> wrote:

Hello Everyone,
Sorry to ask basic questions!!
I developed My ontology from scratch using Protege for my case study.
I have two questions:
Q1 - How could I represent and describe my ontology including (individuals,
classes, subclasses, relationships, Equivalents, Disjoint,etc.,) when I
write the article using Formulas.
I need a reference for the language and syntax that could be used for this
description formula?

Q2- I have class TASK1 contains an individual  process11 with Data
properties with entry data: length 10, width:25

I'd like to write SWRL rule to calculate the Area for process11 which is
Area = length*width and show it as one of process11 data properties with the
result value.
Did I need to create Area property and leave it empty to get the result from
the Rule? if yes, I try to write the next swrl rules but it not working in
3.4 or 5.0.       
 Rule: Task(?x), Width(?x, ?w), Length(?x, ?l), swrlb:multiply(?a, ?w, ?l)
-> Area(?x, ?a)
 Rule: Task(?x), Width(?x, ?w), Length(?x, ?l), swrlb:multiply(?a, ?w, ?l)
-> sqwrl:select (?x, ?a,?w,?l)

What is the right way to get the results?

Thanks in advance



--
View this message in context: http://protege-project.136.n4.nabble.com/SWRL-Rules-with-Math-tp4668473.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
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: SWRL Rules with Math

Alhusain

Thanks Martin for the reply and for the links.
I do use protege5.2.0 and updated SWRL plug-in.
Please see the screenshot. I am trying to get the value of the (Data property) Area based on the rule that written up.
There is an issue with swrl built-in !!!  
I attached the owl file.

...


Task1.owl



Thank you ....  
Reply | Threaded
Open this post in threaded view
|

Re: SWRL Rules with Math

samsontu
Hi,

There is probably an issue with the Rules editor. However, your rule doesn’t fire because the rule requires that a Task1 instance  having a property assertion linking the instance to some  process.  Your screen dump shows that the instance process1 is an instance of Task1. The predicate (hasprocess ?t, ?p) has no binding in your ontology.

With best regards,
Samson


On May 14, 2017, at 3:45 PM, Alhusain <[hidden email]> wrote:


Thanks Martin for the reply and for the links.
I do use protege5.2.0 and updated SWRL plug-in.
Please see the screenshot. I am trying to get the value of the (Data
property) Area based on the rule that written up.
There is an issue with swrl built-in !!!  
I attached the owl file.

... <http://protege-project.136.n4.nabble.com/file/n4668483/potege5.gif>


Task1.owl <http://protege-project.136.n4.nabble.com/file/n4668483/Task1.owl>  



Thank you ....  



--
View this message in context: http://protege-project.136.n4.nabble.com/SWRL-Rules-with-Math-tp4668473p4668483.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
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