Syncleus / Ferma

An ORM / OGM for the TinkerPop graph stack.
http://syncleus.com/Ferma
Apache License 2.0
136 stars 26 forks source link

When the same adjacencies are set edges are dropped and recreated #27

Closed freemo closed 6 years ago

freemo commented 6 years ago

When a set operation is performed on an adjacency it always drops all existing edges then recreates them. However if the vertex in a set operation are already adjacencies those edges should be preserved.

freemo commented 6 years ago

After further investigation I've decided this can't really be solved the way we planned. All current edges will be dropped and recreated. If an edge is to be preserved then remove and add forms of these methods can be called instead.

The reason for this is any solution that preserves existing edges needs to do one of two things:

1) Create an in-memory collection to hold all the edges to be deleted or preserved calculated by iterating through the existing edges.

2) the graph will have to be edited in place with edges flagged for deletion.

Since we want to keep the code generic enough to be capable of operating on large graphs that can't fit in memory #1 can be ruled out as a viable option. Option #2 would be slow so if we decide to implement it down the road it would have to be turned on/off through an annotation option. We would also need to redesign the system to add some sort of configurable prefix to use so as to avoid namespace clashes with user's existing properties. So if this is implemented in the future it would be as a new feature and not a bug fix anyway.

In conclusion, it's a feature not a bug!