-
Notifications
You must be signed in to change notification settings - Fork 9
Input Output
nlacasse edited this page Dec 12, 2012
·
4 revisions
Hermes allows you to read and write graphs from files.
The following graph serilization formats are supported:
Graphs can be written in any format. All you need is a filename to write to.
For graphs with types, graphSON is recommended because it can serialize the type information along with the actual graph (see below).
Note that writing a graph to a file is only supported for in-memory graphs.
Include type information in serilized graph (produces larger file, but necessary if your graph has types):
(io/write-graph-graphson "filename.graphson" true)
Do not include type information:
(io/write-graph-graphson "filename.graphson")
(io/write-graph-gml "filename.gml")
(io/write-graph-gml "filename.graphml")
Loading graphs works the same for all formats. A filename is specified, and the graph is read from the file and added to hermes/*graph*
(which does not need to be empty).
(io/load-graph-graphson "filename.graphson")
(io/load-graph-gml "filename.gml")
(io/load-graph-gml "filename.graphml")