related-sciences / nxontology-data

NXOntology data: making ontologies accessible as simple JSON files
Other
10 stars 3 forks source link

MeSH vocabulary subclass graph #9

Closed dhimmel closed 1 year ago

dhimmel commented 1 year ago

Here's a display of the vocabulary subclass graph from 2022 MeSH:

image

Code to create it:

from nxontology_data.mesh.mesh import MeshLoader
from IPython.display import Image
from networkx.drawing.nx_agraph import to_agraph

vocab = MeshLoader.create_vocab_digraph(rdf)
gviz = to_agraph(vocab)
gviz.layout("dot")
Image(gviz.draw(format="png"))

Code requires pygraphviz which requires graphviz, which ends up being a problematic dependency on CI: failed on the self-hosted runner. So just posting this visualization in a GitHub issue and will remove pygraphviz from CI.

dhimmel commented 1 year ago

Data also at https://hhs.github.io/meshrdf/super-classes