I have written a simple module to store and manipulate an ontology which is provided in a flat file using Perl. For this, I use the Graph module which is excellent.
One issue I am having to deal with is how to store the textual definitions for the vertexes in the ontology. Each term has a small text description which I want to store and retrieve. At the moment, as Graph does not support this directly, I use an internal hash.
I was wondering, is there a more elegant way of having a single data structure to store both the ontology graph and the definitions/data associated with nodes?
The
Graphmodule allows you to attach attributes to the vertices and edges. Is that what you mean when you say you are currently using an internal hash? If not, perhaps this will help: