How can I model this use case?


I am new to Neo4j and Cypher. I am Using Neo4j Desktop On Windows and try to improve efficiency our internal operations.

The current relationship between the nodes is follows.


I thought at first the programming_Language nodes would be good enough to connect to the Project nodes, however since it depends on individual whether they actually use it or not. So I thought it is necessary to connect the Employee nodes to the Programming_Language nodes as well. Certainly, I can determine which employee have experience using Programming_Language, but I cannot determine which Projects they have used that Programming_Language on. Are there any good solution for modeling this use case?

Thanks in advance.

in RDF you would use a blank node: you would like to link the programming language to the relationship between Employee and Project, which ich not possible. You will have to introduce a node between Employee and Project. This could be some kind of project role:
Untitled graph
The programming language is then a tool that belong to the role.

Another possible way to view this -

In my example, I have used the name of the programming language as a Label i.e. a categorizing entity. So any entities labelled Java will get categorized under this label - programmers, programming languages - but they will be differentiated using other labels as well. A project and programming language is connected using a relationship.

In this model, we are assuming there is exactly one instance per programming language created and each instance of Programming language must have a unique label. Every project is then connected to this unique set of 'programming language' nodes and this way we can get all nodes using the same programming language. However, you may need to consider version differences etc. It can get very cumbersome to visualize when they are a large number of projects.

For employee, we assume the employee has various roles within various projects (like @Benoit_d has specified in their model). So we associate programmer roles with a project as well as an employee. This way an employee can be programming in one project, managing another (who knows?!!) and these can be kept separate.

Hope this helps.

Having the premise that any programmer can code in more that one programming language
A project must have "start date" and "end date" at least , then if you want to know What programmers are in active project and what language are they using in ? or What programmers are avaliable for a new Proyect? I'll really need more questions to resolve and then design the graph model

Hi Taichi,

it seems to be the same case as in this modelling advice

An email shouldn't be a relation between two person but an instance (=node) linked to those person.
As the same an employee is not connected to a project but to a task within the project. The project itself will be to big to make any differenciations: does any employee which had contact to the project competence in all tools used in the project?
Linking a tool to a task of the project instead of the project itself brings a finer granularity.