-
Notifications
You must be signed in to change notification settings - Fork 72
[SYNPY-1673] Add JSONSchema documentation, deprecate old classes #1262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andrewelamb
wants to merge
8
commits into
develop
Choose a base branch
from
SYNPY-1673
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f6939ea
deprecated the current JSONSchema services classes
andrewelamb 1fd81af
add docs for new JSON schema model classes
andrewelamb 718d8dc
deprecate services
andrewelamb 9ece441
[SYNPY-1673] Update jsonschema tutorial (#1260)
thomasyu888 284756b
fixed bug in store where id was overwritten incorrectly
andrewelamb a713940
replace schema.id with schema.uri
andrewelamb 5abe6b9
add links to ref docs
andrewelamb 2e176b3
fix c+P error
andrewelamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,19 @@ | ||
| # JSONSchema | ||
|
|
||
| Contained within this file are experimental interfaces for working with the Synapse Python | ||
| Client. Unless otherwise noted these interfaces are subject to change at any time. Use | ||
| at your own risk. | ||
|
|
||
| ## API Reference | ||
|
|
||
| ::: synapseclient.models.SchemaOrganization | ||
| options: | ||
| inherited_members: true | ||
| members: | ||
| - get_async | ||
| - store_async | ||
| - delete_async | ||
| - get_versions_async | ||
| - get_body_async | ||
| - fill_from_dict | ||
| - from_uri | ||
This file contains hidden or 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,19 @@ | ||
| # SchemaOrganization | ||
|
|
||
| Contained within this file are experimental interfaces for working with the Synapse Python | ||
| Client. Unless otherwise noted these interfaces are subject to change at any time. Use | ||
| at your own risk. | ||
|
|
||
| ## API Reference | ||
|
|
||
| ::: synapseclient.models.SchemaOrganization | ||
| options: | ||
| inherited_members: true | ||
| members: | ||
| - get_async | ||
| - store_async | ||
| - delete_async | ||
| - get_json_schemas_async | ||
| - get_acl_async | ||
| - update_acl_async | ||
| - fill_from_dict |
This file contains hidden or 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,17 @@ | ||
| # JSONSchema | ||
|
|
||
| Contained within this file are experimental interfaces for working with the Synapse Python | ||
| Client. Unless otherwise noted these interfaces are subject to change at any time. Use | ||
| at your own risk. | ||
|
|
||
| ## API Reference | ||
|
|
||
| ::: synapseclient.models.SchemaOrganization | ||
| options: | ||
| inherited_members: true | ||
| members: | ||
| - get | ||
| - store | ||
| - delete | ||
| - get_versions | ||
| - get_body |
This file contains hidden or 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,18 @@ | ||
| # SchemaOrganization | ||
|
|
||
| Contained within this file are experimental interfaces for working with the Synapse Python | ||
| Client. Unless otherwise noted these interfaces are subject to change at any time. Use | ||
| at your own risk. | ||
|
|
||
| ## API Reference | ||
|
|
||
| ::: synapseclient.models.SchemaOrganization | ||
| options: | ||
| inherited_members: true | ||
| members: | ||
| - get | ||
| - store | ||
| - delete | ||
| - get_json_schemas | ||
| - get_acl | ||
| - update_acl |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -21,16 +21,16 @@ By the end of this tutorial, you will: | |
| * You are familiar with [adding annotations](./annotation.md) to synapse entity. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Would also add that familiarity with |
||
|
|
||
|
|
||
| ## 1. Set Up Synapse Python Client and Retrieve Project | ||
| ## 1. Set Up Synapse Python Client | ||
|
|
||
| ```python | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=1-19} | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=1-10} | ||
| ``` | ||
|
|
||
| ## 2. Take a Look at the Constants and Structure of the JSON Schema | ||
|
|
||
| ```python | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=21-49} | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=13-40} | ||
| ``` | ||
|
|
||
| Derived annotations allow you to define default values for annotations based on schema rules, ensuring consistency and reducing manual input errors. As you can see here, you could use derived annotations to prescribe default annotation values. Please read more about derived annotations [here](https://help.synapse.org/docs/JSON-Schemas.3107291536.html#JSONSchemas-DerivedAnnotations). | ||
|
|
@@ -39,12 +39,12 @@ Derived annotations allow you to define default values for annotations based on | |
| ## 3. Try Create Test Organization and JSON Schema if They Do Not Exist | ||
| Next, try creating a test organization and register a schema if they do not already exist: | ||
| ```python | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=51-65} | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=43-59} | ||
| ``` | ||
|
|
||
| Note: If you update your schema, you can re-register it with the organization by assigning a new version number to reflect the changes. Synapse does not allow re-creating a schema with the same version number, so please ensure that each schema version within an organization is unique: | ||
| ```python | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=67-99} | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=61-94} | ||
| ``` | ||
|
|
||
| ## 4. Bind the JSON Schema to the Folder | ||
|
|
@@ -53,7 +53,7 @@ After creating the organization, you can now bind your json schema to a test fol | |
| When you bind the schema, you may also include the boolean property `enable_derived_annotations` to have Synapse automatically calculate derived annotations based on the schema: | ||
|
|
||
| ```python | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=101-108} | ||
| {!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=96-108} | ||
| ``` | ||
|
|
||
| <details class="example"> | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.