meta: provide "provenance" for the produced json schema
- Dominant language
- Python
- Stars
- 28
- Forks
- 37
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 9
Description
We should accompany converted schema in e.g. https://github.com/dandi/schema/tree/master/releases/1.0.0-rc1 with provenance information on the schema itself. ATM it is just present in the bot's commit messages in that repo, e.g. "DANDI Bot Publish model schemata as of dandi-cli 0.10.0-275-gcbdd48f". So I think we need to make a pydantic model `SchemaMeta` which would be something like
```python
class SchemaMeta(DandiBaseModel):
wasDerivedFrom: Optional[List[Software]] = Field(None, nskey="prov")
wasGeneratedBy: Optional[List[Activity]] = Field(None, nskey="prov")
hasMember: Optional[List[???to point to produced dandiset.json and asset.json]] = Field(None, nskey="prov")
```
where `Software` above is to be the `dandi-cli` or may be we could point more specifically to `models.py`? and then it would be used to produce `schema.json` and also the actual populated record e.g. in `_schema.yaml` (not the schema, but actual populated record; better location?) in the corresponding release folder.
So this would contain information about what version of dandi-cli contains that models.py . For more "pragmatic" usage of that information (e.g. for dandi-cli or dandi-api) to be able to let user know which version of dandi-cli is needed for some (newer) version of schema, we should produce some top level file (e.g. `metadata.json`) which would contain more readily "readable" extract across all versions, e.g.
```json
{
"releases": {
"1.0.0-rc1": {
"dandi-cli": {
"first": "0.9.0+1.g?????",
"release": "0.9.2",
"last": "0.11.0+8.g5330508"
}
}
}
```
which would get updated upon every regeneration. This would make it clear in which version(s) of dandi-cli any given schema version was "active". May be such information actually could/should be present/updated in the aforementioned SchemaMeta itself ?
WDYT @satra @jwodder ?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.