Goood afternoon,
I have one problem with the usage of the onto.search() method for my small ontology.
Maybe the solution is trivial as usual in my case :-), but this method works differently for almost the same thing in my ontology.
Problem description in more details:
-------------------------------------------
Fragment of my ontology:
...
- AutoimmuneDisease
- LocalImmuneDisease
- DermatologicAutoimmuneDisease
- ...
- OrganLocalisedAutoimmuneDisease
- SystemicAutoimmuneDisease
- System
- BiomedicalSystem
- Derma
- EndocrineSystem
- ...
...
I would like to print all subclasses of the System class from my ontology. I created the following piece of code:
---------------------------------
from owlready2 import *
onto = get_ontology("g:\Vyzkum\Ontologie\OntoProgramovani\OWLReady2\AD-OWLOntology-extension01-rdf-xml.owl").load()
systemList = onto.search(subclass_of=onto.System)
print(systemList) Result: Everything seems well, because all of the direct subclasses and subclasses of these subclasses are printed.
---------------------------------
The problem is that I would like to do the same for the autoimmune diseases. I would like to print all of the subclasses of the AutoimmuneDisease class. I created the following pieces of code:
---------------------------------
from owlready2 import *
onto = get_ontology("g:\Vyzkum\Ontologie\OntoProgramovani\OWLReady2\AD-OWLOntology-extension01-rdf-xml.owl").load()
adList = onto.search(subclass_of=onto.AutoimmuneDisease)
print(adList)Result:
Only direct subclasses of the AutoimmuneDisease class (Local..., Organ..., Systemic...) are printed and I do not know why :-(((
---------------------------------
I am sending my ontology with this message and I would be really really happy for any help form you :-)
I am using the Owlready2-0.9.dist-info.
AD-OWLOntology-extension01-rdf-xml.owlMany greetings and best regards,
Martina