Gephi and subgraph visualizations

298 views
Skip to first unread message

Suriya Narayani

unread,
Jul 2, 2020, 8:17:14 PM7/2/20
to Gremlin-users
Hi,

I'm able to connect to Gephi from gremlin and visualize the whole graph. But how can we execute gremlin queries and view the resultant graph in gephi ? I created a subgraph but I don't see anything on gephi after submitting it , 
Example :
 gremlin> subgraph = g.E().has('type','xc')
gremlin> :plugin use tinkerpop.gephi
==>tinkerpop.gephi activated
gremlin> :remote connect tinkerpop.gephi workspace1 <ip> <port>
==>Connection to Gephi - http://<ip>:<port>/workspace1 with stepDelay:1000, startRGBColor:[0.0, 1.0, 0.5], colorToFade:g, colorFadeRate:0.7, startSize:10.0,sizeDecrementRate:0.33
gremlin> :> subgraph
==>false



Thanks
Suriya

Stephen Mallette

unread,
Jul 6, 2020, 7:04:55 AM7/6/20
to gremli...@googlegroups.com
This:

subgraph = g.E().has('type','xc') 

does not create a subgraph. That returns the list of edges that have the property "type" with a value of "xc". To be even more explicit, it actually constructs a Traversal object that gets that list and assigns it to "subgraph" and then the Gremlin Console evaluates "subgraph" sees it is a Traversal object and automatically iterates it for you.

 Please see the subgraph() step for more information on how to actually get a subgraph:


--
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/cfa9ea8f-2b2b-42a5-aa6c-1aa5047020eeo%40googlegroups.com.

Suriya Narayani

unread,
Jul 6, 2020, 8:56:10 PM7/6/20
to Gremlin-users
Stephen,

I followed the steps on the documentation to create subgraph,

gremlin> :remote connect tinkerpop.gephi workspace1 <ip> <port>
==>Connection to Gephi - http://<ip>:<port>/workspace1 with stepDelay:1000, startRGBColor:[0.0, 1.0, 0.5], colorToFade:g, colorFadeRate:0.7, startSize:10.0,sizeDecrementRate:0.33
gremlin> subgraph = g.E().hasLabel('xc').subgraph('subGraph').cap('subGraph').next()
20:44:58 WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(~label = xc)]. For better performance, use indexes
==>tinkergraph[vertices:40 edges:20]
gremlin> :> subgraph
==>tinkergraph[vertices:40 edges:20]
==>false

But still I don't see the resultant subgraph on Gephi. Please let me know if I'm missing something.

On Monday, July 6, 2020 at 4:04:55 AM UTC-7, Stephen Mallette wrote:
This:

subgraph = g.E().has('type','xc') 

does not create a subgraph. That returns the list of edges that have the property "type" with a value of "xc". To be even more explicit, it actually constructs a Traversal object that gets that list and assigns it to "subgraph" and then the Gremlin Console evaluates "subgraph" sees it is a Traversal object and automatically iterates it for you.

 Please see the subgraph() step for more information on how to actually get a subgraph:


On Thu, Jul 2, 2020 at 8:17 PM Suriya Narayani <suriya.ja...@gmail.com> wrote:
Hi,

I'm able to connect to Gephi from gremlin and visualize the whole graph. But how can we execute gremlin queries and view the resultant graph in gephi ? I created a subgraph but I don't see anything on gephi after submitting it , 
Example :
 gremlin> subgraph = g.E().has('type','xc')
gremlin> :plugin use tinkerpop.gephi
==>tinkerpop.gephi activated
gremlin> :remote connect tinkerpop.gephi workspace1 <ip> <port>
==>Connection to Gephi - http://<ip>:<port>/workspace1 with stepDelay:1000, startRGBColor:[0.0, 1.0, 0.5], colorToFade:g, colorFadeRate:0.7, startSize:10.0,sizeDecrementRate:0.33
gremlin> :> subgraph
==>false



Thanks
Suriya

--
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 gremli...@googlegroups.com.

Stephen Mallette

