# Metagraphs/GraphIO: How to save graph properties to file?

**URL:** <https://discourse.julialang.org/t/metagraphs-graphio-how-to-save-graph-properties-to-file/23553>\
**Category:** Graphs\
**Tags:** lightgraphs, metagraphs, graphs\
**Created:** [April 26, 2019, 12:30pm UTC](https://discourse.julialang.org/t/metagraphs-graphio-how-to-save-graph-properties-to-file/23553 "2019-04-26T12:30:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike\_k](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mike_k/32/211864_2.png) [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Post date:** [April 26, 2019, 12:30pm UTC](https://discourse.julialang.org/t/metagraphs-graphio-how-to-save-graph-properties-to-file/23553/1 "2019-04-26T12:30:34Z")

</div>

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:

```julia
#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,

```julia
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
