I am designing a database schema diagram for a Neo4j database. This is what I have so far:


This is the cypher code:

  (`0` :Person {FirstName:'string',LastName:'string',DOB:'long'}) ,
  (`1` :Address ) ,
  (`2` :`Phone Number` {Number:'string'}) ,
  (`3` :Record {Description:'string',Date:'long'}) ,
  (`5` :Association {Type:'string',Name:'string',`Nature Of`:'string'}) ,
  (`0`)-[:``Lived At`` {StartDate:'long',EndDate:'long'}]->(`1`),
  (`0`)-[:`Has` {StartDate:'long'}]->(`2`),
  (`0`)-[:`Had` {StartDate:'long',EndDate:'long'}]->(`2`),
  (`3`)-[:`References` ]->(`1`),
  (`3`)-[:`References` ]->(`0`),
  (`3`)-[:`References` ]->(`2`),
  (`0`)-[:`Has` {StartDate:'long'}]->(`5`),
  (`0`)-[:``Found At`` {Date:'long'}]->(`1`),
  (`0`)-[:``Lives At`` {Date:'long'}]->(`1`),
  (`0`)-[:`Had` {StartDate:'long',EndDate:'long'}]->(`5`),
  (`3`)-[:`References` ]->(`5`)

One of the domain requirements is that a person can be related to a person. How do I represent this relationship in my database diagram?

  • I'm not familiar with cypher, but I would imagine it to be a loop from Person to Person. Guess: (0)-[:References ]->(0) – Lennart Jul 10 '18 at 5:23
  • Is it possible to place two copies of person object to the diagram? if so, do it and add proper relation(s). – Akina Jul 10 '18 at 5:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.