In our application we manage some different kinds of relationships like
"factory" --produces--> "product"
We modeled this with OGM by creating the node entities and a relation entity. We created only one
Neo4jRepository for the realation.
My question is how to model and cope with complex identity. On first sight 2 relations are identical if start and end node are the same but in our case we added validity dates to the relation.
Each relation has a
The question is how and where to check if there is already a relation for a given date range or with an overlapping date range:
is there a elegant and efficient way to model this with OGM or Cypher and let Neo4J check for interfering identities?
or should we do this checks in the service layer (spring boot). in this case we have to query always all relations before we save a new one, right?
Thanks in advance