I'm trying to read a GraphML file containing a single directed Graph into a Haskell Data.Graph
in order to run an analysis using the Math.Combinatorics.Graph
module.
However, I can't find any module that allows me to read a GraphML file, producing a Data.Graph
. One related module I found is ForSyDe.Backend.GraphML
. However, this seems to be specific to the ForSyDe
DSL and I currently can't think of a way to use it to read a plain Data.Graph
.
Could you point me to a library allowing me to read GraphML, preferably with some example code on how to use it?
After more than a week of searching, I assume there is currently no GraphML parser library in existence. Therefore I wrote my own minimal parser.
Let's assume we have this GraphML:
I created this HXT-based parser that's able to parse a minimal subset of GraphML (just enough to create a
Data.Graph
of the above GraphML). Themain
function of the following file represents an example of how to use it: It prints the list of nodes in the graph (also see this related question ).