Skip to content

Commit

Permalink
add example scripts for creating data dict + graph data jsonschema
Browse files Browse the repository at this point in the history
  • Loading branch information
alyssadai committed Jan 29, 2025
1 parent 7048cba commit 07dcf91
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
11 changes: 11 additions & 0 deletions generate_dictionary_jsonschema.py
Original file line number Diff line number Diff line change
@@ -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))
16 changes: 16 additions & 0 deletions generate_graphdata_jsonschema.py
Original file line number Diff line number Diff line change
@@ -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,
)
)

0 comments on commit 07dcf91

Please sign in to comment.