unread,
Jul 7, 2020, 7:02:40 AM7/7/20
to gremli...@googlegroups.com
What version of Gephi and Streaming Plugin are you using? This feature was last validated for Gephi 0.9.1 and Graph Streaming plugin 1.0.3.

I've not personally tried this functionality in a long time so it's possible something has broken in the integration. Has anyone tried this more recently to success or tried newer versions (i.e. Gephi 0.9.2 has been out for a while now)?

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/ef681b19-92ff-4798-9236-f536342329d6o%40googlegroups.com.
Message has been deleted

Suriya Narayani

unread,
Jul 7, 2020, 7:35:57 PM7/7/20
to Gremlin-users
Stephen,


I'm using Gephi 0.9.2 and Graph Streaming Plugin 1.0.3.

I also noticed an exception in gephi log -messages.log while submitting the subgraph :

gremlin>subgraph=g.E().hasLabel('contains').subgraph('subgraph').cap('subgraph').next()

gremlin> :> subgraph
==>tinkergraph[vertices:3786 edges:3775]


INFO [null]: Last record repeated 2 more times.

WARNING [org.gephi.streaming.api.GraphUpdaterEventHandler]: Edge added event ignored for edge 2gpp1-zqg8-3ifp-238k8: Target node 3510296 not found

INFO [org.gephi.streaming.api.GraphUpdaterEventHandler]: Unknown type org.gephi.streaming.impl.json.parser.JSONArray

java.lang.IllegalArgumentException: Unknown type org.gephi.streaming.impl.json.parser.JSONArray

        at org.gephi.graph.impl.TableImpl.checkSupportedTypes(TableImpl.java:181)

        at org.gephi.graph.impl.TableImpl.addColumn(TableImpl.java:59)

        at org.gephi.graph.impl.TableImpl.addColumn(TableImpl.java:43)

        at org.gephi.streaming.api.GraphUpdaterEventHandler.addNodeAttribute(GraphUpdaterEventHandler.java:343)

        at org.gephi.streaming.api.GraphUpdaterEventHandler.nodeAdded(GraphUpdaterEventHandler.java:292)

        at org.gephi.streaming.api.GraphUpdaterEventHandler.doHandleGraphEvent(GraphUpdaterEventHandler.java:156)

[catch] at org.gephi.streaming.api.GraphUpdaterEventHandler.handleGraphEvent(GraphUpdaterEventHandler.java:134)

        at org.gephi.streaming.api.CompositeGraphEventHandler.handleGraphEvent(CompositeGraphEventHandler.java:95)

        at org.gephi.streaming.impl.json.JSONStreamReader.parse(JSONStreamReader.java:336)

        at org.gephi.streaming.impl.json.JSONStreamReader.parse(JSONStreamReader.java:220)

        at org.gephi.streaming.impl.json.JSONStreamReader.processStream(JSONStreamReader.java:134)

        at org.gephi.streaming.server.impl.ServerOperationExecutor.executeUpdateGraph(ServerOperationExecutor.java:219)

        at org.gephi.streaming.server.impl.ServerControllerImpl.handle(ServerControllerImpl.java:230)

        at org.gephi.streaming.server.impl.jetty.StreamingServerImpl$ContextContainer.service(StreamingServerImpl.java:307)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)

        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)

        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)

        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)

        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)

        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)

        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)

        at org.eclipse.jetty.server.Server.handle(Server.java:370)

        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)

        at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)

        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)

        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)

        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)

        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)

        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)

        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)

        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)

        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)

        at java.lang.Thread.run(Thread.java:748)

WARNING [org.gephi.streaming.api.GraphUpdaterEventHandler]: Edge added event ignored for edge 2fled-zdt4-3ifp-14h1k: Target node 1888328 not found

INFO [org.gephi.streaming.api.GraphUpdaterEventHandler]: Unknown type org.gephi.streaming.impl.json.parser.JSONArray

