Skip to content
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:

Writing Graphs

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.

GraphSON

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")

GML

(io/write-graph-gml "filename.gml")

GraphML

(io/write-graph-gml "filename.graphml")

Loading Graphs

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).

GraphSON

(io/load-graph-graphson "filename.graphson")

GML

(io/load-graph-gml "filename.gml")

GraphML

(io/load-graph-gml "filename.graphml")