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!



UPDATE
From the comments (by @AnhTriet):
After some clarification in the comments, I suggest the creation of a
MandatoryDatanode for each property in the database. Then you will connect a given book to variousMandatoryDatanodes, depending on the number of properties of the book.This way two books with the same author will be connected to the same MandatoryData node.
Since you cannot change the data model, I strongly recommend you to create a new
MandatoryDatanode for each new book added to the system.This way you will be able to get informations about the an specific book with queries like:
The model proposed in your question is not viable since has no way to identify the owner of an specific property, as indicated by you.