Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphwalker-cli: Converting .dot to graphml produces redundant double quotes #238

Closed
neofreko opened this issue May 27, 2020 · 2 comments
Closed

Comments

@neofreko
Copy link

Steps to reproduce

Given the following quoted-node.dot file:

digraph SimplestGraph {
    "n0" [label="Start"]
    "n1" [label="v1"]
    "n2" [label="v2"]
}

graphwalker-cli conversion with the following command:

java -jar ~/Downloads/graphwalker-cli-4.2.0.jar convert -i quoted-node.dot -f graphml

will produce the following output:

<?xml version="1.0" encoding="ISO-8859-1"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.0/ygraphml.xsd" xmlns:y="http://www.yworks.com/xml/graphml">
  <key id="d0" for="node" yfiles.type="nodegraphics"/>
  <key id="d1" for="edge" yfiles.type="edgegraphics"/>
  <graph id="G" edgedefault="directed">
    <node id=""n1"">
      <data key="d0" >
        <y:ShapeNode >
          <y:Geometry  x="241.875" y="158.701171875" width="95.0" height="30.0"/>
          <y:Fill color="#CCCCFF"  transparent="false"/>
          <y:BorderStyle type="line" width="1.0" color="#000000" />
          <y:NodeLabel x="1.5" y="5.6494140625" width="92.0" height="18.701171875" visible="true" alignment="center" fontFamily="Dialog" fontSize="12" fontStyle="plain" textColor="#000000" modelName="internal" modelPosition="c" autoSizePolicy="content">v1</y:NodeLabel>
          <y:Shape type="rectangle"/>
        </y:ShapeNode>
      </data>
    </node>
    <node id=""n2"">
      <data key="d0" >
        <y:ShapeNode >
          <y:Geometry  x="241.875" y="158.701171875" width="95.0" height="30.0"/>
          <y:Fill color="#CCCCFF"  transparent="false"/>
          <y:BorderStyle type="line" width="1.0" color="#000000" />
          <y:NodeLabel x="1.5" y="5.6494140625" width="92.0" height="18.701171875" visible="true" alignment="center" fontFamily="Dialog" fontSize="12" fontStyle="plain" textColor="#000000" modelName="internal" modelPosition="c" autoSizePolicy="content">v2</y:NodeLabel>
          <y:Shape type="rectangle"/>
        </y:ShapeNode>
      </data>
    </node>
  </graph>
</graphml>

Expected

quoted node name in dot file should not produce duplicate quotes under graphml file.

per .dot file spec, node ID can have quotes.

An ID is one of the following:

Any string of alphabetic ([a-zA-Z\200-\377]) characters, underscores ('_') or digits ([0-9]), not > beginning with a digit;
a numeral [-]?(.[0-9]+ | [0-9]+(.[0-9]*)? );
any double-quoted string ("...") possibly containing escaped quotes (")1;
an HTML string (<...>).

Actual

node id has redundant quote.

<node id=""n1"">
<node id=""n2"">
@KristianKarl
Copy link
Contributor

Thanks for the report!

I created a PR to remedy the problem: #239

@KristianKarl
Copy link
Contributor

You can try it out by downloading the latest build from: https://github.com/GraphWalker/graphwalker-project/releases/tag/LATEST-BUILDS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants