radiocosmology/padloper

Add replacing vertices/edges with other vertices/edges (store id)

Opened this issue · 1 comments

Everything (edges & vertices) should have two new attributes:

  • active: a boolean that denotes whether or not this vertex/edge is active in the DB
  • a "replacement" pointer, pointing from the old element to whatever replaced it (old --> new). If active, this pointer should be null.
  • When replacing a vertex, there are two possible options for handling its relations with other vertices:
    1. Change what its edges point to (that is, change them so they point to the replacement node)
    2. Remove all the edges (deactivate, that is), and make clone edges (I feel like this will waste a lot of space in the long run).

I think Adam and I went with 1.

There are two options when disabling a component: a regular "disable" (set active to false), or a "replace", which disables and creates a replacement vertex.

When a vertex/edge is disabled, all DB queries should ignore it and skip over it (unless you are specifically looking for disabled vertices as well).

  1. While this feature has been implemented for vertices, it has not been implemented fully for replacing edges. Right now, a replaced edge doesn't point to the edge that replaced it.
  2. The replacement pointer attribute has a default value of '0' right now, it needs to be changed to a default value of 'null'.
  3. When replacing a property for a component, the id of the new property vertex is not added in the 'replacement' pointer attribute of the old property vertex.
  4. 'disable_uid' and 'start_uid' need to be added as attributes for both vertices and edges.