How to Handle Dynamic Relationships

Hi all.

I am in the process of modeling the relationships between executives of different companies. This data will be updated fairly frequently on an ongoing basis. I took a look at the Panama Papers GraphsGist as an example but am still stumped on what is the better strategy on modeling current and past positions.

For instance, if Mike Schmidt is the current CEO of Davis Autos, and the former CEO of Richmond Carriage Company, is it best to describe the relationship to Richmond Carriage Company as FORMER_CEO or use a general CEO relationship and note in the properties that it is a former role.

Many thanks!


I would say FORMER_CEO is a better approach as that is more descriptive and it would make the Cypher query a little bit easier to write and more readable to others. I can't remember where exactly but I watched a tutorial either on the Neo4j YouTube channel or on the Neo4j Graph Academy with a similar scenario. If you proceed with the general CEO relationship that wouldn't be too bad either, but then you'd have to use a WHERE clause to look up the former role property and that may slow down your query.

And as far as updating your graph database, I'm also at a point too where I need to come up with a way to update my graph database on a periodic basis with fresh data. Deleting and creating a new graph database is just not scalable for us. Maybe this thread will be relevant to you once you get to that point:

Additionally, I learned that Neo4j is in the process of replacing Kettle with Apache Hop as the project management tool so you can give that a shot as well:

On-Demand Webinar

Analyzing Data Orchestration Lineage with Neo4j

Best of luck!


1 Like