pietermartin / sqlg

TinkerPop graph over sql
MIT License
240 stars 51 forks source link

Support multiplicity on edges #456

Closed pietermartin closed 1 year ago

pietermartin commented 2 years ago

Add multiplicity constraints on edges. i.e. Make it possible to specify the in and out edge multiplicity.

hand[1,1] -> finger[0,5] This says that a hand can have zero to five fingers but not more than 5. A finger must have 1 hand.

pietermartin commented 2 years ago

Decided against implementing this directly in Sqlg. Doing this in Sqlg requires keeping track of all the edge count in the VertexLabel tables and updating them for inserts and deletes. This clutters the db with count column and has a significant performance impact.

Instead Sqlg add support for the user to manually count the edges. I.e. the edge multiplicity responsibility is moved up the stack to the user.

pietermartin commented 1 year ago

Done in Sqlg 3.0.0