flowpipe
flowpipe copied to clipboard
export to graphml
@PaulSchweizer should I just add serialize_graphml and deserialize_graphml methods to the Graph class? I currently have this implemented in json so rewriting this to graphml will require little effort.
@Anton-4 , good idea! Yes, adding these two methods to the graph would be really good. It could look something like this maybe (just a quick idea):
<graph id="{graph.name}" edgedefault="directed">
<node id="{node1.identifier}"/>
<node id="{node2.identifier>"/>
<edge id="{node1.outputs[output_name].name}-{node2.inputs[input_name].name}" source="{node1.identifier}" target="{node2.identifier}"/>
</graph>
Not sure where to put the other attributes of the Node like "metadata", "class", "module" etc. but you'll find a way :D Thanks again!
I started working on this and thought: do we really need full serialization and deserialization or just exporting of graph, nodes and edges without attributes like metadata, class, module... ?
I mainly wanted to export to graphml to have a standardized format to feed into the visualizer. What was your intended use-case for full serialization and deserialization?
I see your point @Anton-4 but if we would fully serialize the graph like we currently do in json, we could use the graphml file to fully reconstruct the graph afterwards. Otherwise we would need to keep another (json) file for that purpose. If it is too much work though, we can start by only serializing as much as you need for visualizing the graph, it should be possible to extend the graphml serialization later.
I now found how I can cleanly add in nested xml. That issue was kind of holding me back. I will make it work :)
Amazing! Thanks @Anton-4
@Anton-4 I'm planning to put some time into flowpipe over the next weeks and am browsing through the backlog here, trying to get back into it and do some planning. Let me know if you're still working on this
I have not continued working in this. This did require some work to define the complex types as explained here. Feel free to continue working on the schema definition I started here.
Perfect! Thanks for the links and the work you put into this already! I'm going to put some time into this after the compound plugs are done