我目前正在为neo4j使用嵌入式python绑定.我目前没有任何问题,因为我的图表非常小(稀疏和高达100个节点).我正在开发的算法在图上涉及相当多的遍历,更具体地说是图上的DFS以及不同的子图.在未来,我打算在大图上运行算法(据说是稀疏的,有数百万个节点).
有与python /的Neo4j绑定的性能阅读不同的线程在这里,在这里,我不知道我是否应该已经切换到一些REST API客户端的Python(如bulbflow,py2neo,neo4jrestclient),直到我太远改变所有代码.
不幸的是,我没有找到任何综合的信息来源来比较不同的方法.
任何人都可以进一步了解这个问题吗?选择其中一个选项时,我应该考虑哪些标准?
我一直在关注管理系统,但有些事情仍然无法实现.基本上我想做的是:
它基本上就像映射图模式一样.
我尝试了一些东西,但我只获得了部分数据.
g.getIndexdKeys(<Vertex or Edge>);
//basic information. Doesn't seem to return any buildEdgeIndex() based indexes
mgmt.getVertexLabels();
// gets labels, can't find a way of getting indexes attached to these labels.
mgmt.getGraphIndexes(Vertex.class);
// works nicely I can retrieve Vertex indexes and get pretty much any
// information I want out of them except for information regarding
// indexOnly(label). So I can't tell what label these indexes are attached to.
mgmt.getGraphIndexes(Edge.class);
// doesn't seem to return any buildEdgeIndex() indexes. …
Run Code Online (Sandbox Code Playgroud) 我使用Titan 0.4.0 All,在Ubuntu 12.04上以共享VM模式运行Rexster.
我怎样才能正确删除使用Cassandra存储后端的Titan中的图形?
我试过了TitanCleanup.clear(graph)
,但它并没有删除所有内容.指数仍在那里.我真正的问题是我有一个我不想要的索引(它会崩溃每个查询),但是我了解Titan的文档,一旦创建了索引就不可能删除它.
论坛TinkerPop如何解决?是否要为Graph DB和相关技术框架指定标准?在这方面,TinkerPop在某种意义上被视为权威或先锋?通过TinkerPop主页我无法理解这些.谢谢.
在neo4j中实现多租户的最佳方式是什么?
我见过Tinkerpop和Spring Data.
我有多个客户端,我想将客户端信息存储在自己的数据库中以确保安全性.
我不想使用标签或索引来解决这个问题.
我想使用Java API来操作远程服务器上的图形,服务器实际上在localhost中托管.我用来连接服务器的代码是:
JanusGraphFactory.Builder b = JanusGraphFactory.build();
b.set("hosts", "[localhost]");
JanusGraph graph = b.open();
Run Code Online (Sandbox Code Playgroud)
但是在我运行程序之后,它抛出了这样的异常:
线程"main"中的异常java.lang.IllegalStateException:需要设置配置值:root.storage.backend
那么如何使用Java API连接到远程JanusGraph服务器?
所以,我在mac-osx上使用python3.2和灯泡,使用rexster和orientdb.细节:
orientdb - 从他们的页面下载标准
〜/工作区/ orientdb社区-1.7-RC1
运行服务器, ./bin/server.sh
database - orientdb database~/databases/orientdb/dev-db-01
rexster - 来自github git clone的标准结账git://github.com/tinkerpop/rexster.wiki.git~/ workspace /
配置/ rexster.xml:
...
<graph>
<graph-enabled>true</graph-enabled>
<graph-name>dev-db-01</graph-name>
<graph-type>orientgraph</graph-type>
<graph-location>local:*<path to...>*/databases/orientdb/dev-db-01</graph-location>
<properties>
<username>admin</username>
<password>admin</password>
</properties>
<extensions>
<allows>
<allow>tp:gremlin</allow>
</allows>
</extensions>
</graph>
...
Run Code Online (Sandbox Code Playgroud)
Python代码:
from bulbs.rexster import Graph
from bulbs.config import Config
config = Config("http://localhost:8182/dev-db-01/", username="admin", password="admin")
g = Graph(config)
Run Code Online (Sandbox Code Playgroud)
问题:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/rexster/graph.py", li ne 56, in __init__
super(Graph, self).__init__(config) File "/opt/local/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/bulbs/base/graph.py", line …
Run Code Online (Sandbox Code Playgroud) 我需要一些帮助来确认我的选择...并了解你是否可以给我一些信息.我的存储数据库是TitanDb和Cassandra.我有一个非常大的图表.我的目标是在后面的图上使用Mllib.
我的第一个想法是:使用Titan和GraphX,但我没有找到任何东西或正在开发中...... TinkerPop还没准备好.所以我看看Giraph.TinkerPop,Titan可以与TinkerPop的Rexster通信.
我的问题是:使用Giraph有什么好处?Gremlin似乎也在思考并分发.
非常感谢你解释我.我想我并不真正理解Gremlin和Giraph(或GraphX)之间的区别.
祝你今天愉快.
在我的系统中,我要求节点上的边数必须存储为顶点的内部属性以及特定传出边上的顶点中心索引.这自然要求我在所有数据加载完毕后计算节点上的边数.我这样做如下:
long edgeCount = graph.getGraph().traversal().V(vertexId).bothE().count().next();
Run Code Online (Sandbox Code Playgroud)
但是,当我将测试扩展到某些节点是"超级"节点时,我在上面的行中得到以下异常:
Caused by: com.netflix.astyanax.connectionpool.exceptions.TransportException: TransportException: [host=127.0.0.1(127.0.0.1):9160, latency=4792(4792), attempts=1]org.apache.thrift.transport.TTransportException: Frame size (70936735) larger than max length (62914560)!
at com.netflix.astyanax.thrift.ThriftConverter.ToConnectionPoolException(ThriftConverter.java:197) ~[astyanax-thrift-3.8.0.jar!/:3.8.0]
at com.netflix.astyanax.thrift.AbstractOperationImpl.execute(AbstractOperationImpl.java:65) ~[astyanax-thrift-3.8.0.jar!/:3.8.0]
at com.netflix.astyanax.thrift.AbstractOperationImpl.execute(AbstractOperationImpl.java:28) ~[astyanax-thrift-3.8.0.jar!/:3.8.0]
at com.netflix.astyanax.thrift.ThriftSyncConnectionFactoryImpl$ThriftConnection.execute(ThriftSyncConnectionFactoryImpl.java:153) ~[astyanax-thrift-3.8.0.jar!/:3.8.0]
at com.netflix.astyanax.connectionpool.impl.AbstractExecuteWithFailoverImpl.tryOperation(AbstractExecuteWithFailoverImpl.java:119) ~[astyanax-core-3.8.0.jar!/:3.8.0]
at com.netflix.astyanax.connectionpool.impl.AbstractHostPartitionConnectionPool.executeWithFailover(AbstractHostPartitionConnectionPool.java:352) ~[astyanax-core-3.8.0.jar!/:3.8.0]
at com.netflix.astyanax.thrift.ThriftColumnFamilyQueryImpl$4.execute(ThriftColumnFamilyQueryImpl.java:538) ~[astyanax-thrift-3.8.0.jar!/:3.8.0]
at com.thinkaurelius.titan.diskstorage.cassandra.astyanax.AstyanaxKeyColumnValueStore.getNamesSlice(AstyanaxKeyColumnValueStore.java:112) ~[titan-cassandra-1.0.0.jar!/:na]
Run Code Online (Sandbox Code Playgroud)
解决这个问题的最佳方法是什么?我应该简单地增加帧大小还是有更好的方法来计算节点上的边数?
从我看过的文章中,Neo4j实现了apache tinkerpop,这使我认为我可以使用gremlin python,而不是连接到gremlin服务器,我可以将python代码指向neo4j服务器,并将其视为gremlin服务器。
但是,我在网上找不到任何信息来显示如何执行此操作,因此我认为我可能误解了一些信息。
谢谢
亚历克斯
tinkerpop ×10
gremlin ×4
titan ×4
neo4j ×3
python ×3
bulbs ×2
rexster ×2
cassandra ×1
giraph ×1
graph ×1
janusgraph ×1
multi-tenant ×1
orientdb ×1
spark-graphx ×1