Predicate dependency graph (was using gxref on a single module)
"Abdallah, Samer" <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
>
> Next, there is the pack graphml, which writes GraphML files. Then
> you have tools like Gephi to draw wonderful graphs :-) If you go that
> way, please send the picture :-)
Nearly there :)
I do this:
------------------------------
write_call_graph_to(Mod,Output) :-
get_call_graph(Mod,Graph),
graphml_write_ugraph(Output, nomap, [], Graph).
nomap(id,node(N),A) :- term_to_atom(N,A), writeln(nomap(id,node(N),A)).
-------------------------------
where get_call_graph/2 collects all the edges into a ugraph.
The XML looks sensible, but I don't know GraphML.
Gephi doesn't like it. It says "Invalid GML parsing (SEVERE)".
It does this even with a very simple example that produces this output:
--------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<graphml
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://graphml.graphdrawing.org/xmlns"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graph id="G" edgedefault="directed">
<node id="1"/>
<node id="2"/>
<node id="3"/>
<node id="4"/>
<node id="5"/>
<edge id="e0" source="1" target="3"/>
<edge id="e1" source="1" target="5"/>
<edge id="e2" source="2" target="4"/>
<edge id="e3" source="4" target="5"/>
</graph>
</graphml>
---------------------------------------
Is it a bug in the graph writing or in Gephi?
Samer.
>
> Cheers --- Jan
>
> [1] http://www.swi-prolog.org/pldoc/doc/swi/library/prolog_codewalk.pl
>