here is my scenario. I have a pre-defined data type structure for books. Just take it as an example for the sake of simplicity. The structure looks like the image below. It's a Labeled Property Graph and the information is self-explained. This data type structure is fixed, I cannot change it. I just use it.
When there is 1 book, let's call it Harry Potter, in the system, it might look like below:
So, the book has its own property (ID, Name,...) and also contains a field type MandatoryData
. By looking at this graph, we can know all information about the book.
The problem happens when I have 2 books in the system, which looks like this:
In this case, there is another book called Graph DB, with those information as highlighted.
The problem of this design is: we don't know which information belong to which book. For example, we cannot distinguish the publishedYear
anymore.
My question is: how to solve or avoid this problem? Should I create 1 MandatoryData
for each book? Could you propose me any design?
I'm using Neo4j and Cypher. Thank you for your help!
publishedYear
anymore." But in the graph model you have nodes and vertexes only. The information in one node does not belong to any other node. If you want any information to actually belong to the node, store it as an attribute in the node.