I understand that there is no point in trying to engineer a relational database into a graph database. They are both inherently different and thus their data should be organized differently.
However, I'm building a database documentation app using Neo4j. In this app, a user would be able to upload tables from a SQL database. One feature is that a user would be able to preview the first 10 rows of any table they choose.
My problem is: I don't know how to structure a relational database in my Neo4j database, such that I could write Cypher query to print out a table in relational format.
So far I tried:
(Database)-[HAS_TABLE]->(Ex_Table)
`–[HAS_FIELD]->(id) ––––––[HAS_CELL]->(1)
`–[HAS_FIELD]->(name)–––––[HAS_CELL]->(bob)
`–[HAS_FIELD]->(password)–[HAS_CELL]->(pass)
and
(Database)-[HAS_TABLE]->(Ex_Table)
`–[HAS_FIELD]->(id) –––––––\
`–[HAS_FIELD]->(name)–––(HAS_ROW)->({id:1,name:bob,password: pass})
`–[HAS_FIELD]->(password)––‘
Question: Are these correct? If so, how could I query Ex_Table using Cypher to print the first 10 rows? If not, how should I structure and query to get that result?
Note: I have to use a graph database.
