> For the complete documentation index, see [llms.txt](https://learn.coremodels.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.coremodels.io/knowledge-base/the-schema-creation-playbook.md).

# The Schema Creation Playbook

The process of creating a schema can be broken down into a series of logical steps. By following this methodology, you can transform a complex idea into a structured data model.

***

#### Step 1: Identify the 'Things' (Types)

Begin by identifying the main entities or objects in your system. What are the core "things" you want to define? These are the foundational building blocks of your schema and will become your Types.

Analogy: If you were planning a house, these would be the main rooms like the <mark style="color:$success;">Kitchen</mark>, <mark style="color:$success;">Bedroom</mark>, and <mark style="color:$success;">Bathroom</mark>.

Example: For a content website, the main "things" could be <mark style="color:$success;">Article</mark>, <mark style="color:$success;">Author</mark>, and <mark style="color:$success;">Comment</mark>.

***

#### Step 2: Define the 'Details' (Elements)

Once you have identified the core Types, determine the specific information or properties that belong to each one. These are the individual data fields that will make up each Type.

Analogy: This is where you decide what goes in each room, like a <mark style="color:blue;">sink</mark> and <mark style="color:blue;">oven</mark> in the <mark style="color:$success;">Kitchen</mark>.

Example: The <mark style="color:$success;">Article</mark> Type would have Elements like <mark style="color:blue;">Title</mark>, <mark style="color:blue;">Body</mark>, and <mark style="color:blue;">PublicationDate</mark>.

***

#### Step 3: Categorize the 'Details' (Taxonomies)

Review your Types and Elements to see if any of them need a predefined list of options. Instead of allowing for free-form text, using a set of fixed categories ensures consistency and simplifies organization.

Analogy: This is like creating a drop-down menu for the <mark style="color:blue;">RoomColor</mark> that only allows you to choose from a list of predefined options like <mark style="color:purple;">red</mark>, <mark style="color:purple;">white</mark>, or <mark style="color:purple;">blue</mark>.

Example: The <mark style="color:$success;">Article</mark> Type could have a <mark style="color:blue;">Topic</mark> Element that is linked to a Taxonomy with a predefined list of categories like <mark style="color:purple;">News</mark>, <mark style="color:purple;">Tutorial</mark>, and <mark style="color:purple;">Review</mark>.

***

#### Step 4: Establish the Connections (Relations)

Consider how your different Types relate to each other. How does a <mark style="color:blue;">Comment</mark> connect to an <mark style="color:blue;">Article</mark>? How is an <mark style="color:$success;">Author</mark> associated with a specific <mark style="color:$success;">Article</mark>? Defining these connections is crucial for building a cohesive data model.

Analogy: This is where you draw the lines on the blueprint, connecting a <mark style="color:$success;">Bedroom</mark> to the <mark style="color:$success;">Bathroom</mark> via a hallway.

Example: The <mark style="color:$success;">Article</mark> Type would have a Relation to the <mark style="color:$success;">Author</mark> Type, so each article can be linked to a specific author record.

Consider the default relations from CoreModels such as the 'DomainIncludes' (has-a), the 'SubClassOf' (is-a), and the 'RangeIncludes' (can-be). Or define the appropriate needed relations.

***

#### Step 5: Add Rules and Context (Mixins)

Finally, add rules, constraints, and other metadata to your schema. These are properties that describe your data structure but don't contain content themselves. They are essential for validation and control.

Analogy: These are the notes on the blueprint, specifying that a window must have a minimum size or a door must be fireproof.

Example: The <mark style="color:blue;">Title</mark> Element could have a 'required' Mixin to ensure no article is ever published without a title.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://learn.coremodels.io/knowledge-base/the-schema-creation-playbook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
