-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve identity of records and other structural values #363
Comments
Note that this is similar to what is needed to persist such a structure into a relational system. JPA etc. address this issue with various kinds of relationship annotations. For example, see: https://www.javatpoint.com/jpa-creating-an-entity. |
More precisely, if you convert that structure to a string in JSON format and then parse that string back into a structure, your graph structure will have been turned into tree: the identity (===-ness) of the class values has not been preserved. |
This relates to #338. We do not want to preserve the identity of all records: only those that represent "entities". For example, in the linked example |
This also relates to #354. One big issue is primary keys, which are in effect a mechanism to give records an identity within a particular context. |
This also relates to #159, since BVN should provide a way to maintain graph structure of anydata. |
We can provide a layer on top of JSON to allow graph structure to be preserved by using: |
YAML's data model is a graph, so that might be another way to allow graph structure to be preserved. |
We should look at JDO and also at ODMG ODL (which JDO developed from). I think we may well need something like the extent concept. |
I think the key comment you've made is the one about entities vs. records. Not all records are entities, that is, records which need to have identity on their own right (which is what #338) is about. Once we can distinguish between them we need to address how to map entities to JSON / YAML / SQL Tables etc.. |
Suppose I have:
And assume that multiple Student records values refer the same Class. (I need to model it this way because I can't create the whole class at once - I create it and then add students to it. (See https://github.com/sanjiva/Staffing/blob/master/src/services/types.bal for a real example.)
The above record can't be json'ed as-is.
We need some way to represent references across records in a network transportable way.
The text was updated successfully, but these errors were encountered: