I would like to implement a deeply nested 3rd-party JSON schema in TypeDB, and struggling to determine the best way to do it. I would like to conform to the JSON schema as closely as possible, and avoid things like flattening it (which would entail renaming duplicate properties in different child objects, and generally creating a big unwieldy mess). My current thinking is to implement each nested JSON object as a TypeDB object, however I have two questions:
- In order to insert a relationship between parent and child pairs, I need to match on some unique info. However many of the child objects don’t have any unique data, so I’ll need to add some unique data to match on (eg a common UUID across parent and children). Is this the best way to do it?
- To link the parents and children together I would insert a “has_propertyname” relationship (eg “has_metadata”) with “parent” and “child” roles. Is this the best way to do it?