通过Gremlin控制台将Titan图形数据库连接到Gephi [英] Connection of Titan graph DB to Gephi through Gremlin console

查看:146
本文介绍了通过Gremlin控制台将Titan图形数据库连接到Gephi的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过gremlin控制台连接到gephi(0.9.1).我的泰坦数据库中有一张图.我还在gephi中启用了流服务器.通过gremlin我执行了以下命令:

I am trying to connect to gephi(0.9.1) through gremlin console. I have a graph in my titan database. I also have the streaming server enabled in my gephi. And through gremlin i executed the following commands:

  1. :插件使用tinkerpop.gephi
  2. g = TinkerFactory.createModern()
  3. :远程连接tinkerpop.gephi

所有这些都工作正常.但是当我运行最后一条命令时:

All these worked fine.But when i ran the last command:

                      :> g

我遇到以下错误:

==>tinkergraph[vertices:6 edges:6]
16:07:16.783 [main] DEBUG groovyx.net.http.HTTPBuilder - POST http://localhost:8080/workspace0?format=JSON&operation=updateGraph
16:07:16.801 [main] DEBUG o.a.h.i.c.BasicClientConnectionManager - Get connection for route {}->http://localhost:8080
16:07:16.809 [main] DEBUG o.a.h.i.c.DefaultClientConnectionOperator - Connecting to localhost:8080
16:07:16.817 [main] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: default
16:07:16.822 [main] DEBUG o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context
16:07:16.826 [main] DEBUG o.a.h.c.p.RequestTargetAuthentication - Target auth state: UNCHALLENGED 
16:07:16.831 [main] DEBUG o.a.h.c.p.RequestProxyAuthentication - Proxy auth state: UNCHALLENGED
16:07:16.836 [main] DEBUG o.a.h.impl.client.DefaultHttpClient - Attempt 1 to execute request
16:07:16.840 [main] DEBUG o.a.h.i.conn.DefaultClientConnection - Sending request: POST /workspace0?format=JSON&operation=updateGraph HTTP/1.1
16:07:16.850 [main] DEBUG org.apache.http.wire -  >> "POST /workspace0?format=JSON&operation=updateGraph HTTP/1.1[\r][\n ]"
16:07:16.862 [main] DEBUG org.apache.http.wire -  >> "Accept: */*[\r][\n]"
16:07:16.868 [main] DEBUG org.apache.http.wire -  >> "Content-Length: 23[\r][\n]"
16:07:16.873 [main] DEBUG org.apache.http.wire -  >> "Content-Type: application/json[\r][\n]"
16:07:16.879 [main] DEBUG org.apache.http.wire -  >> "Host: localhost:8080[\r][\n]"
16:07:16.885 [main] DEBUG org.apache.http.wire -  >> "Connection: Keep-Alive[\r][\n]"
16:07:16.890 [main] DEBUG org.apache.http.wire -  >> "[\r][\n]"
16:07:16.895 [main] DEBUG org.apache.http.headers - >> POST /workspace0?format=JSON&operation=updateGraph HTTP/1.1
16:07:16.900 [main] DEBUG org.apache.http.headers - >> Accept: */*
16:07:16.905 [main] DEBUG org.apache.http.headers - >> Content-Length: 23
16:07:16.910 [main] DEBUG org.apache.http.headers - >> Content-Type: application/json
16:07:16.915 [main] DEBUG org.apache.http.headers - >> Host: localhost:8080
16:07:16.920 [main] DEBUG org.apache.http.headers - >> Connection: Keep-Alive
16:07:16.925 [main] DEBUG org.apache.http.wire -  >> "{"dn":{"filter":"ALL"}}"
16:07:16.935 [main] DEBUG org.apache.http.wire -  << "HTTP/1.1 404 Not Found[\r][\n]"
16:07:16.940 [main] DEBUG org.apache.http.wire -  << "Cache-Control: must-revalidate,no-cache,no-store[\r][\n]"
16:07:16.945 [main] DEBUG org.apache.http.wire -  << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]"
16:07:16.951 [main] DEBUG org.apache.http.wire -  << "Content-Length: 1277[\r][\n]"
16:07:16.956 [main] DEBUG org.apache.http.wire -  << "Server: Jetty(8.1.17.v20150415)[\r][\n]"
16:07:16.961 [main] DEBUG org.apache.http.wire -  << "[\r][\n]"
16:07:16.966 [main] DEBUG o.a.h.i.conn.DefaultClientConnection - Receiving response: HTTP/1.1 404 Not Found
16:07:16.971 [main] DEBUG org.apache.http.headers - << HTTP/1.1 404 Not Found
16:07:16.978 [main] DEBUG org.apache.http.headers - << Cache-Control: must-revalidate,no-cache,no-store
16:07:16.984 [main] DEBUG org.apache.http.headers - << Content-Type: text/html;charset=ISO-8859-1 
16:07:16.991 [main] DEBUG org.apache.http.headers - << Content-Length: 1277
16:07:16.996 [main] DEBUG org.apache.http.headers - << Server: Jetty(8.1.17.v20150415)
16:07:17.002 [main] DEBUG o.a.h.impl.client.DefaultHttpClient - Connection can be kept alive indefinitely
16:07:17.010 [main] DEBUG groovyx.net.http.HTTPBuilder - Response code: 404; found handler: org.codehaus.groovy.runtime. MethodClosure@2c768ada
16:07:17.020 [main] DEBUG org.apache.http.wire -  << "<html>[\n]"
16:07:17.024 [main] DEBUG org.apache.http.wire -  << "<head>[\n]"
16:07:17.029 [main] DEBUG org.apache.http.wire -  << "<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>[\n]"
16:07:17.039 [main] DEBUG org.apache.http.wire -  << "<title>Error 404 Not Found</title>[\n]"
16:07:17.043 [main] DEBUG org.apache.http.wire -  << "</head>[\n]"
16:07:17.048 [main] DEBUG org.apache.http.wire -  << "<body>[\n]"
16:07:17.052 [main] DEBUG org.apache.http.wire -  << "<h2>HTTP ERROR: 404</h2>[\n]"
16:07:17.057 [main] DEBUG org.apache.http.wire -  << "<p>Problem accessing /workspace0. Reason:[\n]"
16:07:17.062 [main] DEBUG org.apache.http.wire -  << "<pre>    Not Found</pre></p>[\n]"
16:07:17.068 [main] DEBUG org.apache.http.wire -  << "<hr /><i><small>Powered by Jetty://</small></i>[\n]"
16:07:17.074 [main] DEBUG org.apache.http.wire -  << "                                           [\n]"
16:07:17.079 [main] DEBUG org.apache.http.wire -  << "                                               [\n]"
 16:07:17.083 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.088 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.093 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.098 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.103 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.107 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.111 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.116 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.121 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.125 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.130 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.136 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.141 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.146 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.151 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.156 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.160 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.165 [main] DEBUG org.apache.http.wire -  << "                                                [\n]"
 16:07:17.170 [main] DEBUG org.apache.http.wire -  << "</body>[\n]"
 16:07:17.174 [main] DEBUG org.apache.http.wire -  << "</html>[\n]"
 16:07:17.178 [main] DEBUG o.a.h.i.c.BasicClientConnectionManager - Releasing connection org.apache.http.impl.conn.ManagedClientConnectionImpl@c1fca2a
 16:07:17.188 [main] DEBUG o.a.h.i.c.BasicClientConnectionManager - Connection can be kept alive indefinitely Not Found
 Display stack trace? [yN]

而且我经常得到:

 15:38:20.276 [Finalizer] DEBUG o.a.h.i.conn.DefaultClientConnection - Connection 0.0.0.0:60710<->127.0.0.1:8080 closed

我检查了打开的端口,还发现8080端口已打开.

I have checked for the opened ports, and i also found that 8080 port is opened.

推荐答案

请注意,自TinkerPop 3.2.1-SNAPSHOT起,直到最近,Gephi插件才与Gephi 0.9.x兼容.

Note that the Gephi Plugin was only recently made compliant with Gephi 0.9.x as of TinkerPop 3.2.1-SNAPSHOT a few days ago. As you are using Titan 1.0, I would guess that you have an older version. I would recommend going back to Gephi 0.8.x beta if you want everything to work seamlessly.

所有这些,您可能仍然可以使它正常工作. Gephi提供的默认工作空间不再是"workspace0"-现在从"1"开始索引.您可以执行以下操作来更改Gremlin遥控器使用的工作空间:

All that said, you might yet be able to get it to work. The default workspace that Gephi provides is no longer "workspace0" - it is now indexed starting at "1". You can change the workspace used by the Gremlin remote by doing:

:remote config workspace workspace1

这应该允许将数据发送到Gephi,并应在实验室"窗格中显示.您可能还没有可视化方面的问题.我发现在解决此问题时,没有将大小","x"和"y"属性自动设置为合理"的情况似乎阻止了可视化窗格显示顶点和边缘.我认为您需要将这些属性添加到要推到Gephi的任何图形中.我确实将补丁的大小设置为"10",并且将x/y设置为随机浮动-将它们全部设置为零/零(即相同的位置)无效.

That should allow the data to be sent to Gephi and it should show in the "laboratory" pane. You may yet have problems with the visualization. I found that while fixing this problem that not auto-setting the "size", "x" and "y" properties to "sensible" things seemed to prevent the visualization pane from displaying the vertices and edges. I think that you would need to add those properties to any graph you wanted to push across to Gephi. The patch I did set the size to "10" and the x/y were set to a random float - setting them all to to zero/zero (i.e. the same positions) did not work.

以上所有解决方法说明主要用于提供信息.在下载Gephi 0.8.x时,这可能是一件很容易的事,而您无需做很多额外的工作.

All of the above workaround instructions are mostly for informational purposes. That's probably a lot of extra work that you don't need to do when downloading Gephi 0.8.x is a pretty easy course of action.

这篇关于通过Gremlin控制台将Titan图形数据库连接到Gephi的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