Hi,
Unfortunately I can't give you a perfect option. Each solution has
it's advantages and disadvantages:
1- It's a simple solution, but you have to use Select. To get the
neighbors at certain step, you could do something like this:
// Get the edges from all the steps
Objects totalExplode = graph.explode(theNode, theEdgeType, EdgesDirection.Any);
// Restrict the select to the explode result
Objects stepExplode = graph.select(theEdgeStepAttribute, Condition.Equal, theStepValue, totalExplode);
totalExplode.close();
// get the other nodes from the edges
Objects stepNeighbors = graph.Heads(stepExplode); // Or graph.Tails if the edges are incoming
stepExplode.close();
It's not the most efficient, but it's easy to implement and you
don't have to do the sort yourself.
2- This may be very efficient for some operations, but not so good for others. And I can not
recommend creating a huge amount of edge types that will grow even
more in the future. Expanding the schema requires lots of data
structures to keep the information available and some of them must
be cached at all time. That being said, it should work if you have
enough memory.
3- It's more complex, but I think that's the best solution too.
Best regards.
El dijous 24 d’abril de 2014 18:20:03 UTC+2, Kirell va escriure: