For OrientDB
You can set the multiplicity in the output / in the collection to the label. Example of setting the maximum 1 edge from Person to the company if the red label is "workFor":
ALTER PROPERTY Person.out_workFor NOT NULL ALTER PROPERTY Person.out_workFor MAX 1
You can also set a minimum with:
ALTER PROPERTY Person.out_workFor MIN 1
Thus, with min and max, he always has one and only one relation to the Company.
source share