-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MNT] Add example scripts for creating data dictionary + graph data J…
…SON schema (#427) * add example scripts for creating data dict + graph data jsonschema * move helper scripts into directory * update instruction on regenerating vocab file
- Loading branch information
Showing
5 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) | ||
) |
File renamed without changes.
File renamed without changes.