perl - Is there an elegant way to store an ontology graph and the definitions/data associated with nodes? -
i have written simple module store , manipulate ontology provided in flat file using perl. this, use graph module excellent.
one issue having deal how store textual definitions vertexes in ontology. each term has small text description want store , retrieve. @ moment, graph not support directly, use internal hash.
i wondering, there more elegant way of having single data structure store both ontology graph and definitions/data associated nodes?
the graph module allows attach attributes vertices , edges. mean when using internal hash? if not, perhaps help:
use graph; $g = graph->new;  ($v1, $v2) = qw(a b); $g->add_edge($v1, $v2);  $g->set_vertex_attribute($_, 'desc', "vertex $_") $v1, $v2; print $g->get_vertex_attribute($_, 'desc'), "\n"  $v1, $v2;      
Comments
Post a Comment