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.
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.
The saveNamespace function allows for creation or updating of a namespace. An oldName can be passed in as a parameter to
overwrite an existing namespace. schemaName is also optional and allows for setting of the schema name.
The saveRelationDefinition function creates or updates a relation definition. The namespace parameter is required and
corresponds to the namespace the relation definition is being added to. oldName and schemaName are optional and used
to update an existing relation definition and track schema version respectively.