Hi, I'm learning graph modeling with Neo4j and pretty new to few concepts. I have this doubt and not sure how to word it properly so unable to search in Google. Would appreciate all your help in this.
I see that have few options in modeling a feature of particular thing, for ex. features of iPhone in product hierarchy. I can have the feature as a property, another one is to have the feature as a relatonship (and the node being just "Yes") and 3rd one being have the feature as a separate node with relation "has_feature" to the main node.
I'm trying to understand the difference between these 3 and how they impact things down the line. As per the O'Reilly Graph Database book email example and "strong-weak" relations, it is better modeled as either a relation or a separate node. Is that usually the case? Can anyone direct me to resources that explain the difference between these?
The No.2 design is not good.
You need a new relationship name for each new feature.
For example, what if You want to separate camera types?
Also, '(Yes)' is a node that cannot be labeled.
Anyway, I change the model of the graph depending on what kind of search I want to do.
Welcome to the Dark Side: Neo4j Worst Practices (& How to Avoid Them)
Graph Modeling Guidelines
However, to clarify, a Node is useful once it has either a label or a property such as name. So an attribute isn't mapped to a Node, but the label of the node or one of the properties of the node. Likewise, for a Relationship, although we call it a Type instead of a label, and I am fairly sure only one type per Relationship is allowed. Of course you can have multiple relationships between two Nodes. In summary, you can map an attribute to a:
Relationship Type (similar to Label)