Replies: 2 comments 2 replies
-
I know I already asked this question somewhere, but I could not find it anymore. I suspect that it is a comment hidden in some issue or pull-request. IMO this is a design decision that is worth a discussion by itself. I hope it is fine for you. |
Beta Was this translation helpful? Give feedback.
-
Simply because by making the structure more predictable, we make it easier for consumers of the data. This may not make much sense from a relational model or graph database perspective, but for tree-based formalisms (JSON, YAML, Pydantic objects, ...) it's much harder for me as a user of data to defensively code against having the data be in two different possible shapes. The current design also makes the mapping to json-schema more predictable (see existing discussions about supporting Referential Integrity in json-schema) Some of this could be obviated by using some alternative to Pydantic that takes care of automated de-referencing. In fact this is possible using a LinkML ObjectIndex. See for discussion. But this doesn't help if a consumer of the JSON/YAML I produce isn't using that.
This is totally reasonable. LinkML is designed for a variety of use cases. Perhaps in some scenarios the flexibility is a major win, and there are fewer concerns with making the shape of the data less predictable - it sounds like this is true for you. In slack you provide two solutions:
On reflection, I agree and linkml-map would be overkill for this (but there may be other scenarios that complicate the picture - e.g. having the id be optional). Remaining questions:
|
Beta Was this translation helpful? Give feedback.
-
According to the documentation, you can currently compose objects (also known as aggregates) from other objects by either referencing the constituent objects or embedding (inlining) them.
Why is this design so exclusive? I want the flexibility to specify that constituents can be either inlined or referenced, allowing for conversion between the two formats.
Here's an example to illustrate my goal:
In the end, if the constituent has the right range, what is the difference between inlining and referencing?
Beta Was this translation helpful? Give feedback.
All reactions