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

Import error/nested graphs

0 votes
Hello,

I have problems importing a certain file into yEd- the error states:

"Caused by: y.H.B.B.a: Target node id ValueClass {1AA049F7-8A46-4B20-8661-BAF5F48BA50F} not defined in this graph!"

Which is quite mysterious, as the node mentioned is actually defined. Only thing is, that this node belongs to a subgraph, whilst the source node of the error-causing edge doesn't. Definition of the node takes place in the root-graph.

My file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:y="http://www.yworks.com/xml/graphml"
xmlns:yed="http://www.yworks.com/xml/yed/3"
xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
<key for="node" id="d0" yfiles.type="nodegraphics"/>
<key for="edge" id="d1" yfiles.type="edgegraphics"/>
  <graph edgedefault="directed" id="G">
    <node id="Value classes" yfiles.foldertype="group">
      <data key="d0">
        <y:GroupNode>
          <y:NodeLabel alignment="right" autoSizePolicy="node_width" backgroundColor="#B7B69E" modelName="internal" modelPosition="t">Value classes</y:NodeLabel>
          <y:Fill color="#FF0033"  transparent="false"/>
          <y:Shape type="rectangle"/>
            <graph id="valueclasses" edgedefault="directed">

               <!-- ... --->
               <node id="ValueClass {1AA049F7-8A46-4B20-8661-BAF5F48BA50F}">
                 <data key="d0">
                   <y:ShapeNode>
                     <y:Geometry height="40" width="120"/>
                     <y:NodeLabel>String</y:NodeLabel>
                     <y:Fill color="#FF0033"  transparent="false"/>
                     <y:Shape type="ellipse"/>
                   </y:ShapeNode>
                 </data>
               </node>
            </graph>
        </y:GroupNode>
      </data>
    </node>
    <node id="Class {A7197AF0-40F6-4862-A015-16D528608002}">
      <data key="d0">
        <y:ShapeNode>
          <y:Geometry height="40" width="120"/>
          <y:NodeLabel>Object</y:NodeLabel>
          <y:Fill color="#FF0033"  transparent="false"/>
          <y:Shape type="ellipse"/>
        </y:ShapeNode>
      </data>
    </node>
    <edge id="{A7197AF0-40F6-4862-A015-16D528608002}_0" source="Class {A7197AF0-40F6-4862-A015-16D528608002}" target="ValueClass {1AA049F7-8A46-4B20-8661-BAF5F48BA50F}">
      <data key="d1">
        <y:PolyLineEdge>
          <y:EdgeLabel>SubClass</y:EdgeLabel>
        </y:PolyLineEdge>
      </data>
    </edge>
   [...]
  </graph>
</graphml>
closed with the note: Problem solved
in Help by
closed by

1 Answer

0 votes
 
Best answer

Your xml element nesting is not correct. The 'graph' element of the subgraphs must be a direct child of the parent graph's 'node', e.g.,

<graph edgedefault="directed" id="G">
  <node id="Value classes" yfiles.foldertype="group">
    <graph id="valueclasses" edgedefault="directed">
       <node id="ValueClass {5CD96DAF-0883-4663-BDA2-0E6D9B8D1145}">

...

The 'data' element for key 'd0' and its child 'y:GroupNode' contain information about the visualization of the node/group but must not contain any parts of the (sub-)graph.

For more file format details, please create a sample GraphML file with the desired grouping in yEd.

by [yWorks] (26.8k points)
selected by
Aaah, OK. Thanks a lot!
Legal Disclosure | Privacy Policy
...