I want to add property constraint on a specific vertex label to disallow null values or insertion of a vertex without specific properties
I added the name property to the person vertex as below, so the person will not take other properties except name but I need to add constraint on the value so it can not be null
mgmt = graph.openManagement()
person = mgmt.makeVertexLabel('person').make()
name = mgmt.makePropertyKey('name').dataType(String.class).cardinality(Cardinality.SET).make()
mgmt.addProperties(person, name)
mgmt.commit()
The Problem is :
A vertex
with label person
requires existence of a name
property always. Or this vertex should not be created .
Is this achievable in janusgraph?