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.

Categories

"Unknown element graphml:Geometry" error when parsing y:Geometry

0 votes

Hi,

I'm trying to import a GraphML file with node position information in yEd:

<?xml version="1.0" encoding="UTF-8"?>

 
  <key for="node" id="key0" yfiles.type="nodegraphics"/>
  <key for="node" id="key1" attr.name="description" attr.type="string"/>
 
  <graph id="G" edgedefault="directed">
    <node id="root">
      <data key="key0">
        <y:Geometry height="30.0" width="30.0" x="0.000000" y="-60.000000"/>
        <y:ShapeNode>
          <y:NodeLabel>root</y:NodeLabel>
        </y:ShapeNode>
      </data>
      <data key="key1"><![CDATA[Some text]></data>
    </node>
    <node id="C1-1">
      <data key="key0">
        <y:Geometry height="30.0" width="30.0" x="60.000000" y="0.000000"/>
        <y:ShapeNode>
          <y:NodeLabel>C1-1[1,3]</y:NodeLabel>
        </y:ShapeNode>
      </data>
    </node>
    <edge id="Eroot-C1-1" source="root" target="C1-1" />
    <node id="C0-1">
      <data key="key0">
        <y:Geometry height="30.0" width="30.0" x="60.000000" y="60.000000"/>
        <y:ShapeNode>
          <y:NodeLabel>C0-1[]</y:NodeLabel>
        </y:ShapeNode>
      </data>
    </node>
    <edge id="EC1-1-C0-1" source="C1-1" target="C0-1" />
    <node id="C3-1">
      <data key="key0">
        <y:Geometry height="30.0" width="30.0" x="60.000000" y="120.000000"/>
        <y:ShapeNode>
          <y:NodeLabel>C3-3[2]</y:NodeLabel>
        </y:ShapeNode>
      </data>
    </node>
    <edge id="EC0-1-C3-1" source="C0-1" target="C3-1" />
    <node id="C2-1">
      <data key="key0">
        <y:Geometry height="30.0" width="30.0" x="60.000000" y="180.000000"/>
        <y:ShapeNode>
          <y:NodeLabel>C2-2[]</y:NodeLabel>
        </y:ShapeNode>
      </data>
    </node>
    <edge id="EC3-1-C2-1" source="C3-1" target="C2-1" />
  </graph>
</graphml>
When I open it, I get the following error:

Using FallbackNodeRealizerSerializer for unknown element http://www.yworks.com/xml/graphml:Geometry

and the imported graph seems to have lost most of the information from the file.

If I remove the `y:Geometry` elements the file is imported without errors.

How are node positions specified in yEd's GraphML?

Thanks

 

in Help by

1 Answer

0 votes
 
Best answer

The <y:Geometry> element has to be a child element of the <y:ShapeNode> element. E.g.:

...
  <y:ShapeNode>
    <y:Geometry height="..." width="..." x="100.0" y="100.0"/>
    ...
  </y:ShapeNode>
...

by [yWorks] (145k points)
Legal Disclosure | Privacy Policy
...