Gremlin Gephi Plugin 0.8.2 instructions...

1,469 views
Skip to first unread message

Sheshadri Mantha

unread,
Apr 15, 2016, 8:15:26 PM4/15/16
to gremli...@googlegroups.com
I'd recently struggled with getting Gephi talking to Gremlin - I was following the instruction in Tinkerpop3 documentation. There are couple of gotchas... and hopefully this'll be helpful to others.

Versions
  1. The Gephi Streaming plugin mentioned in the documentation is only supported for Gephi version 0.8.2
  2. The current Gephi release is 0.9.1 -- this kinda works but there's layout and display issues at least on Windows10
  3. Gremlin versions seem to not matter from what I could tell - I mean any 1.1.x and 1.3.x both are fine
Recommended Version: Gephi 0.8.2; 

Installation:
  1. 0.9.1 installation instructions also apply https://gephi.org/users/install/ also apply to 0.8.2 with the EXCEPTION that you'll need to get 0.8.2 from here: https://github.com/gephi/gephi/releases/tag/v0.8.2.  Download and Install.  
  2. Next download the GephiStreaming plugin:
    1. Go to: https://marketplace.gephi.org/plugin/graph-streaming/
    2. Click Download button
    3. Extract the zip file into a folder 
    4. Verify you have 6 nbm files in this folder -- see pix
    5. Inline image 1
  3. Launch gephi
    1. MAKE SURE THAT YOU ARE USING JDK 1.7 and not JDK1.8 or gephi 0.8.2 WILL NOT launch.  
    2. BTW: gephi stores its data in personal user account folder .gephi which on windows can be found in \Users\myUserID\AppData\Roaming\.gephi\0.8.2\var\log
  4. Go to Tools -> Plugins and click the Downloaded tab
  5. Inline image 2
  6. Then click the Add Plugins... button.  This opens a file browser
  7. Inline image 3
  8. Navigate to the folder where the nbm's from GephiStreaming were extracted and add all of 6 nbm
  9. Then click Install in bottom left of the plugins pane... as in:
  10. Inline image 4
  11. Close and restart when prompted by Gephi
That's it -- this should install Gephi 0.8.2 with Streaming plugin properly..  Now you can follow the instructions from Tinkerpop site.

Hope this was helpful and save someone some headaches -- BTW: Thanks to Dylan and Stephen for assistance and patience.

S-

Stephen Mallette

unread,
Apr 17, 2016, 7:58:11 AM4/17/16
to Gremlin-users
If you'd like to offer these instructions in some form to enhance the reference documentation you could do so by cloning your fork and editing:


and then issuing a pull request - please target your PR against the tp31 branch of the repository so that it can be part of the version 3.1.3. 

Note that you will want to test your documentation changes to be sure everything is formatted properly.  You can do that by running this script from the root of the repository:

bin/process-docs.sh --dryRun

I think --dryRun is sufficient in this case as you aren't adding any code samples which need additional processing. Docs get generated to the /target/docs directory. 

--
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/CAO-_dxRFzN-FrRmiJ_EWyYscmGQrqwjWWB6g_bL115qEhRVTkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

ni...@knoldus.com

unread,
May 9, 2016, 10:29:10 AM5/9/16
to Gremlin-users
Hi Stephen,

I have successfully loaded graph in gephi, but let say i want to display result set in gephi based on my queries for example: display graph with vertices having property "name" and some value corresponding to it: graph.traversal().V().has('name','airport') should display a graph based on the result set.

Stephen Mallette

unread,
May 9, 2016, 10:31:22 AM5/9/16
to Gremlin-users
You would have to subgraph the result and then submit the subgraph to gephi:


ni...@knoldus.com

unread,
May 16, 2016, 4:53:19 AM5/16/16
to Gremlin-users
Hi Stephen ,

My gremlin server is running on EC2 and i am remotely connecting to it using gremlin console by executing this command : :remote connect tinkerpop.server remote.yaml

