Suggestions for data modelling in Neo4j -
i'm trying figure out how model scenario in neo4j.
i have "product" node name attribute. problem name attribute can several variations across different languages should reference same node.
i want able search across name , of variations reference 1 node.
.eg.
name: banana variation: banano variation: banane etc.
nodes:
food {id: 1, name: "banana"}
translation {id: 1000, name: "banane", language: "french"}
relationship
(:food)<-[:similar_to]-(:translation)
i'm looking more efficient work index fast search.
any suggestions on how best model scenario ?
here example of can do:
(:product {id: 1})-[:has_name]->(:name {name:"banana", lang:"en"}) " -[:has_name]->(:name {name:"banane", lang:"fr"}) " -[:has_name]->(:name {name:"banano", lang:"it"}) (:product {id: 1})-[:similar_to]->(:food)
you can create uniqueness constraint on :product id
, , index on :name name
.
this way, can find localized names specific product, , find products have specific name.
Comments
Post a Comment