Dear Community,
I have a graph with several properties on nodes and edges but fail to save them to a standard format, for instance, GML. Here is minimal example:
#packages
using LightGraphs, MetaGraphs, GraphIO, ParserCombinator
#create graph
g = SimpleDiGraph(2)
add_edge!(g, 1, 2)
#create MetaDiGraph & set props
mg = MetaDiGraph( g )
set_props!( mg, 1, Dict(:name=>"sue", :weight=>50) )
set_props!( mg, 2, Dict(:name=>"bob", :weight=>70) )
set_prop!( mg, Edge(1,2), :relation, 2.5 )
#save graph
savegraph("mygraph.txt", mg, GMLFormat() )
The contents of mygraph.txt
is, however,
graph
[
label "graph"
directed 1
node
[
id 1
]
node
[
id 2
]
edge
[
source 1
target 2
]
]
I cannot figure out why the properties are not stored in the file. GML supports that according to the documentation.
I also tried GEXF in which also the properties are not saved to file.
Do you have any ideas how to fix that?
Thank you in advance!
Best regards, mike_k