simple graph seems correctly recorded, but does not show when loaded

Bug #420708 reported by Fred March
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SocNetV
Fix Released
Medium
Dimitris Kalamaras
0.x
Fix Released
Medium
Dimitris Kalamaras

Bug Description

I created a small test graph, and the XML file seems fine (for all I know). On loading the graph, I only get a root node labeled "1", and a very quick status bar message that seems to mention more nodes, but disappears too fast to read. The error message on a terminal is

QGtkStyle cannot be used together with the GTK_Qt engine.

I assume this has to do with a conflict between KDE rendering tools and native Gnome tools. I am using a Gnome desktop, with occasional KDE apps, but this happens both when launched both from a KDE app like Dolphin, and straight from the Gnome menu or any (Gnome or not) terminal. I could not find any configuration files that would allow me to try and tweak the rendering choices.

The XML file is (sorry for the length)
<?xml version="1.0" encoding="UTF-8"?>
 <!-- Created by SocNetV-->
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance " xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key id="d0" for="node" attr.name="label" attr.type="string">
    <default></default>
  </key>
  <key id="d1" for="node" attr.name="x_coordinate" attr.type="double">
    <default>0.0</default>
  </key>
  <key id="d2" for="node" attr.name="y_coordinate" attr.type="double">
    <default>0.0</default>
  </key>
  <key id="d3" for="node" attr.name="size" attr.type="double">
    <default>4</default>
  </key>
  <key id="d4" for="node" attr.name="color" attr.type="string">
    <default>gold</default>
  </key>
  <key id="d5" for="node" attr.name="shape" attr.type="string">
    <default>circle</default>
  </key>
  <key id="d6" for="edge" attr.name="weight" attr.type="double">
    <default>1.0</default>
  </key>
  <key id="d7" for="edge" attr.name="color" attr.type="string">
    <default>grey</default>
  </key>
  <graph id="G" edgedefault="directed">
    <node id="1">
      <data key="d0">Math 142</data>
      <data key="d1">0.56486</data>
      <data key="d2">0.278169</data>
      <data key="d3">9</data>
      <data key="d5">circle</data>
    </node>
    <node id="2">
      <data key="d0">Exponentials & Logs</data>
      <data key="d1">0.220033</data>
      <data key="d2">0.272887</data>
      <data key="d3">6</data>
      <data key="d5">circle</data>
    </node>
    <node id="3">
      <data key="d0">right-triangle trig</data>
      <data key="d1">0.34647</data>
      <data key="d2">0.0299296</data>
      <data key="d4">azure</data>
      <data key="d5">triangle</data>
    </node>
    <node id="4">
      <data key="d0">Trig</data>
      <data key="d1">0.563218</data>
      <data key="d2">0.149648</data>
      <data key="d3">6</data>
      <data key="d5">circle</data>
    </node>
    <node id="5">
      <data key="d0">Linear Sys/Matrices</data>
      <data key="d1">0.745484</data>
      <data key="d2">0.169014</data>
      <data key="d3">6</data>
      <data key="d5">circle</data>
    </node>
    <node id="6">
      <data key="d0">Linear sys/sub & elim</data>
      <data key="d1">0.596059</data>
      <data key="d2">0.0193662</data>
      <data key="d4">azure</data>
      <data key="d5">triangle</data>
    </node>
    <edge id="e1" directed="true" source="1" target="2"/>
    <edge id="e2" directed="true" source="1" target="4"/>
    <edge id="e3" directed="true" source="1" target="5"/>
    <edge id="e4" directed="true" source="3" target="4"/>
    <edge id="e5" directed="true" source="6" target="5"/>
  </graph>
</graphml>
Again, none of the nodes (except a root node, with no label), nor edges comes up when this file is loaded.

Revision history for this message
Dimitris Kalamaras (dimitris-kalamaras) wrote :

You're using version 0.70? If so, this bug might be fixed in development trunk. Please, download and check:

svn co http://socnetv.svn.sourceforge.net/svnroot/socnetv/trunk

Meanwhile, I will be examining your data file and get back with some answers shortly.

Changed in socnetv:
assignee: nobody → Dimitris Kalamaras (dimitris-kalamaras)
Revision history for this message
Dimitris Kalamaras (dimitris-kalamaras) wrote :

OK, this bug has been triaged.
Seems that the error lies in the label lines (key="d0"):

 <data key="d0">Exponentials & Logs</data>

Probably its the "&" character that breaks the parser.

Revision history for this message
Dimitris Kalamaras (dimitris-kalamaras) wrote :

Fred, seems that this problem of yours is not a bug after all.
It's the GraphML spec. :)
I mean GraphML is actually XML, and in any XML document ampersands are treated as special characters [usually denoting the start of variables]. To resolve this, you need to use &amp; instead of plain &.

To be honest, we need to implement a "eliminate strange characters like ampersand" check in SocNetV when the user enters some label data, or else people will think is broken.

You see, ambersand (&) is not the only character that XML (and by definition GraphML) treats as special. The same is true for these characters as well:
 & &amp;
< &lt;
> &gt;
" &quot;
 ' &apos;

Revision history for this message
Dimitris Kalamaras (dimitris-kalamaras) wrote :

To recap:

 SocNetV 0.70 does not tolerate &. Instead use &amp;

This file will work alright for you:

