This implementation does not support mixed graphs (directed and undirected
edges together).
The node id attribute is set to be the string of the node label.
If you want to specify an id use set it as node data, e.g.
node[‘a’][‘id’]=1 to set the id of node ‘a’ to 1.
“GEXF (Graph Exchange XML Format) is a language for describing
complex networks structures, their associated data and dynamics” [1]_.
Parameters:
path (file or string) – File or file name to read.
File names ending in .gz or .bz2 will be decompressed.
node_type (Python type (default: None)) – Convert node ids to this type if not None.
relabel (bool (default: False)) – If True relabel the nodes to use the GEXF node “label” attribute
instead of the node “id” attribute as the EasyGraph node label.
version (string (default: 1.2draft))
http (Version of GEFX File Format (see) – Supported values: “1.1draft”, “1.2draft”
Returns:
graph – If no parallel edges are found a Graph or DiGraph is returned.
Otherwise a MultiGraph or MultiDiGraph is returned.
Return type:
EasyGraph graph
Notes
This implementation does not support mixed graphs (directed and undirected
edges together).
Relabel graph using “label” node keyword for node label.
Parameters:
G (graph) – A EasyGraph graph read from GEXF data
Returns:
H – A EasyGraph graph with relabeled nodes
Return type:
graph
Raises:
EasyGraphError – If node labels are missing or not unique while relabel=True.
Notes
This function relabels the nodes in a EasyGraph graph with the
“label” attribute. It also handles relabeling the specific GEXF
node attributes “parents”, and “pid”.
“GEXF (Graph Exchange XML Format) is a language for describing
complex networks structures, their associated data and dynamics” [1]_.
Node attributes are checked according to the version of the GEXF
schemas used for parameters which are not user defined,
e.g. visualization ‘viz’ [2]_. See example for usage.
Parameters:
G (graph) – An EasyGraph graph
path (file or string) – File or file name to write.
File names ending in .gz or .bz2 will be compressed.
encoding (string (optional, default: 'utf-8')) – Encoding for text data.
prettyprint (bool (optional, default: True)) – If True use line breaks and indenting in output XML.
version (string (optional, default: '1.2draft')) – The version of GEXF to be used for nodes attributes checking