WOLFRAM LANGUAGE IMPORT/EXPORT FORMAT

Graphlet (.gml)

  • Import and Export fully support the Graphlet GML file format.

BackgroundBackground

    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 ExportImport and Export

  • Import["file.gml"] imports the graph stored in the specified file, given as a single Graph object.
  • Export["file.gml",expr] exports an adjacency matrix or edge information for one graph to the Graphlet GML format.
  • Import["file.gml",elem] imports the specified element from a Graphlet GML file.
  • Import["file.gml",{elem,suba,subb,}] imports a subelement.
  • Import["file.gml",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","Graphlet"] or Import["file",{"Graphlet",elem,}].
  • Export["file.gml",expr,elem] creates a Graphlet GML file by treating expr as specifying element elem.
  • Export["file.gml",{expr1,expr2,},{{elem1,elem2,}}] treats each as specifying the corresponding .
  • Export["file.gml",expr,opt1->val1,] exports expr with the specified option elements taken to have the specified values.
  • Export["file.gml",{elem1->expr1,elem2->expr2,},"Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the Graphlet GML file format.

ElementsElements

  • General Import elements:
  • "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.

OptionsOptions

ExamplesExamplesopen allclose all

Basic Examples  (7)Basic Examples  (7)

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]=
Introduced in 2010
(8.0)