graph_reader(source, node_type=<function id_node>, value_type=<function true_namespace_value>)¶
Read a graph from GraphML
Since a GraphML file may contain multiple graphs, an iterable over all contained graphs is returned.
# read a single graph graph, = graph_reader(source_path) # read several graphs graphs = list(graph_reader(source_path)) # stream through graphs for graph in graph_reader(source_path): ...
value_typeare used to convert the GraphML-specific
GraphMLEdgeto generic nodes and edge values. As edges are defined by nodes, there is no separate converter.
Create nodes from their