小编naw*_*oth的帖子

使用Gremlin在图中找到避开给定顶点列表的最短路径?

我需要使用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

但它似乎没有用.

请帮忙!!!

traversal graph neo4j gremlin

9
推荐指数
1
解决办法
3805
查看次数

如何使用neo4j和gremlin存储树结构

我想使用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代码.

graph neo4j graph-databases gremlin

4
推荐指数
1
解决办法
1336
查看次数

如何在Gremlin中链接命令?

以下命令有效

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)

为什么?

graph neo4j graph-databases gremlin

2
推荐指数
1
解决办法
1684
查看次数

标签 统计

graph ×3

gremlin ×3

neo4j ×3

graph-databases ×2

traversal ×1