Search code examples
amazon-web-servicesgremlingraph-databasesamazon-neptune

One to One Relationship in AWS Neptune DB


While mapping a relational OO model, I came across a scenario wherein it is required to maintain a One-to-One relation between vertices. Is it possible to restrict the cardinality of edges using labels in AWS Neptune the way it is done from Vertex Properties? Well, this would be quite helpful when there is an update in the relationship.


Solution

  • As it stands today, the only constraints for Property Graph provided by Neptune include:

    • Each vertex/edge must have a unique ID that is global to the full set of vertices and the full set of edges. IDs can be any string value.
    • Each vertex and edge must have a label. If you don't supply one, a vertex is given a label of "vertex" and an edge is given a label of "edge".
    • Properties on vertices can be either sets or of single cardinality. Edge properties, on the other hand, can only be of single cardinality.