New to GraphWalker: Importing a model into GraphWlaker from a JSON file

50 views
Skip to first unread message

Nour Chetouane

unread,
Sep 22, 2022, 3:31:03 AM9/22/22
to GraphWalker
Hello, 
I have an automota model  stored in a JSON file using PySimpleAutomata python library, 
I want to import this model directly to GraphWlaker GUI. 
Would this be possible ? Knowing that my JSON file has not exactly the same representation as a model file from Graphwalker.
Any suggestions ?

Thanks  !

Kristian Karl

unread,
Sep 22, 2022, 5:35:47 AM9/22/22
to GraphWalker
Hi!
Have a look at jq.
It's a wonderful tool to manipulate, transform, query and do other stuff with json.
/Kristian

Nour Chetouane

unread,
Sep 23, 2022, 5:08:12 AM9/23/22
to GraphWalker
Hi, Thanks for your reply, 

I am now trying to use the python package  graphwalker instead.
I have an automata graph stored in .dot format.
I installed graphwalker with pip 
and i run the following command:

 graphwalker --stopcond=Coverage:edges=100,verts=50  /automata_graph.dot

I get this error:

Traceback (most recent call last):
  File "/opt/anaconda3/envs/OSi_Env/bin/graphwalker", line 4, in <module>
    from graphwalker import cli
  File "/opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages/graphwalker/cli.py", line 9, in <module>
    from graphwalker import planning
  File "/opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages/graphwalker/planning.py", line 221, in <module>
    class Interactive(Planner):
  File "/opt/anaconda3/envs/OSi_Env/lib/python3.7/site-packages/graphwalker/planning.py", line 227, in Interactive
    raw_input = raw_input
NameError: name 'raw_input' is not defined

I googled this and it seems that the error: NameError: name 'raw_input' is not defined is  because im using python 3 
so  i changed to python 2.7 but i still get the same error,
Do you please have any suggestion to fix his ?


Thank you. 
Reply all
Reply to author
Forward
0 new messages