0
votes

How to get a list of top edges from one edge using Java API?

I have a vertex with number of edges. I want to retrieve top 10 edges of a specific class ranked by a property in this edge. How to do this?

The edge class is HasEdge and the property I have is repetitions.

So, initial idea is to do a query against the vertex but how to get the top list of edges? vertes.query().??

1

1 Answers

1
votes

If MyVertex is the Vertex with number of HasEdge Edges and myProperty is the property used for the ranking, then this is the query needed:

select * from HasEdge order by myProperty desc limit 10 where out = #9:0

(MyVertex has RID #9:0 is assumed here, can be replaced by select ...)