Check if a statement is true

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

Check if a statement is true

Dr. Muhammad Masroor Ali
Dear Protege Users,
I want to check in Protege if a statement like the following is true or not:

individualA property individualB

Something like,
mary owns redCar

How do I do that in Protege?

Thanks in advance.





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

Re: Check if a statement is true

Michael DeBellis-2
There are many ways to model this. One way to do this would be via a SWRL rule. So assuming hasCar is a property with domain Person and range Car and hasColor is a property with domain Thing and range Color (where color is an enumerated class with values such as Red, Blue, Green, Grey, etc. then:

hasCar(?p,?c) ^ hasColor(?c, Red) -> ....   

Where the ... is whatever action you want to take for all people that own red cars. If Mary is a named Individual that is an instance of Person and you wanted to check just specifically for Mary whether she owns a red car, you would replace the ?p parameter (which will iterate over each Person that hasCar) and instead write the rule:

hasCar(Mary,?c) ^ hasColor(?c, Red) -> ....

As an example of what might go into the right hand side imagine you have a subclass of Person called RedCarOwner for each Person that owns a red car then the full rule would be:

hasCar(?p,?c) ^ hasColor(?c, Red) ->  RedCarOwner(?p)

You could also just do this with DL. So you could make RedCarOwner a defined class with the definition:

Person and hasCar some (Car hasColor value Red)

And the reasoner should classify Mary as a RedCarOwner if she owns a car that hasColor Red. 

Michael




On Fri, Aug 17, 2018 at 11:42 AM, Dr. Muhammad Masroor Ali <[hidden email]> wrote:
Dear Protege Users,
I want to check in Protege if a statement like the following is true or not:

individualA property individualB

Something like,
mary owns redCar

How do I do that in Protege?

Thanks in advance.





_______________________________________________
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