Quantcast

Is there a way to express that a class is not empty, in Protégé?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Is there a way to express that a class is not empty, in Protégé?

Paulo Urbano
Hi´

Imagine that I want to infer from the property isRival relating two individuals that if

John isRival Peter

than 


There is someone that John Likes that Peter also likes,

supposing that likes is also na objectProperty.

I would want to express something like:

The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.

How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 

rival(?p1,?p2) -> {there is someone that both like}

Best
Paulo Urbano

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

Re: Is there a way to express that a class is not empty, in Protégé?

Igor Toujilov-2

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 

 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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
|  
Report Content as Inappropriate

Re: Is there a way to express that a class is not empty, in Protégé?

Paulo Urbano
Ok thanks 

But this way I will need a rule specific for each pair of rivals... which is a clear limitation.

I was wandering how we could design a more abstract rule for any pair (?x,?y) where you have ?x is_rival_of ?y.

is_rival_of(?x,?y) ->  (...)

But I understand the limitations of SWRL....

I cannot have  the class (inverse(likes) value ?x) inside a rule...  The class of entities that ?x likes


Very best
Paulo




2017-05-09 1:30 GMT+01:00 Igor Toujilov <[hidden email]>:

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 

 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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
|  
Report Content as Inappropriate

Re: Is there a way to express that a class is not empty, in Protégé?

Adila Alfa Krisnadhi
The rule:
is_rival_of(x,y) -> \exists z (likes(x,z) and likes(y,z))

is similar to property chain, but the chain is implied (unlike OWL property chain where the chain is on the antecedent part of the axiom).

As far as I know, the above rule cannot be expressed in OWL.

If one of x and y is given explicitly as a named individual, then we can have the following axiom:

is_rival_of some { peter }  SubClassOf: likes some ( inverse(likes) some { peter } )  

which reads as “anyone who is a rival of Peter likes someone who is liked by Peter”

Alternatively,

inverse(is_rival_of) some { John } SubClassOf: likes some ( inverse(likes) some { John } )

which reads as “anyone for whom John is a rival like someone who is liked by John.


—adila



On May 10, 2017, at 7:19 AM, Paulo Urbano <[hidden email]> wrote:

Ok thanks 

But this way I will need a rule specific for each pair of rivals... which is a clear limitation.

I was wandering how we could design a more abstract rule for any pair (?x,?y) where you have ?x is_rival_of ?y.

is_rival_of(?x,?y) ->  (...)

But I understand the limitations of SWRL....

I cannot have  the class (inverse(likes) value ?x) inside a rule...  The class of entities that ?x likes


Very best
Paulo




2017-05-09 1:30 GMT+01:00 Igor Toujilov <[hidden email]>:

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 
 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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
|  
Report Content as Inappropriate

Re: Is there a way to express that a class is not empty, in Protégé?

