Question about Self statement

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

Question about Self statement

Marek

Hello, I would like to ask you for a help with one condition which I have to implement in my ontology. I will explain it in one simple example (my ontology is about different things, but it would be difficult to explain it, so I choosed a simple example). The setting is: I have three disjoint classes. Person, Role (sublasses Pilot and Navigator) and PlaneCrew. Instance of role can be assigned to only one person (but I can have multiple instances of pilots and navigators). Person can have pilot or navigator role, but one individual of person can have multiple combinations of pilot/navigator roles. Plane crew must be composed from one pilot and one navigator. And the task: I need to forbide plane crews composed from pilot and navigator, in which these roles belong to the same person. Maybe strange example, but I need to model exclusivity of roles checked throught person. Idea behind this example could be that I can be pilot in crews A and B and I am navigator crew C and my manager dynamically assigns crews to planes (according to available planes and persons on airport).

obrázok.png

I tried to declare in class PlaneCrew sublclass condition, that checks that pilot who belongs to crew can’t be assigned to person, who has role navigator in the same crew. I thought, that for this rule I will be able to use Self statement (I was inspired by this tutorial https://solutioneer.wordpress.com/2013/08/04/owl-2-0-handling-self-restriction-for-object-properties-in-protege-4-x/). I created this condition:

obrázok.png

I thought that Self will be pointing to instance (individual) of PlaneCrew class for which this condition is being verified. As this rule is not working, I have to be wrong with something.

Sorry for longer post, I tried to be as short as I could.

Thank you very much for your help!

 

Kind regards, Marek Turza

 


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

Re: Question about Self statement

Marek
Oh sorry, I forgot attachement.

po 24. 6. 2019 o 14:36 Marek Turza <[hidden email]> napísal(a):

Hello, I would like to ask you for a help with one condition which I have to implement in my ontology. I will explain it in one simple example (my ontology is about different things, but it would be difficult to explain it, so I choosed a simple example). The setting is: I have three disjoint classes. Person, Role (sublasses Pilot and Navigator) and PlaneCrew. Instance of role can be assigned to only one person (but I can have multiple instances of pilots and navigators). Person can have pilot or navigator role, but one individual of person can have multiple combinations of pilot/navigator roles. Plane crew must be composed from one pilot and one navigator. And the task: I need to forbide plane crews composed from pilot and navigator, in which these roles belong to the same person. Maybe strange example, but I need to model exclusivity of roles checked throught person. Idea behind this example could be that I can be pilot in crews A and B and I am navigator crew C and my manager dynamically assigns crews to planes (according to available planes and persons on airport).

obrázok.png

I tried to declare in class PlaneCrew sublclass condition, that checks that pilot who belongs to crew can’t be assigned to person, who has role navigator in the same crew. I thought, that for this rule I will be able to use Self statement (I was inspired by this tutorial https://solutioneer.wordpress.com/2013/08/04/owl-2-0-handling-self-restriction-for-object-properties-in-protege-4-x/). I created this condition:

obrázok.png

I thought that Self will be pointing to instance (individual) of PlaneCrew class for which this condition is being verified. As this rule is not working, I have to be wrong with something.

Sorry for longer post, I tried to be as short as I could.

Thank you very much for your help!

 

Kind regards, Marek Turza

 


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

pilotNavigator.owl (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Question about Self statement

Dave McComb-2

I have yet to find a legitimate use for “self” and I find deeply nested restrictions to be problematic.

 

If you’d be willing to consider something simpler:

 

Create two object properties:  hasPilot and hasNavigator.  Make them functional, so you’ll only have one of them per flight/ crew.  Make them disjoint so that the same flight/crew can not have both properties pointing to the same individual

 

Create another property hasCrew.  Make hasPilot and hasNavigator subProperties of hasCrew

 

I would create a class “flight” rather than crew.  You can get the crew of a flight by querying hasCrew.

 

Make sure you assert that the individuals are different.

 

Sent from Mail for Windows 10

 


From: protege-user <[hidden email]> on behalf of Marek Turza <[hidden email]>
Sent: Monday, June 24, 2019 6:41:31 AM
To: [hidden email]
Subject: Re: [protege-user] Question about Self statement
 
Oh sorry, I forgot attachement.

po 24. 6. 2019 o 14:36 Marek Turza <[hidden email]> napísal(a):

Hello, I would like to ask you for a help with one condition which I have to implement in my ontology. I will explain it in one simple example (my ontology is about different things, but it would be difficult to explain it, so I choosed a simple example). The setting is: I have three disjoint classes. Person, Role (sublasses Pilot and Navigator) and PlaneCrew. Instance of role can be assigned to only one person (but I can have multiple instances of pilots and navigators). Person can have pilot or navigator role, but one individual of person can have multiple combinations of pilot/navigator roles. Plane crew must be composed from one pilot and one navigator. And the task: I need to forbide plane crews composed from pilot and navigator, in which these roles belong to the same person. Maybe strange example, but I need to model exclusivity of roles checked throught person. Idea behind this example could be that I can be pilot in crews A and B and I am navigator crew C and my manager dynamically assigns crews to planes (according to available planes and persons on airport).

obrázok.png

I tried to declare in class PlaneCrew sublclass condition, that checks that pilot who belongs to crew can’t be assigned to person, who has role navigator in the same crew. I thought, that for this rule I will be able to use Self statement (I was inspired by this tutorial https://solutioneer.wordpress.com/2013/08/04/owl-2-0-handling-self-restriction-for-object-properties-in-protege-4-x/). I created this condition:

obrázok.png

I thought that Self will be pointing to instance (individual) of PlaneCrew class for which this condition is being verified. As this rule is not working, I have to be wrong with something.

Sorry for longer post, I tried to be as short as I could.

Thank you very much for your help!

 

Kind regards, Marek Turza

 


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

Re: Question about Self statement

Marek
Thank you, I hope I understand solution which you mentioned. But
unfortunately, there has to be 3 classes (Person, Role, Object). I can't
model this relation directly between Person and Object (so in our example:
Person>-isPilot->Flight or Flight>-hasPilot->Person). And therefore I have
to somehow identify that loop in PlaneCrew (Flight), when Pilot belongs to
Person which has role Navigator in the same PlaneCrew/Flight.



--
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: Question about Self statement

Igor Toujilov-2
In reply to this post by Marek

Hi Marek,

First, in OWL, Self is a very short reference to the same individual of the same class-expression. It cannot refer to an outer class-expression. The purpose of Self is to tell something about reflexivity. So, when you tell Navigator and belongsToCrew some Self, you effectively express all Navigator roles that belong to themselves through belongsToCrew, which does not make sense.

So, you need an explicit individual variable to express your condition. Pure OWL DL does not support explicit variables, but SWRL does (please see below).

 

Second, even if you specify your restriction as a superclass of PlaneCrew, this is not very helpful because if the restriction is violated, your ontology becomes inconsistent, and it can be very hard to find the reason for the inconsistency, especially in a big ontology.

 

So, I suggest introducing a class ForbiddenCrew (or whatever you name it) as a subclass of PlaneCrew. Then in the Rules tab, write the following SWRL rule (untested; you can correct if it does not work):

 

PlaneCrew(?c), Pilot(?p), Navigator(?n), Person(?pr), belongsToCrew(?p, ?c), belongsToCrew(?n, ?c), hasRole(?pr, ?p), hasRole(?pr, ?n) → ForbiddenCrew(?c)

 

Run a reasoner, and check for inferred individuals of ForbiddenCrew.

 

Cheers,

Igor

 

 
 
Sent: Monday, June 24, 2019 at 1:36 PM
From: "Marek Turza" <[hidden email]>
To: [hidden email]
Subject: [protege-user] Question about Self statement

Hello, I would like to ask you for a help with one condition which I have to implement in my ontology. I will explain it in one simple example (my ontology is about different things, but it would be difficult to explain it, so I choosed a simple example). The setting is: I have three disjoint classes. Person, Role (sublasses Pilot and Navigator) and PlaneCrew. Instance of role can be assigned to only one person (but I can have multiple instances of pilots and navigators). Person can have pilot or navigator role, but one individual of person can have multiple combinations of pilot/navigator roles. Plane crew must be composed from one pilot and one navigator. And the task: I need to forbide plane crews composed from pilot and navigator, in which these roles belong to the same person. Maybe strange example, but I need to model exclusivity of roles checked throught person. Idea behind this example could be that I can be pilot in crews A and B and I am navigator crew C and my manager dynamically assigns crews to planes (according to available planes and persons on airport).

obrázok.png

 

I tried to declare in class PlaneCrew sublclass condition, that checks that pilot who belongs to crew can’t be assigned to person, who has role navigator in the same crew. I thought, that for this rule I will be able to use Self statement (I was inspired by this tutorial https://solutioneer.wordpress.com/2013/08/04/owl-2-0-handling-self-restriction-for-object-properties-in-protege-4-x/). I created this condition:

obrázok.png

I thought that Self will be pointing to instance (individual) of PlaneCrew class for which this condition is being verified. As this rule is not working, I have to be wrong with something.

Sorry for longer post, I tried to be as short as I could.
 

Thank you very much for your help!

 

Kind regards, Marek Turza

 

_______________________________________________ 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