Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

In YEd live, import of Graph ML does not seem to bring across any labels

0 votes

hi. Graph ML imports the node and edge structure but I cannot see which node is which, either as label or annotation.Thanks for a great tool.

Best wishes


asked Dec 12, 2018 in Help by anonymous
retagged Dec 24, 2018 by thomas.behr

Without knowing your file there is no way for us to determine what the problem might be. Can you upload the problematic file here? See How to upload files to yEd Q&A? for instructions on uploading files.

2 Answers

0 votes

hi Thomas

Thanks for the reply. 

I am creating graphs in Gephi and then exporting them as GraphML. It seems to happen with any graph, so here is the Les Miserables dataset as a Gephi graph, exported as Graph ML which loses its labels in YEd Live.

Many thanks



answered Dec 20, 2018 by anonymous
0 votes

Thank you very much for the additional information and especially your GraphML file.

The problem you are facing is actually the very open GraphML specification. The specification defines how to encode the structure of a graph and it defines how to encode additional custom data. That is all there is. Data like geometry, labels, and colors is considered "additional custom data" by the specification. This means every application that uses GraphML may and has to come up with its own way of storing geometry, labels, and colors. At this point, it probably does not come as much of a surprise that Gephi and yEd use two completely different approaches to storing geometry, labels, and colors.

The Gephi approach:

<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
<key attr.name="label" attr.type="string" for="node" id="label"/>
<key attr.name="r" attr.type="int" for="node" id="r"/>
<key attr.name="g" attr.type="int" for="node" id="g"/>
<key attr.name="b" attr.type="int" for="node" id="b"/>
<key attr.name="x" attr.type="float" for="node" id="x"/>
<key attr.name="y" attr.type="float" for="node" id="y"/>
<key attr.name="size" attr.type="float" for="node" id="size"/>
<key attr.name="Modularity Class" attr.type="int" for="node" id="modularity_class"/>
<graph edgedefault="undirected">
<node id="1">
<data key="label">Napoleon</data>
<data key="modularity_class">0</data>
<data key="size">4.0</data>
<data key="r">91</data>
<data key="g">91</data>
<data key="b">245</data>
<data key="x">-418.08344</data>
<data key="y">-446.8853</data>

The yEd approach:

  <key for="node" id="d1" yfiles.type="nodegraphics"/>
  <key for="edge" id="d2" yfiles.type="edgegraphics"/>
  <graph edgedefault="directed" id="G">
    <node id="n0">
      <data key="d1">
          <y:Geometry height="4.0" width="4.0" x="-418.08344" y="-446.8853"/>
          <y:Fill color="#5B5BF5" transparent="false"/>
          <y:BorderStyle color="#5B5BF5" raised="false" type="line" width="1.0"/>
          <y:NodeLabel modelName="sandwich" modelPosition="s">Napolean</y:NodeLabel>
          <y:Shape type="ellipse"/>

Even though the the two formats are quite different and yEd cannot automatically understand geometry, labels, and colors from the Gephi format, yEd does recognize Gephi's "x", "y", "size", "r", "g", "b", "label", and "modularity_class" data as additional data and imports the data as custom properties. (After opening the Gephi GraphML file in yEd, click on a node, go to the properties view in the lower right corner, and scroll down to section "Data".) The good thing about that is that you can use yEd's properties mapper to convert Gephi's "x", "y", "size", and "label" data to node X, Y, Width, Height, and label text. You can use this properties mapper configuration for this purpose.

Finally, once you have opened your Gephi file in yEd, adopted the Gephi data using yEd's properties mapper, and applied whatever additional changes you need, you can save the polished diagram in yEd's GraphML file format. If you open the new yEd GraphML file in yEd Live you will get a properly looking diagram.

answered Dec 24, 2018 by thomas.behr [yWorks] (116,850 points)
edited Dec 24, 2018 by thomas.behr
Imprint | Privacy Policy