我需要使用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
但它似乎没有用.
请帮忙!!!
我想使用neo4j本地数据库和GremlinJava 存储以下目录树结构.
(ROOT)
/ \
Dir2 Dir3
/ \ \
Dir4 Dir5 Dir6
/
Dir7
我已经定义了一个方法StorePath(String path).
我想要的:当我使用path ="Root\Dir2\Dir4\Dir7"调用StorePath(path)时,数据应该存储如下
Root
/
Dir2
/
Dir4
/
Dir7
其中Root和Dir*是带有空白边的顶点.请帮我解决java代码.
以下命令有效
t = new Table(); g.V.as('id').as('properties').table(t){it.id}{it.map}
print t
Run Code Online (Sandbox Code Playgroud)
以下命令有效
t = new Table();
g.V.as('id').as('properties').table(t){it.id}{it.map}; print t
Run Code Online (Sandbox Code Playgroud)
以下命令不起作用
t = new Table(); g.V.as('id').as('properties').table(t){it.id}{it.map}; print t
Run Code Online (Sandbox Code Playgroud)
为什么?