This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
MATHEMATICA IMPORT/EXPORT FORMAT|See Also »

Graphlet (.gml)

Graphlet GML graph data format.
Used for the storage and exchange of graphs.
GML is an acronym derived from Graph Modelling Language.
Native format of the Graphlet graph editor software.
Stores attributed, directed, and undirected graphs.
Can contain user-defined graph, edge, and vertex attributes.
ASCII format.
Developed in 1995.
  • Import and Export fully support the Graphlet GML file format.
  • Import imports the graph stored in the specified file, given as a single Graph object.
  • Export exports an adjacency matrix or edge information for one graph to the Graphlet GML format.
  • Import imports the specified element from a Graphlet GML file.
  • Import imports multiple elements.
  • Export creates a Graphlet GML file by treating expr as specifying element elem.
  • Export treats each as specifying the corresponding .
  • Export exports expr with the specified option elements taken to have the specified values.
  • Export uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
"Elements" list of elements and options available in this file
"Rules"full list of rules for each element and option
"Options"list of rules for options, properties, and settings
  • Data representation elements:
"AdjacencyMatrix"edge information, given as a matrix
"EdgeAttributes"edge attributes, represented as a list of rules
"EdgeRules"connectivity data for the graphs, given as a list of rules
"Graph"graph stored in the file, given as a Graph object
"GraphAttributes"graph attributes, represented as a list of rules
"Graphics"graph stored in the file, rendered as a graph plot
"VertexAttributes"vertex attributes, represented as a list of rules
"VertexCount"number of vertices in the graph
"VertexList"vertices, given as a list of strings
  • Import by default uses the element when importing from Graphlet GML.
ImageSizeAutomaticspecifies the overall size of the image to display for a graph
  • When importing from GML, all options supported by Graph can be given. Common settings include:
EdgeLabelsAutomaticlabels and label placement for edge
EdgeWeightAutomaticweight for edge
VertexCoordinatesAutomaticcenter coordinate for vertex
VertexLabelsAutomaticlabels and label placement for vertex
VertexShapeAutomaticgraphic shape for vertex
  • When importing as , all options supported by GraphPlot can be given. Common settings include:
DirectedEdgesAutomaticwhether to show edges as directed arrows
EdgeLabelingAutomaticwhether to include labels given for edges
EdgeRenderingFunctionAutomaticfunction to give explicit graphics for edges
VertexLabelingAutomaticwhether to show vertex names as labels
VertexRenderingFunctionAutomaticfunction to give explicit graphics for vertices
DirectedEdgesAutomaticwhether the data to be exported represents a directed graph
  • When exporting from edge rules or from a symmetric adjacency matrix, edges are taken to be undirected by default.
  • When exporting a Graph object, Mathematica graph attribute values are often exported as strings using Compress.
Import a graph from Graphlet GML, rendered as a Graph object:
Import a vertex list and vertex attributes:
Show vertex labels and arrowheads in the graph plot:
Export a Graph object to GML:
Export a list of edge rules representing a directed graph to GML:
Export an asymmetric adjacency matrix of the same graph represented in the above example to GML:
Render an adjacency matrix representation of a Graphlet GML graph as MatrixPlot:
Construct a list of vertex labels and their attributes in the form of rules:
Convert the first graph stored in a Sparse6 file to a Graphlet GML file:
Generate a Graphlet GML file from a list of edge rules and edge and graph attributes:
Export an adjacency matrix together with vertex labels and attributes:
Export a Graph object with a raster image as a label:
Import a graph from Graphlet GML, rendered as a Graph object:
In[1]:=
Click for copyable input
Out[1]=
 
Import a vertex list and vertex attributes:
In[1]:=
Click for copyable input
Out[1]=
 
Show vertex labels and arrowheads in the graph plot:
In[1]:=
Click for copyable input
Out[1]=
 
Export a Graph object to GML:
In[1]:=
Click for copyable input
Out[1]=
 
Export a list of edge rules representing a directed graph to GML:
In[1]:=
Click for copyable input
Out[1]=
 
Export an asymmetric adjacency matrix of the same graph represented in the above example to GML:
In[1]:=
Click for copyable input
Out[1]=
 
Render an adjacency matrix representation of a Graphlet GML graph as MatrixPlot:
In[1]:=
Click for copyable input
Out[1]=
Construct a list of vertex labels and their attributes in the form of rules:
In[1]:=
Click for copyable input
Out[1]=
 
Convert the first graph stored in a Sparse6 file to a Graphlet GML file:
In[1]:=
Click for copyable input
Out[1]=
 
Generate a Graphlet GML file from a list of edge rules and edge and graph attributes:
In[1]:=
Click for copyable input
Out[1]=
 
Export an adjacency matrix together with vertex labels and attributes:
In[1]:=
Click for copyable input
Out[1]=
 
Export a Graph object with a raster image as a label:
In[1]:=
Click for copyable input
Out[1]=