how to use a python object saved in a graph property map
Hello, I have the following code: sortedEdges = [] g = Graph() g.graph_properties["sortedEdges"] = self._graph.new_graph_property("object", sortedEdges) then I fill the sortedEdges list with the appropriate values and return g. Now, how can I get the list of sorted edges from g? I'm also saving a dictionary that uses the names of the vertices as keys and the graph vertices as values in a internal graph property map; so, in general, I want to learn how to use any python object after it is saved as graph_property Thanks, -- Héctor Urbina S. Ingeniero en Bioinformática Fono: 82049138
On 06/01/2012 01:45 AM, Héctor Urbina wrote:
I have the following code:
sortedEdges = [] g = Graph() g.graph_properties["sortedEdges"] = self._graph.new_graph_property("object", sortedEdges)
then I fill the sortedEdges list with the appropriate values and return g. Now, how can I get the list of sorted edges from g? I'm also saving a dictionary that uses the names of the vertices as keys and the graph vertices as values in a internal graph property map; so, in general, I want to learn how to use any python object after it is saved as graph_property
The syntax for graph properties is the same as for vertex or edge properties, i.e. you use the graph itself as a key. In your case it would be: g.graph_properties["sortedEdges"][g].append("foo") This would append the value "foo" to your list. Cheers, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (2)
-
Héctor Urbina -
Tiago de Paula Peixoto