Read all the subclasses of a class in case of multi-inheritance

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

Read all the subclasses of a class in case of multi-inheritance

claire
Hi,

I created an ontology with protégé in which some of the classes inherit from multiple classes. When I use class.subclasses() on the ancestor classes, only one of them returns the descendant class.

For instance, if Class A is a B and Class A is a C in my owl file (generated with Protégé 5),
A is in the list returned by B.subclasses(), but not in the one returned by C.subclasses()

I there something I am missing ?
Is multiple inheritance managed ?

Thanks for your help,

Claire
Reply | Threaded
Open this post in threaded view
|

Re: Read all the subclasses of a class in case of multi-inheritance

William
Hi ~

The reason may be that
Protégé 5 is written by Java, while Java dose not support multiple inheritance.
Reply | Threaded
Open this post in threaded view
|

Re: Read all the subclasses of a class in case of multi-inheritance

Jiba
Administrator
In reply to this post by claire
Hi,

Multiple inheritance is supported.

I tried to reproduce the problem, but in vain. I suspect that the problem may be in your ontology or your Python script; could you send them to me so I can try to reproduce the problem ?

William: Protégé is written in Java, but it does not use the "ontology-oriented paradigm", so it is not limited by the Java language restriction.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Read all the subclasses of a class in case of multi-inheritance

claire
Hi,

Thank you all for your answers.

I reduced my code again and again and it seems OK now with a very small ontology. I think that there is something weird when I save the Protégé ontology. Sometimes it seems that the changes are not saved. So I'll look into Protégé rather than into Owlready.

Thanks again for your help and for this really nice library !

Claire