2016-09-01 1 views
0

以下のコードは正しい結果を得ていません。間違っていますか?orientdbのdijkstra関数がtinkerpop APIと連携していません

OrientGraph graph = factory.getTx(); 

for (OrientVertex v : (Iterable<OrientVertex>) graph.command(
       new OCommandSQL("SELECT dijkstra(#97:1334, #97:1335, 'calculated_length') FROM STRUCTURE")).execute()) { 
         System.out.println("Path " + (ORID)v.getId()); 
        } 

私が直接クエリを実行すると、正しい結果が得られます。ありがとう。

+0

お役に立てば幸いですか! –

+0

orientdb-community-2.2.7 –

答えて

3

私はこのコードを使用し、それが

String query = "select expand(dijkstra) from (SELECT dijkstra(#21:0, #24:0, 'calculated_length') FROM STRUCTURE limit 1)"; 
Iterable<OrientVertex> it = g.command(new OCommandSQL(query)).execute(); 
for (OrientVertex v : it) { 
    System.out.println("Path " + (ORID)v.getId());  
} 

を働いていたが、それはあなたが使用しているorientDbのバージョンは何

+0

ありがとう、それは を働かせます。 –

関連する問題