I have defined in my schema constraints to ensure uniqueness of given vertices based one or more properties. For example:
mgmt.buildIndex('byTenandIdUnique',Vertex.class).addKey(tenantId).unique().buildCompositeIndex()
As expected now, when I try to add a Vertex that already exists, I am getting an error like below:
aiogremlin.exception.GremlinServerError: 500: Adding this property for key [tenantId] and value [ACME2_AX2] violates a uniqueness constraint [byTenandIdUnique]
I am writing a Python application to load log files, with Goblin OGM, so it is expected that the data will repeat, and I don't want multiple instances of the same Vertex, hence the constraint.
Is there a way in TinkerPop or JanusGraph to update a Vertex in case it already exists instead of throwing this exception? Or is this something that the OGM should handle or maybe the code itself by querying the graph before any transaction?