After successful connection when i query : :> graph and  :> g , i receive outputs for the same but whenever i do :> g.V() i get below exception:- org.apache.tinkerpop.gremlin.groovy.plugin.RemoteException: Response iteration exceeded the configured threshold for request [RequestMessage{, requestId=a532f234-2a1a-463e-840a-4c087065861e, op='eval', processor='', args={gremlin=g.V(), bindings={}, batchSize=64}}] - Serialization of the entire response exceeded the serializeResponseTimeout setting [Gremlin Server paused writes to client as messages were not being consumed quickly enough]
at org.apache.tinkerpop.gremlin.console.groovy.plugin.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:145)
at org.apache.tinkerpop.gremlin.console.commands.SubmitCommand.execute(SubmitCommand.groovy:41)
at org.codehaus.groovy.tools.shell.Shell.execute(Shell.groovy:104)
at org.codehaus.groovy.tools.shell.Groovysh.super$2$execute(Groovysh.groovy)
at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1210)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at org.codehaus.groovy.tools.shell.Groovysh.executeCommand(Groovysh.groovy:256)
at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:155)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1210)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
at org.codehaus.groovy.tools.shell.Interact




What is wrong here ?

Stephen Mallette

unread,
May 16, 2016, 6:25:41 AM5/16/16
to Gremlin-users
The error is pretty self-explanatory, no?  increase the server config setting for serializedResponseTimeout - your request for iterating all vertices is exceeding that timeout.

--
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.

ni...@knoldus.com

unread,
May 16, 2016, 6:33:05 AM5/16/16
to Gremlin-users
Hi Stephen,

Thanks for replying , i have one more question, how do we retrieve value sent to the gremlin server for example when i write :> x = 1 from my gremlin console then how do i retrieve its value back ? 

Stephen Mallette

unread,
May 16, 2016, 6:36:45 AM5/16/16
to Gremlin-users
sessionless requests will not preserve state on the server between requests, so you would have to connect with sessions:


On Mon, May 16, 2016 at 6:33 AM, <ni...@knoldus.com> wrote:
Hi Stephen,

Thanks for replying , i have one more question, how do we retrieve value sent to the gremlin server for example when i write :> x = 1 from my gremlin console then how do i retrieve its value back ? 

--
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.

ni...@knoldus.com

unread,
May 16, 2016, 6:45:48 AM5/16/16
to Gremlin-users
Is it possibe that i can write graphml on my local gremlin console by remotely accessing gremlin server ?

Stephen Mallette

unread,
May 16, 2016, 6:47:59 AM5/16/16
to Gremlin-users
your script executes remotely so you have to keep that in mind with whatever scripts your write in the console. you could write the graphml to a string or stream of bytes then return that to the console as the return value. on the console you could then write that return value to file, or read it in the console to tinkergraph or whatever. that should work.

ni...@knoldus.com

unread,
May 16, 2016, 6:58:50 AM5/16/16
to Gremlin-users
i can't figure out how do we return value back to console. 

Stephen Mallette

unread,
May 16, 2016, 7:16:07 AM5/16/16
to Gremlin-users
Maybe you're just missing it in the documentation - please re-read this section:


If your ultimate question here is really how to return GraphML from the server through the console then just do this:

gremlin> :remote connect tinkerpop.server conf/remote-objects.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :> g.E().subgraph('sg').cap('sg')
==>tinkergraph[vertices:6 edges:6]
gremlin> graph = result.get(0).getObject()
==>tinkergraph[vertices:6 edges:6]
gremlin> graph.io(graphml()).writeGraph('graph.graphml')
==>null
gremlin> :x

$ ls
bin  conf  data  ext  graph.graphml  lib
$ cat graph.graphml
<?xml version="1.0" ?><graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd"><key id="labelV" for="node" attr.name="labelV" attr.type="string"></key><key id="name" for="node" attr.name="name" attr.type="string"></key><key id="lang" for="node" attr.name="lang" attr.type="string"></key><key id="age" for="node" attr.name="age" attr.type="int"></key><key id="labelE" for="edge" attr.name="labelE" attr.type="string"></key><key id="weight" for="edge" attr.name="weight" attr.type="double"></key><graph id="G" edgedefault="directed"><node id="1"><data key="labelV">person</data><data key="name">marko</data><data key="age">29</data></node><node id="2"><data key="labelV">person</data><data key="name">vadas</data><data key="age">27</data></node><node id="3"><data key="labelV">software</data><data key="name">lop</data><data key="lang">java</data></node><node id="4"><data key="labelV">person</data><data key="name">josh</data><data key="age">32</data></node><node id="5"><data key="labelV">software</data><data key="name">ripple</data><data key="lang">java</data></node><node id="6"><data key="labelV">person</data><data key="name">peter</data><data key="age">35</data></node><edge id="7" source="1" target="2"><data key="labelE">knows</data><data key="weight">0.5</data></edge><edge id="8" source="1" target="4"><data key="labelE">knows</data><data key="weight">1.0</data></edge><edge id="9" source="1" target="3"><data key="labelE">created</data><data key="weight">0.4</data></edge><edge id="10" source="4" target="5"><data key="labelE">created</data><data key="weight">1.0</data></edge><edge id="11" source="4" target="3"><data key="labelE">created</data><data key="weight">0.4</data></edge><edge id="12" source="6" target="3"><data key="labelE">created</data><data key="weight">0.2</data></edge></graph></graphml>





