Proper design for the address

14 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Sukaant Chaudhary

belum dibaca,
21 Jun 2018, 22.04.0721/06/18
kepadane...@googlegroups.com
Hi,
I've designed a graph for address as shown in the picture, but I'm seeing a problem here,
A Person Node will have the Address Node, Address Node will have the Country Node.
It will be fine till here.
Now, A Country will have many States, so my graph is failing here on-wards to get the complete address till PostalCode Node.
If I design in reverse direction say Address Node is connected to PostalCode Node, but Still same City Name may be shared with multiple states.
Can any one help me to correct my design in such a way that I'll get the complete address of each person by traversing the graph.







-Sukaant Chaudhary

Russ Burkert

belum dibaca,
22 Jun 2018, 11.51.3022/06/18
kepadane...@googlegroups.com
Sukaant
Advise download a copy of the O'Reilly book "Graph Databases".  Look at the Model Facts as Nodes section in Ch 4.  Numerous ways to model it, but one way that appeals to me is like this:
MERGE (a:Addr {street:"xxxxxxxxx", type: "Work"})
with a
MERGE (a)-[:COUNTRY]->(c:Country {name:"USA"})
MERGE (a)-[:STATE]->(s:State {name:"Ca"})
MERGE (a)-[:CITY]->(c:City {name:"Inglewood"})
MERGE (a)-[:POSTAL_CODE]->(z:PCode {name:"90266"})

Since your model has a Person node, assumption is the business requirements are Person centric.  Example:
What customers work in a given zip code?
What patients live in Florida?
Those would be trivial matches given the above data model.  However, if your queries are geo centric, then it probably would not be a good fit:  Example:
What cities are in Florida?


--
You received this message because you are subscribed to the Google Groups "Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to neo4j+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Balas ke semua
Balas ke penulis
Teruskan
0 pesan baru