Network ontology with networkx