Launch Gephi and open GraphML file from Java or command line

Asked by Lukillas

Hello,
I'm a developer and would like to know if there's any way to launch Gephi from Java and automatically open a specific GraphML file (without user interaction).
Maybe through a set of argument through the command line?
Any idea or suggestion?
Thank you very much

Question information

Language:
English Edit question
Status:
Solved
For:
Gephi Edit question
Assignee:
No assignee Edit question
Solved by:
Lukillas
Solved:
Last query:
Last reply:
Revision history for this message
Sébastien Heymann (sebastien.heymann) said :
#1

Hi,

This is not possible with the Gephi Desktop, however it's straight with the Toolkit:
http://wiki.gephi.org/index.php/Toolkit_-_Headless_Gephi
http://gephi.org/tutorials/gephi-tutorial-toolkit.pdf (page 6)

Revision history for this message
Lukillas (lukillas) said :
#2

I'm not sure if I explained myself well...
I think this answer only explains how to use the functionalities of Gephi using it's library of functions.
What I want to do is, having a GraphML file previously created, open it using Gephi Desktop through (using) Java.
The idea is that the program I'm developing exports the graph to a GraphML file and, automatically, this file is opened using Gephi Desktop, so the user can use Gephi Desktop to manipulate the exported graph.
Did I explain myself?
Thank you very much for your fast response!

Revision history for this message
Julian Bilcke (flngr) said :
#3

You can try to add the file path as first argument of Gephi.

Eg., if you are under linux, you could type:

path/to/gephi-0.7-alpha4/bin/gephidesktop /path/to/the/graph/file

(I just tested it with a .gexf under linux, it worked. I believe this can work on Windows or MacOS with other formats as well)

Revision history for this message
Lukillas (lukillas) said :
#4

I already tried that on Windows, but doesn't work...
I get the following error on the command line: "Ignored Unknown option GDB.graphml"
And I used to get a warning window with a "Null error" message on the GUI, but not anymore (I updated the Gephi version).
Any ideas?
Thanks!

Revision history for this message
Julian Bilcke (flngr) said :
#5

Hmm then, this is probably a bug.. In the doubt, I'll create a bug from this question for you.

Revision history for this message
Lukillas (lukillas) said :
#6

Thanks Julian!
Anybody got any other idea?
Is there any documentation on these "options" that are available when launching Gephi through command line?
Thanks!

Revision history for this message
Mathieu Bastian (mathieu.bastian) said :
#7

Hi

Is your path absolute?

There are no other options for command line than passing files to be opened.

Note that passing arguments doesn't work on Max OS (see bug 628900)

Revision history for this message
Lukillas (lukillas) said :
#8

Thanks a lot!
Finally I made it!
Using Gephi 0.7 and absolute path to the GraphML file
Thanks again!
And great support!