Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-26-2021 04:34 PM
I think one of the most difficult challenge is to capture colloquially "has " or "has a" relationship to proper verb based relationship.
My scenario is like following:
A Test is like an exam. Test consists of multiple questions.
User/Student takes a test, but answers individual questions.
This is the fundamental problem (capturing 'has a') bugging me. Any help would be appreciated.
09-26-2021 11:32 PM
Remember that relationships are best if we define them as verbs.
You are already answering your question. We can name the relationship as test HAS question, or test INCLUDES question, or test CONTAINS question. These are options, of course there are more valid ones that you can search by synonyms. At the end it all depends on the questions you want to answer and if it easier for you queries' understanding.
By creating relationships from a test to many questions, you are already representing such relationship. If you want to create a questions array of some test, you can include the nodes "Question" in an array using the function collect()
.
09-27-2021 12:03 AM
@alejandropuerto
The issue is that I was reading a book on graph data modeling and it mentioned that "has a" is not an ideal relationship. Relationship in a Graph database must be a verb.
09-27-2021 08:41 AM
That is why I mentioned alternatives, such as: INCLUDES, CONTAINS, COMPRISES, COMPREHENDS, etc. I hope these alternatives suits your model.
All the sessions of the conference are now available online