Is there a way to create a graph from an ontology file using Graph-tool library in Python?
I've done some research and what I've found is:
- Graph Tool doesn't support .owl and .rdf files.
- There is no obvious way to convert an ontology to a graph using this library, as far as I know (I hope I missed something that someone here knows about).
What I have tried:
I had the idea of converting OWL ontologies and OBO to a NetworkX Graph then to a Graph-tool graph (because all of my previous work was done with Graph-tool).
Method 1: Used onto2nx library.
Problems:
- Really slow at loading ontologies and it stops half way.
- Isn't documented at all so I couldn't even get an idea on how it works even after checking the source code (The person who created it was notified but didn't reply).
Method 2: Used RDFLib library.
I've based my solution no this answer but:
Problems:
- The method to store the networkx ontology graph in a GraphML file doesn't support the mixed graphs (directed and unidirected edges together) which is exactly what I need.