Administrator
|
Hi,
Indeed, it seems that search() does not limit the search to the ontology.
If you want to restrict the search to a given ontology, you may use SPARQL with the GRAPH clause, which is supported in the latest version of Owlready.
If you do not want to restrict the search to any ontology, but to get all classes, you can use search(), SPARQL without the GRAPH clause, or default_world.classes() for listing all classes.
If you want to list all classes in an ontology and the corresponding imported ontologies, the best option is to code a recursive function that calls Ontology.classes() and then iterates over imported ontologies and call their .classes().
Jiba
|