我一直在关注管理系统,但有些事情仍然无法实现.基本上我想做的是:
它基本上就像映射图模式一样.
我尝试了一些东西,但我只获得了部分数据.
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) 我有一个具有多个级别的树,其中叶节点可能具有属性"count".我想计算每个子树的总计数,并将这些值缓存在每个子树的根节点中.这可能在Gremlin?
我想删除两个顶点之间的边,所以我的代码在java tinkerpop3中如下
private void removeEdgeOfTwoVertices(Vertex fromV, Vertex toV,String edgeLabel,GraphTraversalSource g){
if(g.V(toV).inE(edgeLabel).bothV().hasId(fromV.id()).hasNext()){
List<Edge> edgeList = g.V(toV).inE(edgeLabel).toList();
for (Edge edge:edgeList){
if(edge.outVertex().id().equals(fromV.id())) {
TitanGraph().tx();
edge.remove();
TitanGraph().tx().commit();
return;//Remove edge ok, now return.
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
是否有更简单的方法通过直接查询到该边缘并删除它来删除两个顶点之间的边缘?谢谢您帮忙.
我需要使用Gremlin找到两个节点(顶点)之间的最短路径,同时避免给定顶点的列表.
我已经有了:
v.bothE.bothV.loop(2){!it.object.equals(y)}.paths>>1
获得我的最短路径.
我正在尝试这样的事情:
v.bothE.bothV.filter{it.name!="ignored"}.loop(3){!it.object.equals(y)}.paths>>1
但它似乎没有用.
请帮忙!!!
给出以下图表:

node[5]与之相邻的节点weight > 50?node[5]与标签相邻的节点"knows",按重量排序?我坚持使用我的TitanDB,Django1.8和Mogwai0.7.7软件包.我在localhost dev机器上有Graph数据库titan/cassandra,在rexster gremlin web界面中创建错误查询后,我的Django Object Graph Mapper mogwai停止工作.Titan仍在工作,数据存在,但Django停止使用它.
文件"/Users/x/envs/graph/lib/python2.7/site-packages/rexpro/connectors/base.py",第281行,在close_transaction中引发exceptions.RexProScriptException("事务未打开")RexProScriptException:transaction不开放.
谷歌搜索后我发现这个bitbucked修复 但我不知道如何应用它.也许lib更新与pip ....请帮助.
我试图理解条件插入的这种模式是如何工作的:
g.V()
.hasLabel('person').has('name', 'John')
.fold()
.coalesce(
__.unfold(),
g.addV('person').property('name', 'John')
).next();
Run Code Online (Sandbox Code Playgroud)
折叠/展开的目的是什么?为什么这些是必要的,为什么这不起作用:
g.V()
.coalesce(
__.hasLabel('person').has('name', 'John'),
g.addV('person').property('name', 'John')
).next();
Run Code Online (Sandbox Code Playgroud)
折叠然后展开的模式对我来说似乎是多余的,但上述情况并没有产生相同的结果.
我使用OrientDB类型图.我需要Gremlin的语法来搜索相同的SQL LIKE运算符
LIKE 'search%' or LIKE '%search%'
Run Code Online (Sandbox Code Playgroud)
我已经检查过has和filter(在http://gremlindocs.com/中).但是必须确定使用type属性传递的确切值.我认为这与搜索逻辑不一致.
谢谢你的一切.
我在Gremlin shell上花了一个星期试图编写一个查询来获取所有传入和传出的顶点,包括它们的边缘和方向.我尝试了一切.
g.V("name","testname").bothE.as('both').select().back('both').bothV.as('bothV').select(){it.map()}
Run Code Online (Sandbox Code Playgroud)
我需要的输出是(只是示例结构):
[V { '名称': "测试名"}] ___ [啉{edge_name: "nameofincomingedge"}] ____ [V {名称: 'nameofconnectedvertex']
[V { '名称': "测试名"}] ___ [欧特{edge_name: "nameofoutgoingedge"}] ____ [V {名称: 'nameofconnectedvertex']
所以我只想得到1)具有确切名称的所有顶点,每个顶点的边缘(包括inE或outE类型)和连接的Vertex.理想情况下,我想得到他们的map()所以我得到完整的对象属性.我不关心输出风格,我只需要所有信息,所以我可以用它来操纵它.我需要这个训练我的Gremlin,但欢迎Neo4j的例子.谢谢!