The result is
Traceback (most recent call last):
File "edgesProperties.py", line 18, in <module>
_edgeIds = g.edge_properties["_graphml_edge_id"]
File "/usr/lib/python2.7/site-packages/graph_tool/__init__.py", line 995,
in __getitem__
val = self.get_func(self.g, key)
File "/usr/lib/python2.7/site-packages/graph_tool/__init__.py", line
1469, in <lambda>
lambda g, k: g.__properties[("e", k)],
KeyError: ('e', '_graphml_edge_id')
And the network in graphml framework reads as
<edge id="1" source="65091" target="65221">
<data key="w">192.49624317</data>
</edge>
<node id="16071">
<data key="o">5.41539461304e-05</data>
<data key="d">2.03027821579e-05</data>
</node>
*Here is a minimal example :*
from graph_tool.all import *
g=load_graph('test.xml')
_vertexIds = g.vertex_properties["_graphml_vertex_id"]
_edgeIds = g.edge_properties["_graphml_edge_id"]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/graph_tool/__init__.py", line
1049, in __getitem__
val = self.get_func(self.g, key)
File "/usr/lib/python2.7/site-packages/graph_tool/__init__.py", line
1542, in <lambda>
lambda g, k: g.__properties[("e", k)],
KeyError: ('e', '_graphml_edge_id')
g.list_properties()
destination (vertex) (type: long double)
origin (vertex) (type: long double)
_graphml_vertex_id (vertex) (type: string)
name (edge) (type: int32_t)
weight (edge) (type: long double)
I found a funny fact. If I load twice the network, then I can see the edge
ids!
[Flavien(a)localhost tmp]$ ipython
Python 2.7.5 (default, Jun 25 2014, 10:19:55)
Type "copyright", "credits" or "license" for more information.
IPython 2.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import graph_tool as gt
In [2]: g = gt.load_graph('test.xml')
In [3]: g.list_properties()
_graphml_vertex_id (vertex) (type: string)