Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/371.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java GremlinPipeline使用Titan和OrientDB返回不同的结果_Java_Shortest Path_Gremlin_Orientdb_Titan - Fatal编程技术网

Java GremlinPipeline使用Titan和OrientDB返回不同的结果

Java GremlinPipeline使用Titan和OrientDB返回不同的结果,java,shortest-path,gremlin,orientdb,titan,Java,Shortest Path,Gremlin,Orientdb,Titan,我正在使用以下代码尝试使用GremlinPipeline查找最短路径: final GremlinPipeline<String, List> pathPipe = new GremlinPipeline<String, List>(v1) .as("similar") .both("similar") .loop("similar", new PipeFunction<LoopBundle&l

我正在使用以下代码尝试使用
GremlinPipeline
查找最短路径:

final GremlinPipeline<String, List> pathPipe = new GremlinPipeline<String, List>(v1)
            .as("similar")
            .both("similar")
            .loop("similar", new PipeFunction<LoopBundle<Vertex>, Boolean>() {
                //@Override
                public Boolean compute(LoopBundle<Vertex> bundle) {
                    return bundle.getLoops() < 5 && bundle.getObject() != v2;
                }
            })
            .path();
Iterator iter = pathPipe.iterator();
    while(iter.hasNext()) {
        System.out.println(iter.next());
    }
(4是v1的id,8是节点2的id)

但是当我将上面的代码用于orientDB数据时,我得到了不同的结果,例如

[v[#9:0], v[#9:0], v[#9:0]] 
[v[#9:0], v[#9:0], v[#9:1]]  
[v[#9:0], v[#9:0], v[#9:45]] 
[v[#9:0], v[#9:0], v[#9:55]]
(#9:0是v1的id,#9:1是v2的id)

请注意,我使用以下代码打印结果:

final GremlinPipeline<String, List> pathPipe = new GremlinPipeline<String, List>(v1)
            .as("similar")
            .both("similar")
            .loop("similar", new PipeFunction<LoopBundle<Vertex>, Boolean>() {
                //@Override
                public Boolean compute(LoopBundle<Vertex> bundle) {
                    return bundle.getLoops() < 5 && bundle.getObject() != v2;
                }
            })
            .path();
Iterator iter = pathPipe.iterator();
    while(iter.hasNext()) {
        System.out.println(iter.next());
    }

编辑:我使用orientdb-1.6.1、titan 0.4.1、blueprints-core-2.5.0和blueprints-orient-graph-2.5.0

您能报告blueprints和orientdb版本吗?我建议在NonTx中运行,以查看错误是否相同。只需使用OrientGraphNoTx。我使用了OrientGraphNoTx,但输出是相同的。你知道哪个结果是正确的吗?(或者这两个结果都是可能的答案?)