New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does't neo4j support node-set? #13455
Comments
Hi @flyly0755! In neo4j a relationship must be connected to exactly 2 nodes. However, you can have multiple labels which makes it easy to "group" nodes. Let's say you want to create a mother and a father which are parent of a child. You could create two relationships like this:
if you then would like to find both parents, you could do that with the query:
So, you can't have more than two nodes per relationship - but you can use multiple labels for your nodes and pattern matching to find all relationships to a given node. Does this help you? Please let me know if I have misunderstood your question/feature request. |
@LinneaAndersson yes, a node can with multiple labels, which can be very useful. This is related with geometry(point, edge and so on), maybe what i think above is not feasible with geometry foundation:) |
@flyly0755 Ok, now I think I understand your question/feature-request 👍 I will add it as a feature request. The only thing I can come up with that you could do today, is that you could create a node which is the node-set (in this case it would then be to create family nodes): Or in cypher:
|
Thanks for the feature request. I will close this issue now and we will let you know when we have more information. Please let me know if there is anything else we can help you with. |
@flyly0755 does the suggested model work for your use-case? (that is: to create a node which represents the node-set) Is there something a node-set can provide than a node representing a node-set can not? |
thank you so much for your detailed explain, yeah, which is great, everything is represented as point to point relationship:) |
At the same time, I think of another question, the relationship between child and parents, now with neo4j is triangle model(3 points, 3 edges). But is there a new represention like T model? showed as below:
|
Usually parents-child relationship with 3 nodes(father, mather, child):
fatherX---father-child_relation--->childX,
MatherX---mather-child_relation--->childX,
FatherX---huaband-wife_relation--->MatherX,
Is there super node-set conception or similar function which can combine sub-nodes?
For example: super node-set ParentX with sub-nodes fatherX and matherX, so only need just one relation with child like:
ParentX---parent-child_relation--->ChildX
And even create super node-set familiyX with sub-nodes fatherX, and matherX, ChildX and so on.
The text was updated successfully, but these errors were encountered: