Yog.IO.GEXF (YogEx v0.97.1)

Copy Markdown View Source

GEXF (Graph Exchange XML Format) serialization support.

Provides functions to serialize and deserialize graphs in GEXF format, the native format of Gephi and supported by many other graph visualization tools.

GEXF is an XML-based format that supports:

  • Nodes with typed attributes
  • Edges with typed attributes and weights
  • Directed and undirected graphs
  • Visual attributes (viz namespace): color, size, position
  • Dynamic graphs (not yet supported)

Performance

Uses Saxy for fast streaming SAX parsing when available (same as GraphML). Falls back to :xmerl otherwise.

Summary

Functions

Returns default GEXF serialization options.

Deserializes a GEXF string to a graph using default conversion.

Deserializes a GEXF string into a graph with custom data mappers.

Creates GEXF options with custom formatters.

Reads a graph from a GEXF file using default conversion.

Reads a graph from a GEXF file with custom data mappers.

Serializes a graph to GEXF format using default attribute conversion.

Serializes a graph to GEXF format with custom attribute mappers.

Serializes a graph to GEXF format with custom attribute mappers and options.

Writes a graph to a GEXF file using default attribute conversion.

Writes a graph to a GEXF file with custom attribute mappers.

Functions

default_options()

Returns default GEXF serialization options.

The options control data formatting:

  • node_formatter: Function to convert node IDs to strings (default: safe_string/1)
  • edge_formatter: Function to convert edge IDs to strings (default: safe_string/1)

deserialize(xml)

Deserializes a GEXF string to a graph using default conversion.

deserialize_with(node_folder, edge_folder, xml)

Deserializes a GEXF string into a graph with custom data mappers.

options_with(node_fmt, edge_fmt)

Creates GEXF options with custom formatters.

read(path)

Reads a graph from a GEXF file using default conversion.

read_with(path, node_folder, edge_folder)

Reads a graph from a GEXF file with custom data mappers.

serialize(graph)

Serializes a graph to GEXF format using default attribute conversion.

serialize_with(node_attr, edge_attr, graph)

Serializes a graph to GEXF format with custom attribute mappers.

serialize_with_options(node_attr, edge_attr, options, graph)

Serializes a graph to GEXF format with custom attribute mappers and options.

write(path, graph)

Writes a graph to a GEXF file using default attribute conversion.

write_with(path, node_attr, edge_attr, graph)

Writes a graph to a GEXF file with custom attribute mappers.