I am looking into using a graph db for a project that will require the modelling of relationships between relationships. For example a tie between A and B may be conditional on a tie between C and D.
I also need to model relationships between nodes and other relationships. Catalytic relationships may be a good example. Agent X accelerates the relationship between agents Y and Z. The relationships need to contain properties that describe the relationship.
I can produce a relational db to achieve this by making nodes and relationships inherit from the same type. So a table per type database structure has the primary key in the BaseType table and a one to one relationship with sub-type tables: Node and Relationship. The Relationship table then has three foreign keys to the BaseType table. One is its primary key and the other two make up the Source and Target of the relationship. One or both of the source and target can therefore be Relationship types.
But this contains many joins of small objects, which fits the description of databases that should perform best with a Graph DB.
Diagrams as requested - including an attempted solution.
My attempt to solve the problem by creating relationship nodes.
So the solution I propose here involves creating more nodes. I suppose this could work, but wonder whether I am making it unnecessarily complicated.
One final diagram - the relational db solution. This seems a little cleaner, but not as flexible as the Graph db approach. And perhaps not as efficient?