This is the Gen3 data dictionary for the Australian Cardiovascular Disease Project.
The yamls and jsonschema is found in the dictionary/prod_dict folder.
This repository includes a dictionary/test_dict folder for testing purposes. You can convert the input_dd.yaml into jsonschema files without overwriting anything in the dictionary/prod_dict folder:
- Use the
dictionary/test_dictfolder to generate and validate your schema changes - Copy specific elements from
dictionary/test_dicttodictionary/prod_dictas needed - The
dictionary/prod_dict/acdc_schema.jsonfile is what will be used for deployment
To copy files between the test and production folders, you can use the provided scripts:
-
Copy from test to production:
bash dictionary/copy_to_prod.sh
-
Copy from production to test:
bash dictionary/copy_to_test.sh
The data model can be defined using Gen3SchemaDev's simplified YAML input language via the input_dd.yaml file. This approach is particularly useful for:
- Creating the main structure of the data model
- Defining links between nodes in a more readable format
For more information, see the Gen3SchemaDev README.
To set up the environment, run:
pip install poetry
poetry install
eval $(poetry env activate)- Copy prod_dict to test_dict
bash dictionary/copy_to_test.sh
When making changes to the data dictionary:
- Update the dictionary version in the
dictionary/test_dict/_settings.yamlfile - Bundle the schema using:
gen3schemadev bundle -i dictionary/test_dict -f dictionary/test_dict/acdc_schema.json
- To validate a folder of jsonschema YAML files, use:
gen3schemadev validate -y dictionary/test_dict
gen3schemadev validate -b dictionary/test_dict/acdc_schema.jsonFor more details, see the Gen3SchemaDev validation documentation.
- The dictionary can be visualised using Gen3SchemaDev.
gen3schemadev visualise -i dictionary/test_dict/acdc_schema.json- After validating and visualising the dictionary, copy it back to the prod folder:
bash dictionary/copy_to_prod.sh- Then commit and push the changes to github