How to get the properties of the shortest path between 2 vertexes

I am using Java, and I want to get the property" name "of each vertex of the shortest path between #26:1 and #24.0 . I am using the sql command select dijkstra (#26:1,#24.0,"distance") from V. And I get the result OResultSet. I dont know how the get the rid of each vertex in my java program (I mean OVertex or ORID of each vertex : objects offered by orientdb in my java program) .

enter image description here

Upvotes: 0

Views: 72

Answers (1)

Max Kukuškin
Max Kukuškin

Reputation: 23

try to do it with following code:

String query3 = "SELECT dijkstra (#26:1, #28:1, 'valeur') FROM V";

OResultSet rs3 = db.query(query3);

while(rs3.hasNext()) {
      OResult row = rs3.next();
      String rid= row.getProperty("@rid");
}
rs3.close();

For more information, you can look for in official java-api

I hope it will help you!

Upvotes: 1

Related Questions