networkx 2.8.2 Pypi GitHub Homepage
Other Docs

"GML, the Graph Modelling Language, is our proposal for a portable file format for graphs. GML's key features are portability, simple syntax, extensibility and flexibility. A GML file consists of a hierarchical key-value lists. Graphs can be annotated with arbitrary data structures. The idea for a common file format was born at the GD'95; this proposal is the outcome of many discussions. GML is the standard file format in the Graphlet graph editor system. It has been overtaken and adapted by several other systems for drawing graphs."

GML files are stored using a 7-bit ASCII encoding with any extended ASCII characters (iso8859-1) appearing as HTML character entities. You will need to give some thought into how the exported data should interact with different languages and even different Python versions. Re-importing from gml is also a concern.

Without specifying a :None:None:`stringizer`/destringizer , the code is capable of writing :None:None:`int`/:None:None:`float`/:None:None:`str`/:None:None:`dict`/:None:None:`list` data as required by the GML specification. For writing other data types, and for reading data other than :None:None:`str` you need to explicitly supply a :None:None:`stringizer`/destringizer .

For additional documentation on the GML file format, please see the GML website.

Several example graphs in GML format may be found on Mark Newman's Network data page.

Read graphs in GML format.

Read graphs in GML format.

"GML, the Graph Modelling Language, is our proposal for a portable file format for graphs. GML's key features are portability, simple syntax, extensibility and flexibility. A GML file consists of a hierarchical key-value lists. Graphs can be annotated with arbitrary data structures. The idea for a common file format was born at the GD'95; this proposal is the outcome of many discussions. GML is the standard file format in the Graphlet graph editor system. It has been overtaken and adapted by several other systems for drawing graphs."

GML files are stored using a 7-bit ASCII encoding with any extended ASCII characters (iso8859-1) appearing as HTML character entities. You will need to give some thought into how the exported data should interact with different languages and even different Python versions. Re-importing from gml is also a concern.

Without specifying a :None:None:`stringizer`/destringizer , the code is capable of writing :None:None:`int`/:None:None:`float`/:None:None:`str`/:None:None:`dict`/:None:None:`list` data as required by the GML specification. For writing other data types, and for reading data other than :None:None:`str` you need to explicitly supply a :None:None:`stringizer`/destringizer .

For additional documentation on the GML file format, please see the GML website.

Several example graphs in GML format may be found on Mark Newman's Network data page.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/readwrite/gml.py#0
type: <class 'module'>
Commit: