diff --git a/README.md b/README.md index 20c13c1..a8eb362 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,6 @@ This vocabulary is used by Neurobagel APIs to fetch available attributes and att When the Neurobagel graph data model is updated (e.g., if new classes or subclasses are created), this file should be regenerated by running: ```bash -python generate_nb_vocab_file.py +python helper_scripts/generate_nb_vocab_file.py ``` This will create a file called `nb_vocab.ttl` in the current working directory. diff --git a/helper_scripts/generate_dictionary_jsonschema.py b/helper_scripts/generate_dictionary_jsonschema.py new file mode 100644 index 0000000..ef8834f --- /dev/null +++ b/helper_scripts/generate_dictionary_jsonschema.py @@ -0,0 +1,11 @@ +# This is an example script for generating a JSON schema for the Neurobagel data dictionary model. +# Example usage: python generate_dictionary_jsonschema.py + +import json + +from bagel.dictionary_models import DataDictionary + +FPATH = "neurobagel_datadictionary.schema.json" + +with open(FPATH, "w") as f: + f.write(json.dumps(DataDictionary.model_json_schema(), indent=2)) diff --git a/helper_scripts/generate_graphdata_jsonschema.py b/helper_scripts/generate_graphdata_jsonschema.py new file mode 100644 index 0000000..f10727f --- /dev/null +++ b/helper_scripts/generate_graphdata_jsonschema.py @@ -0,0 +1,16 @@ +# This is an example script for generating a JSON schema for the Neurobagel graph data model (i.e., the model for a Neurobagel "Dataset"). +# Example usage: python generate_graphdata_jsonschema.py + +import json + +from bagel.models import Dataset + +FPATH = "neurobagel_graphdata.schema.json" + +with open(FPATH, "w") as f: + f.write( + json.dumps( + Dataset.model_json_schema(), + indent=2, + ) + ) diff --git a/generate_nb_vocab_file.py b/helper_scripts/generate_nb_vocab_file.py old mode 100755 new mode 100644 similarity index 100% rename from generate_nb_vocab_file.py rename to helper_scripts/generate_nb_vocab_file.py diff --git a/generate_neurobagel_example_jsonlds.sh b/helper_scripts/generate_neurobagel_example_jsonlds.sh old mode 100755 new mode 100644 similarity index 100% rename from generate_neurobagel_example_jsonlds.sh rename to helper_scripts/generate_neurobagel_example_jsonlds.sh