Login  Register

Ontology tree

Posted by Tomáš Müller on Jun 25, 2019; 7:37am
URL: http://owlready.306.s1.nabble.com/Ontology-tree-tp1178.html

Hi,

I'm trying to use owlready2 for quite simple task - build ontology class tree and let users pick classes. I already done it with Ontobio library but I like the sqlite concept very much for I might use some really big ontologies (in terms of million classes).

I'm finding hard to navigate in the model since the Docs are more focused on creation and analysis and ipython introspection doesn't work out very well here.

What I'd like to do:
1) Let's Bioassay Ontology for example - it's composed of maybe 20 or so other ontologies
http://www.bioassayontology.org/bao/bao_complete.owl

2) I need to get the root classes i.e. classes with no parents (or just the owl.Thing parent) and some children (to exclude singletons)

3) For each class I need to get relations - parents, ancestors, children, descendants

4) For a class I need to get all related data - properties. I already found the 'get_class_properties' method, that should do what I need

The result should look like this https://bioportal.bioontology.org/ontologies/BAO/?p=classes&conceptid=root
But better off course :-)

Thanks in advance