WIP: GraphML MetaGraph support - #49
Conversation
|
I really have not looked much into it, but instead of creating a separate package called Another way would be to use Requires.jl, either here or on |
I though that currently we were searching for ways to get rid of Putting MetaGraphsIO functionality inside
I think this scales better but then the question is why does I think it will be the most modular solution to have MetaGraphsIO in a separate package. function __init__()
@require MetaGraphs="...." @reexport MetaGraphsIO
end
|
|
this functionality is transferred in NestedGraphsIO.jl. |
as mentioned in #47.
This PR enables support for
MetaGraphsinGraphMLformat.It follows the paradigm of http://graphml.graphdrawing.org/ to define attributes in the graph.
The following features are supported:
Dictof graphsAlthough it's functional, I marked it as WIP because I haven't really thought too much about performance and type-stability and more importantly I think some discussion is needed in advance.
Caveats
MetaGraphsEzXML.StreamReaderfor the reason that there needs to be some memory on the parser in order to remember whose are the properties readGraphIO.GraphMLand not fromGraphs. The reason is that now the developer needs also to mention the desired graph type s/he wishes to parse (in this case::MGFormat).Discussion
I know that currently there is some confusion with the architecture choices of
GraphIO.jl.For example there is the problem with
requireas in #42.I think it's important to find a solution, in order to really take advantage of future contributions.
Regarding graph IO parsing, I see 2 cases:
Up until now the 2. was not supported but it is necessary for e.g. parsing
MetaGraphs.To support 2. I just added one argument to the
loadgraph(which makes it inaccessible just from Graphs.jl)So, we probably also need to add this definition in
Graphs.jl.(offtopic)- Wouldn't it make sense to move all the graph IO code from
Graphs.jltoGraphIO.jl?Personally, I find it unsustainable to put everything in one package.
We can't possibly support all graph types, since this will unnecessary grow the dependencies.
Starting with
MetaGraphs, I find it better to have it in a separate package.For example I could put the code into something like
MetaGraphsIO.jl.And probably we would need to mimic
GraphIO.jland inside the hypotheticalMetaGraphsIOsupport all type formats (GraphML,GML,DOT, etc.).(ofc I am not sure if all type formats support additional attributes like
GraphMLdoes, so probably it will be a subset)Plans
In future work I want to include also nested graphs support for
GraphMLwith a custom nested graph type that is still not public.Also, since
GraphMLattributes are type-secure, this makes it a good fit forMetaGraphsNextwhich I will also try to support in the future.This means that I could end up creating
MyWeirdNestedGraphIO.jlandMetaGraphsNextIO.jlBefore I move to it, I would really appreciate some discussion and advices.
That said, I think we need to build the infrastructure to welcome future work in this direction.
Sorry for the long text :)