java.lang.IllegalArgumentException: Unknown type org.gephi.streaming.impl.json.parser.JSONArray

        at org.gephi.graph.impl.TableImpl.checkSupportedTypes(TableImpl.java:181)

        at org.gephi.graph.impl.TableImpl.addColumn(TableImpl.java:59)

        at org.gephi.graph.impl.TableImpl.addColumn(TableImpl.java:43)

        at org.gephi.streaming.api.GraphUpdaterEventHandler.addNodeAttribute(GraphUpdaterEventHandler.java:343)

        at org.gephi.streaming.api.GraphUpdaterEventHandler.nodeAdded(GraphUpdaterEventHandler.java:292)

        at org.gephi.streaming.api.GraphUpdaterEventHandler.doHandleGraphEvent(GraphUpdaterEventHandler.java:156)

[catch] at org.gephi.streaming.api.GraphUpdaterEventHandler.handleGraphEvent(GraphUpdaterEventHandler.java:134)

        at org.gephi.streaming.api.CompositeGraphEventHandler.handleGraphEvent(CompositeGraphEventHandler.java:95)

        at org.gephi.streaming.impl.json.JSONStreamReader.parse(JSONStreamReader.java:336)

        at org.gephi.streaming.impl.json.JSONStreamReader.parse(JSONStreamReader.java:220)

        at org.gephi.streaming.impl.json.JSONStreamReader.processStream(JSONStreamReader.java:134)

        at org.gephi.streaming.server.impl.ServerOperationExecutor.executeUpdateGraph(ServerOperationExecutor.java:219)

        at org.gephi.streaming.server.impl.ServerControllerImpl.handle(ServerControllerImpl.java:230)

        at org.gephi.streaming.server.impl.jetty.StreamingServerImpl$ContextContainer.service(StreamingServerImpl.java:307)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)

        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)

        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)

        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)

        at org.eclipse.jetty.server.handler

Tejasri pavuluri

unread,
Jul 8, 2020, 7:59:41 AM7/8/20
to Gremlin-users
Hi Stephen,
We see this exception while trying to import subgraph.  Can you please let us know if this is some issue with the Graph streaming plugin?
============================================
g=graph.traversal()
subgraph=g.E().hasLabel('contains').subgraph('subGraph').cap('subGraph').next()
:> subgraph

===========================================================================

Tejasri pavuluri

unread,
Jul 8, 2020, 7:59:47 AM7/8/20
to Gremlin-users

Hi Stephen,

We see this exception while trying to  submit subgraph.
Please find the gremlin queries we tried:
=======
gremlin> :plugin use tinkerpop.gephi
==>tinkerpop.gephi activated
gremlin> :remote connect tinkerpop.gephi workspace1 <ip> <port>
gremlin>g=graph.traversal()
gremlin> subGraph=g.E().hasLabel('xc').subgraph('subGraph').cap('subGraph').next()
16:26:20 WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [(~label = xc)]. For better performance, use indexes
==>tinkergraph[vertices:208 edges:104]
:> subGraph
-------------------------------------------
INFO [org.gephi.streaming.api.GraphUpdaterEventHandler]: Unknown type org.gephi.streaming.impl.json.parser.JSONArray
INFO [null]: Last record repeated 3 more times.
 



Thanks
Tejasri

Stephen Mallette

unread,
Jul 9, 2020, 8:58:00 AM7/9/20
to gremli...@googlegroups.com
I validated operations with Gephi 0.9.2 and Streaming 1.0.3 but only jdk8 (jdk11 seems to have some issues that are Gephi related - UI wasn't rendering right, I didn't look into it).

As for your errors, I don't know what they mean offhand. For this one:

INFO [org.gephi.streaming.api.GraphUpdaterEventHandler]: Unknown type org.gephi.streaming.impl.json.parser.JSONArray
java.lang.IllegalArgumentException: Unknown type org.gephi.streaming.impl.json.parser.JSONArray

I imagine that there is a type you are using JanusGraph that isn't supported as a property type in Gephi. I'm not sure what it would be but I'd try to isolate that. if you are using a List or something, maybe Gephi won't handle that and you will need to wipe such data out of your subgraph before trying to render it.

As for this:

WARNING [org.gephi.streaming.api.GraphUpdaterEventHandler]: Edge added event ignored for edge 2gpp1-zqg8-3ifp-238k8: Target node 3510296 not found 

I assume you get that one as a result of the previous error. 




--
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/7f2ba49e-5561-4f4b-90e5-c417ceb78282o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages