JGF - Maple Help

JGF (.jgf) Graph Format

JGF file format

Description

 • JGF (JSON Graph Format) is a JSON-based file format for storing one or more graphs.
 • It also allows the application of labels to vertices and edges.
 • The format supports directed and undirected graphs, and permits the association of arbitrary metadata with vertices and edges.
 • The GraphTheory[ImportGraph] and GraphTheory[ExportGraph] commands can read from and write to this format.
 • The general-purpose commands Import and Export also support this format.

Examples

Import a JGF displaying the relationships of various mammal species.

 > $\mathrm{Mammals}≔\mathrm{Import}\left("example/mammals.jgf",\mathrm{base}=\mathrm{datadir}\right)$
 ${\mathrm{Mammals}}{≔}{\mathrm{Graph 1: a directed unweighted graph with 18 vertices and 17 arc\left(s\right)}}$ (1)
 > $\mathrm{GraphTheory}:-\mathrm{DrawGraph}\left(\mathrm{Mammals},\mathrm{style}=\mathrm{spring}\right)$

Export the Clebsch graph to a JGF file in the home directory of the current user.

 > $\mathrm{CG}≔\mathrm{GraphTheory}:-\mathrm{SpecialGraphs}:-\mathrm{ClebschGraph}\left(\right)$
 ${\mathrm{CG}}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 16 vertices and 40 edge\left(s\right)}}$ (2)
 > $\mathrm{Export}\left("clebsch.jgf",\mathrm{CG},\mathrm{base}=\mathrm{homedir}\right)$
 ${2516}$ (3)

References

 JSON Graph Format Specification, http://jsongraphformat.info/.