NetworkX

Previous topic

relabel_gexf_graph

Next topic

write_gexf

read_gexf

read_gexf(path, node_type=<type 'str'>, relabel=False, version='1.1draft')[source]

Read graph in GEXF format from path.

“GEXF (Graph Exchange XML Format) is a language for describing complex networks structures, their associated data and dynamics” [R248].

Parameters :

path : file or string

File or filename to write. Filenames ending in .gz or .bz2 will be compressed.

node_type: Python type (default: str) :

Convert node ids to this type

relabel : bool (default: False)

If True relabel the nodes to use the GEXF node “label” attribute instead of the node “id” attribute as the NetworkX node label.

Returns :

graph: NetworkX graph :

If no parallel edges are found a Graph or DiGraph is returned. Otherwise a MultiGraph or MultiDiGraph is returned.

Notes

This implementation does not support mixed graphs (directed and unidirected edges together).

References

[R248](1, 2) GEXF graph format, http://gexf.net/format/