> ## Documentation Index
> Fetch the complete documentation index at: https://docs.therootnetwork.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Schema Management

# Creating Schemas

Creating schemas is a two-step process. First, you must create the namespace which a schema will live under. A namespace contains a set of schemas that describe something in the same domain. For example the `http://schema.futureverse.com/tnl` the namespace will contain the Boxer, `Gloves`, `HairStyle` and `HairDye` schemas for [The Next Legends](https://thenextlegends.xyz/).

## Schema creation flow

<Info>
  We are creating a front-end experience to make this a lot easier instead of going through and making API calls.
</Info>

```mermaid
flowchart TD
  B{Has the namespace been created?}
  B -->|Yes| C{Is the schema already created?}
  B ---->|No| E[Create namespace]
  C --> |No| D[Create schema]
  C --> |Yes| F[Create new schema version]
  E --> C
```

### Create Namespace 🔒

A namespace can only be created if the namespace owner has been whitelisted under a domain.

<Warning>
  This functionality is in development. In the meantime, please contact the Customer Success team via [customersuccess@futureverse.com](mailto:customersuccess@futureverse.com) to access a namespace.
</Warning>

### Create Schema 🔒

<Info>
  A valid SIWE token with a signature must be set as the Authorisation Header.
</Info>

```graphql
mutation CreateSchema($input: CreateSchemaInput!) {
  createSchema(input: $input) {
    ... on CreateSchemaSuccess {
      id
      schema
      version
    }
    ... on CreateSchemaFailure {
      errors {
        message
      }
    }
  }
}
```

```json
{
  "input": {
    "id": "9ad55aa3-6870-4133-8433-285e6a648790",
    "namespace": "http://schema.futureverse.com/fv",
    "schema": "@prefix sh: <http://www.w3.org/ns/shacl#> .@prefix schema: <http://schema.org/> .@prefix fvp: <http://schema.futureverse.dev/fv#Asset> .@prefix rdf: <http://www.w3.org/2000/01/rdf-schema#> .@prefix xml: <http://www.w3.org/2001/XMLSchema#> .    fvp:Asset a rdf:Class, sh:NodeShape ;  sh:property [    sh:datatype xml:string ;    sh:maxCount 1 ;    sh:minCount 1 ;    sh:path fvp:id ;  ] .",
    "version": 1
  }
}
```

### Create a new Schema Version 🔒

When you create a new schema under a pre-existing schema entity it will create a new version.

To create a schema it is the same as [above](/asset-register/guides/schema-management/creating-schemas#create-schema). Ensure that the version is incremented by 1 otherwise, it will fail.
