[BGL] Reading GraphML
I tried to read a GraphML file using Douglas' code and the following:
std::auto_ptrboost::dynamic_property_map
string2string_gen(const std::string& name,
const boost::any&,
const boost::any&) {
typedef std::mapstd::string,std::string map_t;
typedef
boost::associative_property_map< std::map
Jens Müller schrieb:
I tried to read a GraphML file using Douglas' code and the following:
I am not even really interested in the d0 properties ...
Now I did that:
static void
on_end_element(void* user_data, const XML_Char *c_name)
{
self_type* self = static_cast
On Oct 1, 2006, at 10:18 AM, Jens Müller wrote:
I tried to read a GraphML file using Douglas' code and the following:
Tiago de Paula Peixoto has made some big improvements to that code. Are you using the newest version?
Unrecognized attribute `xmlns' of element `graphml'. Ignoring... Unrecognized attribute `xmlns:y' of element `graphml'. Ignoring... Unrecognized attribute `xmlns:xsi' of element `graphml'. Ignoring... Unrecognized attribute `xsi:schemaLocation' of element `graphml'. Ignoring... Unrecognized attribute `yfiles.type' of element `key'. Ignoring... Unrecognized attribute `yfiles.type' of element `key'. Ignoring... Unrecognized element `y:ShapeNode' Unrecognized element `y:Geometry' Unrecognized element `y:Fill' Unrecognized element `y:BorderStyle' Unrecognized element `y:NodeLabel' Unrecognized element `y:Shape' terminate called after throwing an instance of 'boost::bad_any_cast' what(): boost::bad_any_cast: failed conversion using boost::any_cast /bin/sh: line 1: 31380 Abgebrochen ./src/graphml2 Core0bis10_1000.graphml
Uh oh. It looks like we're not handling namespaces correctly at all. Expat does have namespace support, we're just not using it. Tiago, perhaps you have some interest in adding namespace support to the GraphML parser? Cheers, Doug
On 10/03/2006 03:28 PM, Doug Gregor wrote:
Uh oh. It looks like we're not handling namespaces correctly at all. Expat does have namespace support, we're just not using it.
Tiago, perhaps you have some interest in adding namespace support to the GraphML parser?
Yes, sure. I'll take a stab at it...
BTW, the newest version from the reader can always be obtained from:
https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.hpp
https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.cpp
(the above version has a GPL header, but I'll take it off when it's to
be included in boost)
Take care.
--
Tiago de Paula Peixoto
Hi Tiago, Doug, I just had a look at graph-tool and it looks really interesting. You're computing several measures that are standard in Network Science these days and I wonder if these could be integrated in the next BGL distribution -they're very, very useful. Cheers, Rui ________________________________________ Rui Carvalho http://www.casa.ucl.ac.uk/people/Rui.htm Senior Research Fellow Centre for Advanced Spatial Analysis University College London 1-19 Torrington Place Gower Street London WC1E 6BT, U.K. -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Tiago de Paula Peixoto Sent: 03 October 2006 22:36 To: boost-users@lists.boost.org Subject: Re: [Boost-users] [BGL] Reading GraphML On 10/03/2006 03:28 PM, Doug Gregor wrote:
Uh oh. It looks like we're not handling namespaces correctly at all. Expat does have namespace support, we're just not using it.
Tiago, perhaps you have some interest in adding namespace support to the GraphML parser?
Yes, sure. I'll take a stab at it...
BTW, the newest version from the reader can always be obtained from:
https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.hpp
https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.cpp
(the above version has a GPL header, but I'll take it off when it's to
be included in boost)
Take care.
--
Tiago de Paula Peixoto
Hi Rui. On 10/03/2006 06:51 PM, Rui Carvalho wrote:
I just had a look at graph-tool and it looks really interesting. You're computing several measures that are standard in Network Science these days and I wonder if these could be integrated in the next BGL distribution -they're very, very useful.
Thanks! graph-tool uses BGL extensively, but it was really not designed
as a library. This means that the code would have to be changed somewhat
to be included in a library such as boost. Not to mention that a lot of
the algorithms included in graph-tool either come already from BGL or
are relatively trivial (degree distribution, degree correlation, etc).
There may be some code, however, such as arbitrary random graph
generation, which could be of a more general interest... If there is any
interest from the BGL people in having any part of graph-tool inserted
into boost, I'd be happy to make it happen (by making it more BGL-like,
properly parameterized, etc.)
Take care.
--
Tiago de Paula Peixoto
Hi Tiago, Yes, you're right, some of the algorithms are trivial (but then, isn't BFS trivial?), but I saw that you're planning to include community structure detection in the near future. Although there isn't just one single algorithm for community structure, having an implementation of those in BGL would help others not reinvent the wheel ;) Cheers, Rui -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Tiago de Paula Peixoto Sent: 04 October 2006 02:30 To: boost-users@lists.boost.org Subject: Re: [Boost-users] [BGL] Reading GraphML Hi Rui. On 10/03/2006 06:51 PM, Rui Carvalho wrote:
I just had a look at graph-tool and it looks really interesting. You're computing several measures that are standard in Network Science these days and I wonder if these could be integrated in the next BGL distribution -they're very, very useful.
Thanks! graph-tool uses BGL extensively, but it was really not designed
as a library. This means that the code would have to be changed somewhat
to be included in a library such as boost. Not to mention that a lot of
the algorithms included in graph-tool either come already from BGL or
are relatively trivial (degree distribution, degree correlation, etc).
There may be some code, however, such as arbitrary random graph
generation, which could be of a more general interest... If there is any
interest from the BGL people in having any part of graph-tool inserted
into boost, I'd be happy to make it happen (by making it more BGL-like,
properly parameterized, etc.)
Take care.
--
Tiago de Paula Peixoto
Rui Carvalho schrieb:
Hi Tiago,
Yes, you're right, some of the algorithms are trivial (but then, isn't BFS trivial?), but I saw that you're planning to include community structure detection in the near future. Although there isn't just one single algorithm for community structure, having an implementation of those in BGL would help others not reinvent the wheel ;)
Detecting community structure? What do you mean by that? Graph clustering?
Jens Müller wrote:
Detecting community structure? What do you mean by that? Graph clustering?
Hi Jens, Have a look at: http://arxiv.org/abs/cond-mat/0603718 http://arxiv.org/abs/physics/0602033/ http://arxiv.org/abs/physics/0605087/ http://arxiv.org/abs/physics/0602124/ http://arxiv.org/abs/cond-mat/0408187/ http://arxiv.org/abs/cond-mat/0309508/ and references in these papers. Cheers, Rui _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Rui Carvalho schrieb:
Jens Müller wrote:
Detecting community structure? What do you mean by that? Graph clustering?
Hi Jens,
Have a look at: http://arxiv.org/abs/cond-mat/0603718
:-) I've implemented a Newman-style clusterer (in Java).
Jens Müller wrote:
Rui Carvalho schrieb:
Jens Müller wrote:
Detecting community structure? What do you mean by that? Graph clustering?
Hi Jens,
Have a look at: http://arxiv.org/abs/cond-mat/0603718
:-)
I've implemented a Newman-style clusterer (in Java).
Ah! Wouldn't it be nice to do it with the BGL! ;) All the best, Rui _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Rui Carvalho schrieb:
Have a look at: http://arxiv.org/abs/cond-mat/0603718
:-)
I've implemented a Newman-style clusterer (in Java).
Ah! Wouldn't it be nice to do it with the BGL! ;)
If Universität Karlsruhe pays me for it, sure ;-)
On 10/04/2006 02:56 PM, Rui Carvalho wrote:
I've implemented a Newman-style clusterer (in Java).
Ah! Wouldn't it be nice to do it with the BGL! ;)
I've added initial support for community detection in graph-tool, based
on http://arxiv.org/abs/cond-mat/0603718. It is equivalent to minimizing
Newman's modularity, but allows for sub-community detection and
compensation for degree-correlation.
It is still experimental, and I'm still working on it, but if people
want to test it or comment on it, I've opened a ticket for it:
https://projects.forked.de/graph-tool/ticket/6
Once this is working, and turns out to be a good cluster detection code,
and if there is general interest, I could modify it to be included in
BGL (or at least to be used out of graph-tool, with BGL only).
Take care.
--
Tiago de Paula Peixoto
Doug Gregor schrieb:
On Oct 1, 2006, at 10:18 AM, Jens Müller wrote:
I tried to read a GraphML file using Douglas' code and the following:
Tiago de Paula Peixoto has made some big improvements to that code. Are you using the newest version?
Probably not - I just found a posting of your's with Google on Gmane and tried it out. I'll take a look at graph-tools, this is very useful, thanks! I'll report if the problems persist there ...
On 10/03/2006 03:28 PM, Doug Gregor wrote:
Tiago, perhaps you have some interest in adding namespace support to the GraphML parser?
I finally added this. It turned out to be quite simple...
The new code is, as always, at:
https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.hpp
https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.cpp
Cheers.
--
Tiago de Paula Peixoto
On Fri, 2006-12-22 at 12:59 -0200, Tiago de Paula Peixoto wrote:
On 10/03/2006 03:28 PM, Doug Gregor wrote:
Tiago, perhaps you have some interest in adding namespace support to the GraphML parser?
I finally added this. It turned out to be quite simple...
Wonderful, thank you!
The new code is, as always, at:
https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.hpp https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.cpp
I would really like to get this into Boost CVS for the 1.35.0 release. Have you perchance written up any HTML documentation and/or do you have a self-contained test case? Once we have both of those, we can put your GraphML parser into the Boost tree. Cheers, Doug
On 12/22/2006 02:49 PM, Douglas Gregor wrote:
The new code is, as always, at:
https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.hpp https://projects.forked.de/graph-tool/browser/trunk/src/graph/graphml.cpp
I would really like to get this into Boost CVS for the 1.35.0 release. Have you perchance written up any HTML documentation and/or do you have a self-contained test case? Once we have both of those, we can put your GraphML parser into the Boost tree.
Great! I'll do what I can to help. I had already done some documentation
and a test case, as I sent in:
http://thread.gmane.org/gmane.comp.lib.boost.devel/146699/focus=146836
It may need some review, but you could tell me if that is along the
lines of what you need.
Cheers.
--
Tiago de Paula Peixoto
On Dec 22, 2006, at 9:59 AM, Tiago de Paula Peixoto wrote:
On 10/03/2006 03:28 PM, Doug Gregor wrote:
Tiago, perhaps you have some interest in adding namespace support to the GraphML parser?
I finally added this. It turned out to be quite simple...
Great! I've integrated your latest GraphML parser, including your tests and documentation, into Boost CVS HEAD. I imagine we'll want to monkey around with the build system a little bit until we get it to build everywhere easily. The GraphML reader is now a part of the "boost_graph" library. Thanks again for your contribution, and I apologize for the long delay in integrating this code. Cheers, Doug
On 01/29/2007 08:19 PM, Doug Gregor wrote:
On Dec 22, 2006, at 9:59 AM, Tiago de Paula Peixoto wrote:
On 10/03/2006 03:28 PM, Doug Gregor wrote:
Tiago, perhaps you have some interest in adding namespace support to the GraphML parser? I finally added this. It turned out to be quite simple...
Great! I've integrated your latest GraphML parser, including your tests and documentation, into Boost CVS HEAD. I imagine we'll want to monkey around with the build system a little bit until we get it to build everywhere easily. The GraphML reader is now a part of the "boost_graph" library.
Thanks again for your contribution, and I apologize for the long delay in integrating this code.
Only now I've read this. Great! It may be that the documentation needs a
little update. I'll take a look at it this weekend and send you any
changes which may be needed.
Thanks!
--
Tiago de Paula Peixoto
On 03/23/2007 09:49 AM, Tiago de Paula Peixoto wrote:
Great! I've integrated your latest GraphML parser, including your tests and documentation, into Boost CVS HEAD. I imagine we'll want to monkey around with the build system a little bit until we get it to build everywhere easily. The GraphML reader is now a part of the "boost_graph" library.
Thanks again for your contribution, and I apologize for the long delay in integrating this code.
Only now I've read this. Great! It may be that the documentation needs a little update. I'll take a look at it this weekend and send you any changes which may be needed.
I've made some modifications to the documentation, the tests, and more
importantly, the code itself. The newer versions are attached. The new
reader has correct and detaild error reporting from expat, and informs
the line and column of the file where the error occurred, but besides
that it's the same. The new test is still a bit simple, but it is a
little more detailed now.
I have a couple of questions:
1- How should graph properties be handled? I did include support for it,
using dynamic_properties map with a key type equal to the graph type,
but I don't know if that's the proper way to do it.
2- Some of the exceptions are shared with the graphviz reader, but those
exceptions have the name "graphviz" in their error strings, and thus
create confusing messages when used with the graphml reader. Perhaps
those strings should be edited in the graphviz code?
Thanks, and let me know if there's anything else I can do.
--
Tiago de Paula Peixoto
participants (5)
-
Doug Gregor
-
Douglas Gregor
-
Jens Müller
-
Rui Carvalho
-
Tiago de Paula Peixoto