<?xml version="1.0" encoding="UTF-8"?>
 <!-- Created by SocNetV-->
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance " xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
  <key id="d0" for="node" attr.name="label" attr.type="string">
    <default></default>
  </key>
  <key id="d1" for="node" attr.name="x_coordinate" attr.type="double">
    <default>0.0</default>
  </key>
  <key id="d2" for="node" attr.name="y_coordinate" attr.type="double">
    <default>0.0</default>
  </key>
  <key id="d3" for="node" attr.name="size" attr.type="double">
    <default>4</default>
  </key>
  <key id="d4" for="node" attr.name="color" attr.type="string">
    <default>gold</default>
  </key>
  <key id="d5" for="node" attr.name="shape" attr.type="string">
    <default>circle</default>
  </key>
  <key id="d6" for="edge" attr.name="weight" attr.type="double">
    <default>1.0</default>
  </key>
  <key id="d7" for="edge" attr.name="color" attr.type="string">
    <default>grey</default>
  </key>
  <graph id="G" edgedefault="directed">
    <node id="1">
      <data key="d0">Math 142</data>
      <data key="d1">0.56486</data>
      <data key="d2">0.278169</data>
      <data key="d3">9</data>
      <data key="d5">circle</data>
    </node>
    <node id="2">
      <data key="d0">Exponentials &amp; Logs</data>
      <data key="d1">0.220033</data>
      <data key="d2">0.272887</data>
      <data key="d3">6</data>
      <data key="d5">circle</data>
    </node>
    <node id="3">
      <data key="d0">right-triangle trig</data>
      <data key="d1">0.34647</data>
      <data key="d2">0.0299296</data>
      <data key="d4">azure</data>
      <data key="d5">triangle</data>
    </node>
    <node id="4">
      <data key="d0">Trig</data>
      <data key="d1">0.563218</data>
      <data key="d2">0.149648</data>
      <data key="d3">6</data>
      <data key="d5">circle</data>
    </node>
    <node id="5">
      <data key="d0">Linear Sys/Matrices</data>
      <data key="d1">0.745484</data>
      <data key="d2">0.169014</data>
      <data key="d3">6</data>
      <data key="d5">circle</data>
    </node>
    <node id="6">
      <data key="d0">Linear sys/sub &amp; elim</data>
      <data key="d1">0.596059</data>
      <data key="d2">0.0193662</data>
      <data key="d4">azure</data>
      <data key="d5">triangle</data>
    </node>
    <edge id="e1" directed="true" source="1" target="2"/>
    <edge id="e2" directed="true" source="1" target="4"/>
    <edge id="e3" directed="true" source="1" target="5"/>
    <edge id="e4" directed="true" source="3" target="4"/>
    <edge id="e5" directed="true" source="6" target="5"/>
  </graph>
</graphml>

Revision history for this message
Dimitris Kalamaras (dimitris-kalamaras) wrote :

Fred, my comment #3 was a little bit wrong in recognizing the value of your bug report.

True, this bug is due to XML specs, but still the bug is in SocNetV:

We really needed an "eliminate strange characters like ampersand" check in SocNetV when saving network data in GraphML.

The patch has been committed to trunk:

http://socnetv.svn.sourceforge.net/viewvc/socnetv?view=rev&revision=417

This fixes all cases mentioned above, not only & -> &amp;

Please, use the trunk version to see if it's ok with you.

Thanks again for your nice bug report.

Cheers

Revision history for this message
Fred March (fredsea) wrote : Re: [Bug 420708] Re: simple graph seems correctly recorded, but does not show when loaded

On Sat, 2009-08-29 at 17:15 +0000, Dimitris Kalamaras wrote:

> Fred, my comment #3 was a little bit wrong in recognizing the value of
> your bug report.
>
> True, this bug is due to XML specs, but still the bug is in SocNetV:
>
> We really needed an "eliminate strange characters like ampersand"
> check
> in SocNetV when saving network data in GraphML.
>
> The patch has been committed to trunk:
>
> http://socnetv.svn.sourceforge.net/viewvc/socnetv?view=rev&revision=417
>
> This fixes all cases mentioned above, not only & -> &amp;
>
> Please, use the trunk version to see if it's ok with you.
>
> Thanks again for your nice bug report.

Well, Dimitris, I apologize for a) answering personally, b) quite some
time after your kind mail, but...

I guess, something's still not right. Getting the latest version from
the trunk was a breeze, and so was installing it, but it still won't
work. More precisely:

      * My old file still won't get correctly parsed (I get two nodes,
        no link, the nodes labeled "1" and "2"...)
      * Trying to create a new chart I can't get the parser to a) show
        the label, b) obey the directive to show the number in the node,
        and not on its side.

Sorry to bug you with this. I will file a formal bug report after I do a
little more experimenting. I am so eager to use this program, as I am no
hacker at all, but would love to have such a convenient
"organizer" (don't ask :)).

Thank you for your wonderful work!
--
Fred March <email address hidden>

Revision history for this message
Dimitris Kalamaras (dimitris-kalamaras) wrote :

Fred, as I said in my previous comments, you cannot have the character "&" inside a label in a graphml file. That's why SocNetV prematurely stops parsing your file. This is due to the XML limitations. So, please, use "&amp;" instead - test with the network in #4 to see that it works - just replace "&" with "&amp;" in your file...

To make it clearer, the patch I mention in comment #5 fixes the (previously) erroneous behavior of SocNetV when saving networks: now the development version of SocNetV converts any "&" in node labels to "&amp;" when you save a network in GraphML format.

As for your second point, please open a new bug report and elaborate on this. BTW, numbers do appear inside nodes, although I have to admit the implementation sucks. :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.