Open ehennestad opened 1 year ago
Two suggestions (when saving instances to jsonld):
add the version to the @type:
"@type": "https://openminds.ebrains.eu/core/v3/Person"
add a "custom" @version property
"@type": "https://openminds.ebrains.eu/core/Person",
"@version": "v3"
Not sure how to solve this correctly. Instances can be valid for types from multiple versions. Potentially the second one could be adjusted by providing a list? Still not sure. @openMetadataInitiative/openminds-developers your thoughts?
My 2 cents about this:
Adding it to the type is imho not the right place because the type doesn't specify the structure of the instance but "just" its type. This means that a person remains a person even if you change the representation of it.
I would argue that it is irrelevant with which version an instance has been created - the only important information is with which versions it is compatible (remember that schemes can stay the same across versions or might be backwards compatible). You could either add a property called "compatibleWith", ask to dynamically cross-validate against the corresponding JSON schemes or by storing the compatibility information externally. I would recommend not to add this information to the instance because it could cause a change of the instance information solely because a non-related event (the creation of a new version) has taken place. (Which could create confusion e.g. if you have scripts checking if the payload has changed). Keeping track of compatibility externally (e.g. via a central lookup map/index or a side-car file) on the other hand would make sense.
@olinux that means we would rather provide a convenience function (e.g. in the Python, Matlab packages) that could tell for an instance which openMINDS versions it can be used for?
When saving a metadata instance it might be good to also specify which version of schema was used to create the instance.
For example: I create an instance using the Person schema from the latest version of openMINDS and save it to a JSON-LD file. If I (or someone else) loads it at a later time,, it might be good to know which version was used to create it in order to re-create the metadata instance in its original form?