ni...@knoldus.com

unread,
May 16, 2016, 9:00:13 AM5/16/16
to Gremlin-users
This is wht i've been trying to do ... but cant proceed further.

:remote connect tinkerpop.server conf/remote.yaml

:> g.E().hasLabel('livesIn').subgraph('subGraph').cap('subGraph')
==>tinkergraph[vertices:1482 edges:1428]
 
graph = result.get(0).getObject()
==>tinkergraph[vertices:1482 edges:1428]

graph.io(graphml()).writeGraph('graph.graphml')
No signature of method: java.lang.String.io() is applicable for argument types: (org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo$Builder) values: [org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo$Builder@70cccd8f]
Possible solutions: is(java.lang.Object), wait(), trim(), size(), size(), find()

Stephen Mallette

unread,
May 16, 2016, 9:03:05 AM5/16/16
to Gremlin-users
please read the documentation to understand how the console works and what the different configurations are. also please follow my instructions exactly....your command:

:remote connect tinkerpop.server conf/remote.yaml

is not the same as mine:

:remote connect tinkerpop.server conf/remote-objects.yaml





ni...@knoldus.com

unread,
May 17, 2016, 1:34:44 AM5/17/16
to Gremlin-users
Hi Stephen ,

remote-objects.yaml creates remote connection with gremlin-server running on the same machine . In my case my gremlin server is running on EC2 enivronment and i am remotely connecting to it via gremlin console which is present on my local machine. When i follow your above mentioned steps i get following error :-
No signature of method: java.lang.String.io() is applicable for argument types: (org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo$Builder) values: [org.apache.tinkerpop.gremlin.structure.io.graphml.GraphMLIo$Builder@160396db]
Possible solutions: is(java.lang.Object), wait(), trim(), size(), find(), any()

ni...@knoldus.com

unread,
May 17, 2016, 2:19:59 AM5/17/16
to Gremlin-users
Ok ... i figured it out but after using remote-objects.yaml when i extract subGraph i get this error and i am puzzled how to get out of it :
Server could not serialize the result requested. Server error - Error during serialization: Class is not registered: org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
Note: To register this class use: kryo.register(org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph.class);. Note that the class must be serializable by the client and server for proper operation.

Stephen Mallette

unread,
May 19, 2016, 6:56:09 AM5/19/16
to Gremlin-users
The code I provided works on an out-of-the-box Gremlin Server. Perhaps you should back up and try using that on localhost to validate that you can get it to work. If you feel like tinkering with your existing configurations, I would have a look at the serializer configurations on the client and server. They need to include lines like:



Basically, you need to make sure that the IoRegistry is set the same for client and server and should include the TinkerIoRegistry specifically (note that in the second link useMapperFromGraph also works as it "uses the IoRegistry from the graph called 'graph'" in that case)

Nitin Chand

unread,
May 24, 2016, 8:44:21 AM5/24/16
to gremli...@googlegroups.com
hi stephen ,

is it possible to extract subgraph from vertices ? 
something like g.V().hasLabel('lives').subgraph('subGraph') ?

--
You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/LIZ73bxZJcU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/CAA-H43_wuKTk0Rb3PwrQf5%3DS4P0mT2nraDRp9RhreUjxBGsxtg%40mail.gmail.com.

Stephen Mallette

unread,
May 24, 2016, 9:25:43 AM5/24/16
to Gremlin-users
no our subgraph functions are edge-induced only. You would have to sideEffect() vertices into a new graph manually if you wanted to do it with vertices.

Reply all
Reply to author
Forward
0 new messages