A hyper-edge is a graph construct that is a relationship with 3 or more endpoints. Neo4j does not have these, but I would like to fake one in Neo4j.
The idea would follow this example of modeling a contract:
Can anyone recommend an approach, even different from mine?
Solved! Go to Solution.
Okay, an addional thought came to me over the weekend. Every member (node) connected to a hyper-edge node could share a label that marks it as a member of that relationship. Then a trigger can be defined for every member, so that any changes on any of the hyper-edge members would trigger a lookup of the ContractHyperEdge itself, and cause it to do the contract enforcement check. If it fails, the transaction fails, whether it was invoked on the ContractHyperEdge or on any of the member nodes. The label they all share would not be needed for indexed lookups; the only reason for giving them the same label is so that a query can quickly identify the 'rest' of the contract members, using only traversal--all one hop away from the ContractHyperEdge.
And the label--let's say it's named "PhotoShareContract"--can be used broadly across the database on many different contracts without conflict. Even if one person has multiple contracts of the same name with different people, the 3 relationships connecting them can hold a property shared only by those 3...perhaps a combination of date and contract participant ids.