Implementing a Schema
To implement a schema, you can simply create a YAML or JSON file that defines the schema and make a saveSchema
call via API or SDK. Or, use the other schema
management functions to create, update, and delete schemas, namespaces, and relation definitions.
Install SDK
Import and initialize Management SDK
Save (create or update) a schema
The saveSchema
function allows for creation or updating of a schema. If the schema already exists, the upgrade
parameter determines whether the existing schema will be overwritten entirely.
This code shows how to save the schema defined in a given file (YAML/JSON). An example of this schema file can be found in the Define Schema page.
Delete a schema
The deleteSchema
function deletes an existing schema, including all relations.
Load a schema
The loadSchema
function returns the current project's schema.
Next
We'll move on to creating relations.