This repository hosts data models sourced from various projects within Sage. All data models included here must be publicly accessible.
These data models are generated using the CoreModels software (coremodels.io). This platform enables users to interact with data models visually, facilitating their creation and management. Once created, the data models are exported as .jsonld files, such as DUO-terms.jsonld, and pushed to this GitHub repository.
Future development efforts will focus on expanding the generation of core models across Sage in a jsonld format. This will enhance the interoperability and accessibility of data models within the organization.
These instructions provide a step-by-step guide to setting up and using the Schematic tool for managing data and schemas.
-
Create and activate a new conda environment: (not sure if this step is needed)
conda create -n 'schematicpy' python=3.10 conda init bash conda activate schematicpy
-
Install schematicpy:
pip install schematicpy
-
Download the configuration file:
wget https://raw.githubusercontent.com/Sage-Bionetworks/schematic/main/config_example.yml
- make changes to the configuration file - this only has to be done once
- Short term fix for version issue:
pip3 install ipython==8.18.1
schematic
echo $SCHEMATIC_SERVICE_ACCT_CREDS | base64 -d > creds.json
schematic manifest -c config.yml get -t 'test' -s
schematic schema convert DUO-terms.jsonld
Change location inside config.yml to the jsonld you want to create the template from.
# Location of your schema jsonld, it must be a path relative to this file or absolute
location: "DUO-terms.jsonld"
schematic manifest -c config.yml get -t 'test' -s -dt DUOTemplate
schematic manifest -c config.yml get -t 'test' -s -dt ProjectAllocationTable
schematic manifest -c config.yml get -t 'ProjectAllocationTable' -s -dt ProjectAllocationTable
schematic manifest -c config.yml get -t 'SizeTable' -s -dt SizeTable
schematic manifest -c config.yml get -t 'ChallengePlatform' -s -dt ChallengePlatform -o '/workspaces/core-models/challenges-manifests/ChallengePlatform.csv'
schematic manifest -c config.yml get -t 'ChallengeSubmissionType' -s -dt ChallengeSubmissionType -o '/workspaces/core-models/challenges-manifests/ChallengeSubmissionType.csv'
schematic manifest -c config.yml get -t 'ChallengeIncentive' -s -dt ChallengeIncentive -o '/workspaces/core-models/challenges-manifests/ChallengeIncentive.csv'
schematic manifest -c config.yml get -t 'ChallengeCategory' -s -dt ChallengeCategory -o '/workspaces/core-models/challenges-manifests/ChallengeCategory.csv'
schematic manifest -c config.yml get -t 'ChallengeContribution' -s -dt ChallengeContribution -o '/workspaces/core-models/challenges-manifests/ChallengeContribution.csv'
schematic manifest -c config.yml get -t 'Challenge' -s -dt Challenge -o '/workspaces/core-models/challenges-manifests/Challenge.csv'
schematic manifest -c config.yml get -t 'ChallengeInputDataType' -s -dt ChallengeInputDataType -o '/workspaces/core-models/challenges-manifests/ChallengeInputDataType.csv'
schematic manifest -c config.yml get -t 'EdamConcept' -s -dt EdamConcept -o '/workspaces/core-models/challenges-manifests/EdamConcept.csv'
python importcsv.py
- Make sure the directory is correct. If running in CodeSpace, make sure the directory is relative to your github environment (for example /workspaces/core-models/)
Each time you run codespace:
echo $SYNAPSE_AUTH | base64 -d > synapsecreds.json
To get informationa about an organization:
$ curl -X GET "https://repo-prod.prod.sagebase.org/repo/v1/schema/organization?name=SynapseDocs"
To list all organizations
curl -X POST "https://repo-prod.prod.sagebase.org/repo/v1/schema/organization/list" \
-H "Content-Type: application/json" \
-d '{}'
To delete an organization
curl -X DELETE "https://repo-prod.prod.sagebase.org/repo/v1/schema/organization/{id}"
To delete a schema
curl -X DELETE "https://repo-prod.prod.sagebase.org/repo/v1/schema/type/registered/{id}" \