Closed ghost closed 7 years ago
As you correctly mentioned the Node instance is discarded in the Neo4JSession.loadVertex() method. It is not possible to keep the Node instance in memory since maintaining the data in sync with the modifications performed on the Vertex will have a high cost in performance and in code complexity.
Is there any specific reason that you require the Node instance?
Yes, I would like to use the Neo4j algorithms, and they only accept the Node type.
I would like to use the Neo4j optimiz d Dijkstra and A* algorithms.
There might be a better alternative, but I’m still new to Neo4j and TinkerPop, so I just don’t know it yet.
Take in consideration you are working with a remote graph, executing an algorithm on client side that requires loading large number of nodes has a big performance penalty. Consider using a CYPHER statement that returns the data you need and posible executing the algorithm on the server using this protocol.
I thought this is the behavior by default.
Obviously, I wouldn’t want to load all nodes into client memory.
I’ll look into running a CYPHER command server-side.
Thank you.
In the TinkerPop Neo4jVertex class there is the getBaseVertex() method, which returns the inner Neo4jNode, which allows me to get at the Node object using Neo4jNodeImpl.
From what I can see, the implementation for Neo4JSession.loadVertex() uses the Node object to create the Neo4JVertex instance and then discards the Node object.
Any way to get to the original Node object?