Michael DeBellis-2
I was just trying out that rule (after creating a small test ontology with the appropriate objects) and I think you are correct. SWRL won't parse it. The error is: unexpected token '(' I think its complaining about the first paren in the consequent, before "likes"




On Wed, May 10, 2017 at 11:40 AM, Adila Alfa Krisnadhi <[hidden email]> wrote:
The rule:
is_rival_of(x,y) -> \exists z (likes(x,z) and likes(y,z))

is similar to property chain, but the chain is implied (unlike OWL property chain where the chain is on the antecedent part of the axiom).

As far as I know, the above rule cannot be expressed in OWL.

If one of x and y is given explicitly as a named individual, then we can have the following axiom:

is_rival_of some { peter }  SubClassOf: likes some ( inverse(likes) some { peter } )  

which reads as “anyone who is a rival of Peter likes someone who is liked by Peter”

Alternatively,

inverse(is_rival_of) some { John } SubClassOf: likes some ( inverse(likes) some { John } )

which reads as “anyone for whom John is a rival like someone who is liked by John.


—adila



On May 10, 2017, at 7:19 AM, Paulo Urbano <[hidden email]> wrote:

Ok thanks 

But this way I will need a rule specific for each pair of rivals... which is a clear limitation.

I was wandering how we could design a more abstract rule for any pair (?x,?y) where you have ?x is_rival_of ?y.

is_rival_of(?x,?y) ->  (...)

But I understand the limitations of SWRL....

I cannot have  the class (inverse(likes) value ?x) inside a rule...  The class of entities that ?x likes


Very best
Paulo




2017-05-09 1:30 GMT+01:00 Igor Toujilov <[hidden email]>:

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 
 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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



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

Re: Is there a way to express that a class is not empty, in Protégé?

samsontu
Use Protege’s Rule tab, which supports class expressions as predicates, not SWRLTab, to enter the rule:



With best regards,
Samson


On May 10, 2017, at 11:45 AM, Michael DeBellis <[hidden email]> wrote:

I was just trying out that rule (after creating a small test ontology with the appropriate objects) and I think you are correct. SWRL won't parse it. The error is: unexpected token '(' I think its complaining about the first paren in the consequent, before "likes"

<IsRivalSWRLRule.jpeg>


On Wed, May 10, 2017 at 11:40 AM, Adila Alfa Krisnadhi <[hidden email]> wrote:
The rule:
is_rival_of(x,y) -> \exists z (likes(x,z) and likes(y,z))

is similar to property chain, but the chain is implied (unlike OWL property chain where the chain is on the antecedent part of the axiom).

As far as I know, the above rule cannot be expressed in OWL.

If one of x and y is given explicitly as a named individual, then we can have the following axiom:

is_rival_of some { peter }  SubClassOf: likes some ( inverse(likes) some { peter } )  

which reads as “anyone who is a rival of Peter likes someone who is liked by Peter”

Alternatively,

inverse(is_rival_of) some { John } SubClassOf: likes some ( inverse(likes) some { John } )

which reads as “anyone for whom John is a rival like someone who is liked by John.


—adila



On May 10, 2017, at 7:19 AM, Paulo Urbano <[hidden email]> wrote:

Ok thanks 

But this way I will need a rule specific for each pair of rivals... which is a clear limitation.

I was wandering how we could design a more abstract rule for any pair (?x,?y) where you have ?x is_rival_of ?y.

is_rival_of(?x,?y) ->  (...)

But I understand the limitations of SWRL....

I cannot have  the class (inverse(likes) value ?x) inside a rule...  The class of entities that ?x likes


Very best
Paulo




2017-05-09 1:30 GMT+01:00 Igor Toujilov <[hidden email]>:

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 
 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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


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

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




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

Re: Is there a way to express that a class is not empty, in Protégé?

samsontu
In reply to this post by Adila Alfa Krisnadhi
Using SWRLTab Extension Library’s swirl:makeOWLThing predicate [1], the general rule can be written as:

isRivalOf(?x, ?y) ^ swrlx:makeOWLThing(?likedPerson, ?x, ?y) -> likes(?x, ?likedPerson) ^ likes(?y, ?likedPerson)

For each binding of ?x and ?y, the extension generates an individual bound to ?likedPerson.  


With best regards,
Samson

[1] https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary


On May 10, 2017, at 11:40 AM, Adila Alfa Krisnadhi <[hidden email]> wrote:

The rule:
is_rival_of(x,y) -> \exists z (likes(x,z) and likes(y,z))

is similar to property chain, but the chain is implied (unlike OWL property chain where the chain is on the antecedent part of the axiom).

As far as I know, the above rule cannot be expressed in OWL.

If one of x and y is given explicitly as a named individual, then we can have the following axiom:

is_rival_of some { peter }  SubClassOf: likes some ( inverse(likes) some { peter } )  

which reads as “anyone who is a rival of Peter likes someone who is liked by Peter”

Alternatively,

inverse(is_rival_of) some { John } SubClassOf: likes some ( inverse(likes) some { John } )

which reads as “anyone for whom John is a rival like someone who is liked by John.


—adila



On May 10, 2017, at 7:19 AM, Paulo Urbano <[hidden email]> wrote:

Ok thanks 

But this way I will need a rule specific for each pair of rivals... which is a clear limitation.

I was wandering how we could design a more abstract rule for any pair (?x,?y) where you have ?x is_rival_of ?y.

is_rival_of(?x,?y) ->  (...)

But I understand the limitations of SWRL....

I cannot have  the class (inverse(likes) value ?x) inside a rule...  The class of entities that ?x likes


Very best
Paulo




2017-05-09 1:30 GMT+01:00 Igor Toujilov <[hidden email]>:

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 
 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University                                          fax: 1-650-725-7944




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

Re: Is there a way to express that a class is not empty, in Protégé?

Michael DeBellis-2
Samson, thanks for the tip about the Rule tab. I had no idea there was a difference. That is very helpful.

Michael

On Wed, May 10, 2017 at 12:30 PM, Samson Tu <[hidden email]> wrote:
Using SWRLTab Extension Library’s swirl:makeOWLThing predicate [1], the general rule can be written as:

isRivalOf(?x, ?y) ^ swrlx:makeOWLThing(?likedPerson, ?x, ?y) -> likes(?x, ?likedPerson) ^ likes(?y, ?likedPerson)

For each binding of ?x and ?y, the extension generates an individual bound to ?likedPerson.  


With best regards,
Samson

[1] https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary


On May 10, 2017, at 11:40 AM, Adila Alfa Krisnadhi <[hidden email]> wrote:

The rule:
is_rival_of(x,y) -> \exists z (likes(x,z) and likes(y,z))

is similar to property chain, but the chain is implied (unlike OWL property chain where the chain is on the antecedent part of the axiom).

As far as I know, the above rule cannot be expressed in OWL.

If one of x and y is given explicitly as a named individual, then we can have the following axiom:

is_rival_of some { peter }  SubClassOf: likes some ( inverse(likes) some { peter } )  

which reads as “anyone who is a rival of Peter likes someone who is liked by Peter”

Alternatively,

inverse(is_rival_of) some { John } SubClassOf: likes some ( inverse(likes) some { John } )

which reads as “anyone for whom John is a rival like someone who is liked by John.


—adila



On May 10, 2017, at 7:19 AM, Paulo Urbano <[hidden email]> wrote:

Ok thanks 

But this way I will need a rule specific for each pair of rivals... which is a clear limitation.

I was wandering how we could design a more abstract rule for any pair (?x,?y) where you have ?x is_rival_of ?y.

is_rival_of(?x,?y) ->  (...)

But I understand the limitations of SWRL....

I cannot have  the class (inverse(likes) value ?x) inside a rule...  The class of entities that ?x likes


Very best
Paulo




2017-05-09 1:30 GMT+01:00 Igor Toujilov <[hidden email]>:

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 
 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: <a href="tel:(650)%20725-3391" value="+16507253391" target="_blank">1-650-725-3391
Stanford University                                          fax: <a href="tel:(650)%20725-7944" value="+16507257944" target="_blank">1-650-725-7944




_______________________________________________
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
|  
Report Content as Inappropriate

Re: Is there a way to express that a class is not empty, in Protégé?

samsontu
Another difference is that when you use Pellet to run rules written in the Rule tab, rule-based reasoning and DL reasoning are integrated. SWRLTab provides rule-based reasoning separate from DL reasoning. Nevertheless, the SWRLTab supports some nifty extensions (e.g., swrlx:makeOWLThing) not available in the generic SWRL/DL reasoner. 

With best regards,
Samson
On May 10, 2017, at 12:58 PM, Michael DeBellis <[hidden email]> wrote:

Samson, thanks for the tip about the Rule tab. I had no idea there was a difference. That is very helpful.

Michael

On Wed, May 10, 2017 at 12:30 PM, Samson Tu <[hidden email]> wrote:
Using SWRLTab Extension Library’s swirl:makeOWLThing predicate [1], the general rule can be written as:

isRivalOf(?x, ?y) ^ swrlx:makeOWLThing(?likedPerson, ?x, ?y) -> likes(?x, ?likedPerson) ^ likes(?y, ?likedPerson)

For each binding of ?x and ?y, the extension generates an individual bound to ?likedPerson.  

<PastedGraphic-3.png>

With best regards,
Samson

[1] https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary


On May 10, 2017, at 11:40 AM, Adila Alfa Krisnadhi <[hidden email]> wrote:

The rule:
is_rival_of(x,y) -> \exists z (likes(x,z) and likes(y,z))

is similar to property chain, but the chain is implied (unlike OWL property chain where the chain is on the antecedent part of the axiom).

As far as I know, the above rule cannot be expressed in OWL.

If one of x and y is given explicitly as a named individual, then we can have the following axiom:

is_rival_of some { peter }  SubClassOf: likes some ( inverse(likes) some { peter } )  

which reads as “anyone who is a rival of Peter likes someone who is liked by Peter”

Alternatively,

inverse(is_rival_of) some { John } SubClassOf: likes some ( inverse(likes) some { John } )

which reads as “anyone for whom John is a rival like someone who is liked by John.


—adila



On May 10, 2017, at 7:19 AM, Paulo Urbano <[hidden email]> wrote:

Ok thanks 

But this way I will need a rule specific for each pair of rivals... which is a clear limitation.

I was wandering how we could design a more abstract rule for any pair (?x,?y) where you have ?x is_rival_of ?y.

is_rival_of(?x,?y) ->  (...)

But I understand the limitations of SWRL....

I cannot have  the class (inverse(likes) value ?x) inside a rule...  The class of entities that ?x likes


Very best
Paulo




2017-05-09 1:30 GMT+01:00 Igor Toujilov <[hidden email]>:

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 
 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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

-- 
Samson Tu                                                      email: [hidden email]
Senior Research Engineer                              web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: <a href="tel:(650)%20725-3391" value="+16507253391" target="_blank" class="">1-650-725-3391
Stanford University                                          fax: <a href="tel:(650)%20725-7944" value="+16507257944" target="_blank" class="">1-650-725-7944




_______________________________________________
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
|  
Report Content as Inappropriate

Re: Is there a way to express that a class is not empty, in Protégé?

Csongor Nyulas
Administrator
In reply to this post by Adila Alfa Krisnadhi
Hi Paulo,

As Adila said, I don't think you can express in pure OWL exactly what you want to say. However, thinking more about the issue, I came up with two solutions using OWL property chains. Although these do not state exactly what you asked us to model, they are close enough, and there is a chance that they would correspond, in fact, better to reality, than what you were asking us to encode.

Please take a look at the visual representation of the two solutions (also encoded in the attached ontologies):



The first difference, which I took the liberty to make in my models, compared to what you asked us to implement, is to use a property called "inLoveWith" instead of "likes" to relate it to "isRivalOf". I found the "likes" relationship too general. In real life people like many different individuals, and two people liking the same individual does not make them rivals. Neither saying that two rivals would have at least one person that both of them like is strong enough. Rather, in reality, I think that two rivals would have very strong feelings towards (e.g. being in love with), or interest in, a third person. Of course "inLoveWith" could very well made a sub-property of "likes".

Model A tries to make the property isRivalOf a subproperty of the "inLoveWith o inverse(inLoveWith)" property chain, which (the only way it) can be rewritten in OWL as "isRivalOf o inLoveWith SubPropertyOf: inLoveWith". Model B reverses the sub-property relationships, making "inLoveWith o inverse(inLoveWith) SubPropertyOf: isRivalOf".

Model A is closer to what you originally asked us to model, but I think model B is closer to reality (and would lead to more useful inferences, depending on what object property assertions do you have in your ontology).

The difference between model A and what you asked us to do, is that making isRivalOf a subproperty of "inLoveWith o inverse(inLoveWith)", does not encode the abstract fact that given an isRivalOf relationship between two individual a(t least one) third individual (which, given the OWA, may not even be in the ontology!) must exist that they both are "inLoveWith". Instead it encodes the fact that knowing that if a person (e.g. Peter) has a rival (e.g. John), and one of them is in love with another person (e.g. Mary), we can infer that the other one is also in love with that person. This makes sense, especially if a person is in love with only one person at a time, which is usually the case in real life. We did not formally encoded this assumption (i.e. we did not make inLoveWith functional), because the reasoners were unable to deal with it.

Model B, on the other hand, will try to infer the existing isRivalOf relationships based on existing inLoveWith relations. Conform to this model, if a person (e.g. Mary) is loved by two people (John and Max), then those two people will be inferred to be rivals. This seems to me like a more realistic model.
 
Note that in both models I made isRivalOf property symmetric.
If you try out the attached OWL ontologies and run the reasoner over them, you will also notice that from model B the reasoner will infer that anyone who has an inLoveWith relationship to another individual, will have an isRivalOf relationship to itself (e.g. Max isRivalOf Max), which could be easily eliminated by making the isRivalOf relationship irreflexive, but unfortunately doing that would make the reasoners unable to reason over the model. So, those reflexive relationship inferences should be ignored, and they are not shown in the graph below, which illustrates what type of inferences can be made from the different approaches:


I hope this is helpful.

Csongor




On 05/10/2017 11:40 AM, Adila Alfa Krisnadhi wrote:
The rule:
is_rival_of(x,y) -> \exists z (likes(x,z) and likes(y,z))

is similar to property chain, but the chain is implied (unlike OWL property chain where the chain is on the antecedent part of the axiom).

As far as I know, the above rule cannot be expressed in OWL.

If one of x and y is given explicitly as a named individual, then we can have the following axiom:

is_rival_of some { peter }  SubClassOf: likes some ( inverse(likes) some { peter } )  

which reads as “anyone who is a rival of Peter likes someone who is liked by Peter”

Alternatively,

inverse(is_rival_of) some { John } SubClassOf: likes some ( inverse(likes) some { John } )

which reads as “anyone for whom John is a rival like someone who is liked by John.


—adila



On May 10, 2017, at 7:19 AM, Paulo Urbano <[hidden email]> wrote:

Ok thanks 

But this way I will need a rule specific for each pair of rivals... which is a clear limitation.

I was wandering how we could design a more abstract rule for any pair (?x,?y) where you have ?x is_rival_of ?y.

is_rival_of(?x,?y) ->  (...)

But I understand the limitations of SWRL....

I cannot have  the class (inverse(likes) value ?x) inside a rule...  The class of entities that ?x likes


Very best
Paulo




2017-05-09 1:30 GMT+01:00 Igor Toujilov <[hidden email]>:

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 
 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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


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

rivalsA.owl (6K) Download Attachment
rivalsB.owl (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Is there a way to express that a class is not empty, in Protégé?

Paulo Urbano
Thanks for the many modelling suggestions and insights received...

Very Best
Paulo

2017-05-11 10:56 GMT+01:00 Csongor Nyulas <[hidden email]>:
Hi Paulo,

As Adila said, I don't think you can express in pure OWL exactly what you want to say. However, thinking more about the issue, I came up with two solutions using OWL property chains. Although these do not state exactly what you asked us to model, they are close enough, and there is a chance that they would correspond, in fact, better to reality, than what you were asking us to encode.

Please take a look at the visual representation of the two solutions (also encoded in the attached ontologies):



The first difference, which I took the liberty to make in my models, compared to what you asked us to implement, is to use a property called "inLoveWith" instead of "likes" to relate it to "isRivalOf". I found the "likes" relationship too general. In real life people like many different individuals, and two people liking the same individual does not make them rivals. Neither saying that two rivals would have at least one person that both of them like is strong enough. Rather, in reality, I think that two rivals would have very strong feelings towards (e.g. being in love with), or interest in, a third person. Of course "inLoveWith" could very well made a sub-property of "likes".

Model A tries to make the property isRivalOf a subproperty of the "inLoveWith o inverse(inLoveWith)" property chain, which (the only way it) can be rewritten in OWL as "isRivalOf o inLoveWith SubPropertyOf: inLoveWith". Model B reverses the sub-property relationships, making "inLoveWith o inverse(inLoveWith) SubPropertyOf: isRivalOf".

Model A is closer to what you originally asked us to model, but I think model B is closer to reality (and would lead to more useful inferences, depending on what object property assertions do you have in your ontology).

The difference between model A and what you asked us to do, is that making isRivalOf a subproperty of "inLoveWith o inverse(inLoveWith)", does not encode the abstract fact that given an isRivalOf relationship between two individual a(t least one) third individual (which, given the OWA, may not even be in the ontology!) must exist that they both are "inLoveWith". Instead it encodes the fact that knowing that if a person (e.g. Peter) has a rival (e.g. John), and one of them is in love with another person (e.g. Mary), we can infer that the other one is also in love with that person. This makes sense, especially if a person is in love with only one person at a time, which is usually the case in real life. We did not formally encoded this assumption (i.e. we did not make inLoveWith functional), because the reasoners were unable to deal with it.

Model B, on the other hand, will try to infer the existing isRivalOf relationships based on existing inLoveWith relations. Conform to this model, if a person (e.g. Mary) is loved by two people (John and Max), then those two people will be inferred to be rivals. This seems to me like a more realistic model.
 
Note that in both models I made isRivalOf property symmetric.
If you try out the attached OWL ontologies and run the reasoner over them, you will also notice that from model B the reasoner will infer that anyone who has an inLoveWith relationship to another individual, will have an isRivalOf relationship to itself (e.g. Max isRivalOf Max), which could be easily eliminated by making the isRivalOf relationship irreflexive, but unfortunately doing that would make the reasoners unable to reason over the model. So, those reflexive relationship inferences should be ignored, and they are not shown in the graph below, which illustrates what type of inferences can be made from the different approaches:


I hope this is helpful.

Csongor




On 05/10/2017 11:40 AM, Adila Alfa Krisnadhi wrote:
The rule:
is_rival_of(x,y) -> \exists z (likes(x,z) and likes(y,z))

is similar to property chain, but the chain is implied (unlike OWL property chain where the chain is on the antecedent part of the axiom).

As far as I know, the above rule cannot be expressed in OWL.

If one of x and y is given explicitly as a named individual, then we can have the following axiom:

is_rival_of some { peter }  SubClassOf: likes some ( inverse(likes) some { peter } )  

which reads as “anyone who is a rival of Peter likes someone who is liked by Peter”

Alternatively,

inverse(is_rival_of) some { John } SubClassOf: likes some ( inverse(likes) some { John } )

which reads as “anyone for whom John is a rival like someone who is liked by John.


—adila



On May 10, 2017, at 7:19 AM, Paulo Urbano <[hidden email]> wrote:

Ok thanks 

But this way I will need a rule specific for each pair of rivals... which is a clear limitation.

I was wandering how we could design a more abstract rule for any pair (?x,?y) where you have ?x is_rival_of ?y.

is_rival_of(?x,?y) ->  (...)

But I understand the limitations of SWRL....

I cannot have  the class (inverse(likes) value ?x) inside a rule...  The class of entities that ?x likes


Very best
Paulo




2017-05-09 1:30 GMT+01:00 Igor Toujilov <[hidden email]>:

Hi Paulo,

If I change slightly the property naming according to my preferences, it looks like

 

is_rival_of(John, Peter) -> (likes some ( inverse (likes) value Peter))(John)

 

Cheers,

Igor

 
 
 
Sent: Monday, May 08, 2017 at 1:02 PM
From: "Paulo Urbano" <[hidden email]>
To: "User support for WebProtege and Protege Desktop" <[hidden email]>
Subject: [protege-user] Is there a way to express that a class is not empty, in Protégé?
Hi´
 
Imagine that I want to infer from the property isRival relating two individuals that if
 
John isRival Peter
 
than 
 
 
There is someone that John Likes that Peter also likes,
 
supposing that likes is also na objectProperty.
 
I would want to express something like:
 
The intersection between the class composed by the individuals that John likes and class with the individuals that Peter likes is not empty.
 
How do I say in Protégé and at the right side of an SWRL rule that a certain class is not equivalent to OWL:Nothing? 
 
rival(?p1,?p2) -> {there is someone that both like}
 
Best
Paulo Urbano
_______________________________________________ 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


_______________________________________________
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
Loading...