I am using Erlang's digraph module for storing Directed Acyclic Graphs (DAGs). So for argument's sake here is a super simple graph (using Elixir):
gr = :digraph.new()
:digraph.add_vertex(gr, "A")
:digraph.add_vertex(gr, "B")
:digraph.add_vertex(gr, "C")
:digraph.add_edge(gr, "A", "B")
:digraph.add_edge(gr, "A", "C")
which looks like this:
We can see it's all worked:
iex(7)> :digraph.vertices(gr)
["A", "C", "B"]
iex(8)> :digraph.edges(gr)
[[:"$e" | 0], [:"$e" | 1]]
iex(9)> :digraph.out_neighbours(gr, "A")
["C", "B"]
iex(10)> :digraph.out_neighbours(gr, "B")
[]
iex(11)> :digraph.out_neighbours(gr, "C")
[]
iex(12)> :digraph_utils.is_acyclic(gr)
true
Now I'm going to be adding and removing more vertices and edges, but I would like to transmit these graphs to applications outside of the Elixir/Erlang ecosystem such as Cytoscape.js. Is there a standardized way to serialize digraphs into some industry standard readable format (json or xml for example), such as JGF, Netlix's Falcor JSON Graph format, or other?
I could write my own serializer but I'd prefer something pre-existing. I can't find anything that does this in digraph or digraph_utils.