Inheritable properties between classes

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

Inheritable properties between classes

scuberog

Hi. I'm using desktop protege, and actually i'm very noob, so forgive me if i'm asking for an absurd.

 

I'm creating a Food Ontology, and I wan to implement a property for a class which can be heritable in the following subclasses. For example: I have a class called, Animal meet, and I want to create a property called "Animal origin" and I want that all subclasses, like chicken meat, cow meat, pork meat, have this same property.

 

Is there some option to do heritable the property or have I to create the same property in every subclasses?

 

Thanks a lot for you patience.

 

Enviado desde Correo para Windows 10

 


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

Re: Inheritable properties between classes

Paulo Urbano
Dear Salvador 
I think you should simply declare the domain of "animalOrigin" object property with the class "AnimalMeat"...


Best
Paulo Urbano


2018-06-04 11:35 GMT+01:00 Salvador Cubero Gonz?lez <[hidden email]>:

Hi. I'm using desktop protege, and actually i'm very noob, so forgive me if i'm asking for an absurd.

 

I'm creating a Food Ontology, and I wan to implement a property for a class which can be heritable in the following subclasses. For example: I have a class called, Animal meet, and I want to create a property called "Animal origin" and I want that all subclasses, like chicken meat, cow meat, pork meat, have this same property.

 

Is there some option to do heritable the property or have I to create the same property in every subclasses?

 

Thanks a lot for you patience.

 

Enviado desde Correo para Windows 10

 


_______________________________________________
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: Inheritable properties between classes

Michael DeBellis-2
In reply to this post by scuberog
Salvador, It sounds like you may be coming from the background of an object-oriented programmer, so the first thing to remember is that classes and objects in OWL (which of course is the language that Protege is editing) are very much like traditional object-oriented programming in many ways but there are some subtle differences. If you are familiar at all with set theory the easiest thing to do is to always try to think in terms of sets and subsets (classes and subclasses) and relations (properties). Standard OOP also more or less follows this kind of semantics but not rigorously where as in OWL there is a direct map to set theoretic constructs. 

So much for theory, the most important practical difference between OWL classes and OO classes is that in standard OOP properties always have to be associated with some class. That's not the case with properties in OWL. Like relations in set theory properties themselves are first class things that can exist independent of classes. 

It's possible to not declare the domain and/or range of a property in OWL.  Whether you declare the domain and range depends a lot on how you want the ontology to be used.  I usually do declare the domain and range but others often don't. When you declare the domain of a property that is essentially the same as defining the property to be associated with that class in OOP.  So if I have a property called hasFather and I say the domain of hasFather is the class Animal then it is legal to assert values for hasFather to any instance of Animal as well as all subclasses of Animal such as Mammal, Primate, Human, etc. 

If I'm understanding your question correctly, this is the behavior you want anyway. So if you define a class called AnimalOrigin and then define properties with domain of AnimalOrigin all subclasses of AnimalOrigin will "have" those same properties (which in OWL just means it will be legal to assert values for that property for any instance of AnimalOrigin or any of it's subclasses). 

Here is a good white paper on the similarities and differences between standard OOP and Semantic Web (OWL) objects:


Hope that helps.

Michael

On Mon, Jun 4, 2018 at 3:35 AM, Salvador Cubero Gonz?lez <[hidden email]> wrote:

Hi. I'm using desktop protege, and actually i'm very noob, so forgive me if i'm asking for an absurd.

 

I'm creating a Food Ontology, and I wan to implement a property for a class which can be heritable in the following subclasses. For example: I have a class called, Animal meet, and I want to create a property called "Animal origin" and I want that all subclasses, like chicken meat, cow meat, pork meat, have this same property.

 

Is there some option to do heritable the property or have I to create the same property in every subclasses?

 

Thanks a lot for you patience.

 

Enviado desde Correo para Windows 10

 


_______________________________________________
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: Inheritable properties between classes

Matthew Horridge-2
Administrator
In reply to this post by scuberog
Hi,

Make AnimalMeat a subclass of the class expression “hasOrigin some AnimalOrigin”.  Any subclasses of AnimalMeat will also imply (inherit as you put it) having an AnimalOrigin, without saying anything else.  You can of course add more specific statements, like PorkMeat has an original that is a Pig, but if you don’t need this level of detail then leave it out.

I’ve attached an example ontology, so you can see how I’ve used different class expressions to model this.

Cheers,

Matthew



On 4 Jun 2018, at 03:35, Salvador Cubero Gonz?lez <[hidden email]> wrote:

Hi. I'm using desktop protege, and actually i'm very noob, so forgive me if i'm asking for an absurd.
 
I'm creating a Food Ontology, and I wan to implement a property for a class which can be heritable in the following subclasses. For example: I have a class called, Animal meet, and I want to create a property called "Animal origin" and I want that all subclasses, like chicken meat, cow meat, pork meat, have this same property.
 
Is there some option to do heritable the property or have I to create the same property in every subclasses?
 
Thanks a lot for you patience.
 
Enviado desde Correo para Windows 10
 
_______________________________________________
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

food.owl (8K) Download Attachment