How to generate Graphml files

1,324 views
Skip to first unread message

Shivam Gupta

unread,
Mar 23, 2020, 5:19:22 AM3/23/20
to GraphWalker
Hi All,
How to generate graphml files from the graph walker studio.
I am able to create a model but while clicking on the save button it is downloading in form of  json file. now can we convert json files file into Graphml files?
I have also tried with right-clicking on model and save as test.graphml but while saving it is coming as test.graphml.html.

can anyone help me please how we can create a graphml file.
any video or doc link will be helpful
Screenshot 2020-03-23 at 2.43.07 PM.png

aacs...@gmail.com

unread,
Mar 23, 2020, 8:58:41 AM3/23/20
to GraphWalker
Why not use json directly? You can just put the json file in the place you previouly put a graphml file.

Kristian Karl

unread,
Mar 25, 2020, 3:12:25 AM3/25/20
to GraphWalker
You can use GraphWalker to convert json to graphml:
java -jar graphwalker-cli-4.2.0.jar convert -i foo.json -f graphml > foo.graphml

See more here: https://github.com/GraphWalker/graphwalker-project/wiki/Convert

Shivam Gupta

unread,
Mar 26, 2020, 12:42:44 AM3/26/20
to GraphWalker
Thanks for your response!!
I have tried with the same approach file is generating in graphml format but the content of the file is not as expected.

I have run below command:
 java -jar  /Users/shivam.gupta/Desktop/Graphwalkercmd.jar convert -i  models/test.json -f graphml > models/test.graphml

the converted file is attached. 
can you please help where is am doing wrong here.
Screenshot 2020-03-26 at 10.01.07 AM.png
test (5).json
test.graphml

Kristian Karl

unread,
Mar 26, 2020, 3:35:15 AM3/26/20
to GraphWalker
Hi,

Using the latest version graphwalker 4.2.0, and the command line options you used, I get this graphml model i yEd.

You must use the command line tool of GraphWalker. Not Studio.
So your command line must look like this:
java -jar graphwalker-cli-4.2.0.jar convert -i foo.json -f graphml > foo.graphml



Screenshot_20200326_082824.png


Shivam Gupta

unread,
Mar 31, 2020, 11:03:41 PM3/31/20
to GraphWalker
Thanks, Kristian for your help
your solution worked 
Thanks Again

Alper Silistre

unread,
Dec 20, 2020, 7:39:51 AM12/20/20
to GraphWalker
Hi Kristian,

I wanted to write on this conversion instead of creating a new one. I converted a JSON model to a graphml model with this command:

java -jar graphwalker-cli-4.3.0.jar convert -i TestModel.json -f graphml > TestModel.graphml

The model is a basic example like you did previously. I can run this inside the GraphWalker studio with this Generator: random(reached_vertex(v_End)).

But I can't load this into yEd live editor (https://www.yworks.com/yed-live/). It says: XML Parsing Error: not well-formed. Location: https://www.yworks.com/yed-live/. Line Number 1, Column 1:�<


When I compare this with an example model saved from yEd live editor, I can see that the graphwalker CLI export XML file that start with
<?xml version="1.0" encoding="ISO-8859-1"?> but other models start with
<?xml version="1.0" encoding="UTF-8" standalone="no"?> . I modified the exported graphml file to make it look like the way yEd editor understand but couldn't manage to do that.

Is something changed from graphwalker CLI version 4.2.0 to 4.3.0 or does yEd live editor changed in a way that the conversion is not possible anymore?

Thank you,

Alper.

Alper Silistre

unread,
Dec 20, 2020, 9:09:07 AM12/20/20
to GraphWalker
I noticed the file is UTF-16 LE encoding format. The first line of the XML also display it as encoding="ISO-8859-1". Is there a way to make conversion in the UTF-8 format?

Thanks,

Alper.
Reply all
Reply to author
Forward
0 new messages