GraphML file readable via Java but not Gremlin console?

135 views
Skip to first unread message

Rowan Johnson

unread,
Jan 11, 2019, 12:29:10 PM1/11/19
to Gremlin-users
Hello,
I'm a bit of a newbie to TinkerPop3 so please excuse any silliness on my part.

TL;DR: I can open a graphml file I previously wrote in my Java app but not in the Gremlin console. Why?

I have a Java program that is creating a graph and writing it to a local file using the following code: 
private static TinkerGraph tg = TinkerGraph.open();
<code creating tg graph>
tg.io(IoCore.graphml()).writeGraph("query-result.xml");

I am then able to launch the program again and load the data using:

tg.io(IoCore.graphml()).readGraph("query-result.xml");

If it makes a difference, the file is a bit weird and quite big; I've got 224,000 nodes and 0 edges, mostly because edge creation has been too time-intensive so far. The file is about 142 megabytes.

The problem is, I would like to be able to load this xml file into the TinkerGraph console. I moved this xml file to the data file in tinkergraph console. Yet, when I run 
graph = TinkerGraph.open()
graph.io(IoCore.graphml()).readGraph("data/query-results.xml")

I get the message back that there is "No such file or directory", even though the file exists and I can print it out. Whereas, trying to load any of the pre-provided data in the data package works just fine for me.

Any ideas as to why this is happening?

Cheers,
Rowan

Rowan Johnson

unread,
Jan 11, 2019, 12:58:55 PM1/11/19
to Gremlin-users
Ok interesting update - if I run cp <directory to file> . in the console/data directory, suddenly it works? Is there some special property of the data folder I'm not aware of?

Stephen Mallette

unread,
Jan 11, 2019, 2:14:20 PM1/11/19
to gremli...@googlegroups.com
Not sure what might be wrong, but probably just a pathing problem of some sort. If you start the Gremlin Console with:

bin/gremlin.sh 

then i would expect this line to work:

graph.io(IoCore.graphml()).readGraph("data/query-results.xml")

where the /data directory is at the same level as /bin


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/1671f620-f2d8-41b7-8ef5-d6a528e16c06%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages