Knowledge Base

Schema Designer

Articles:

Schema Designer

Introduction

The Schema Designer in Ligantic allows users to effortlessly create and customise data structures, empowering them to tailor their solutions to their unique needs.

Schemas and Entities

Schema:

A Schema is the design or blueprint of the data structure. It defines the shape, format, and rules for the data that will be stored and managed. The Schema outlines the different types of data, their relationships, and the constraints or validations that should be applied.

Think of a Schema like the blueprint for a house. The blueprint specifies the number of rooms, their sizes, the layout, the materials to be used, and the overall structure of the house. The blueprint is the design, not the actual house itself.

Entity:

An Entity is a specific instance or occurrence of the data defined by the Schema. It represents a unique record or object that contains the actual data values, adhering to the structure and rules set by the Schema.

Continuing the house analogy, an Entity would be the actual physical house built based on the blueprint (Schema). Each house built is a unique Entity, with its own set of rooms, dimensions, and other details, all following the guidelines set by the original blueprint. For another example, let's consider creating a simple Ligantic Schema for storing information about people:

Schema:

- Person - Name (text) - Age (number) - Email (text)

Entities:

- Person 1: - Name: "John Doe" - Age: 35 - Email: "john.doe@example.com" - Person 2: - Name: "Jane Smith" - Age: 28 - Email: "jane.smith@example.com"

In this case, the Schema defines the structure of the "Person" data, including the fields (Name, Age, Email) and their data types. The Entities, on the other hand, are the specific instances of people, each with their own unique values for the defined fields. The Schema provides the blueprint, while the Entities represent the actual data records that adhere to that blueprint.

Schema Design

The Schema Designer gives you full control over the structure and shape of your data. You can define fields, data types, and relationships to create the perfect data shape for your solution.

Schemas allow you to design the structure and shape of your data. With the schema designer, you have control over the type and display of data in your solution.

Schemas in Your Menu

Every schema you create will automatically create an item on the left-hand menu of your Space. The name of the schema will be pluralised to represent the collection of data. For example, if you create a "Blog" Schema then you will see a "Blogs" menu item appear once you save the Schema.

ID

The Ligantic Platform automatically generates a unique ID for all new entities in a Schema.

Display Name

You can customise the display name of your schema using a template. You can place the name of a property between double curly braces to programmatically update the Display Name. This Display Name is then used in all instances when referencing the entity.

The default Display Name Template is {{id}}.

If you had a text property on a Schema called "Name" you might want to change the Display Name Template to {{name}} so that the Display Name shows more meaningful content:

This would then change the display:

Different Types of Schemas and Properties

Schemas can use of the following types of fields or inputs:

  • Text: The Text schema type allows you to store string data. You can configure the display to be a single-line text box, a multi-line textarea, or a dropdown select menu.
  • Number: The Number schema type allows you to store numeric data.
  • Date: The Date schema type allows you to store date and time data. You can configure the display to show just the date or to also include time.
  • Yes/No: The Yes/No schema type allows you to store boolean data. The display will be a checkbox.
  • File: The File schema type allows you to store file attachments. The display will show a file upload button. You can choose to allow multiple files, display a media preview, set the max size allowed, as well as set the allowed file types from Image, Audio, Video, Documents, Data, Code and Archive.
  • Content: The Content schema type allows you to store rich text data. The display will be a WYSIWYG editor. You can set the allowed Content Blocks and Marks.
  • Form: The Form schema type allows you to embed a form within your Schema. The display will show the form.
  • List: The List schema type allows you to store a collection of items. The display will show a list view.

Each of these schema types has related display configurations, such as a single-line text box, a multi-line textarea, or a dropdown select menu.

Components of the Schema Designer

    1. Name: This is an input field where you can enter a name for the new schema.

    2. Type: This is a dropdown menu that allows you to select the type of schema you want to create.

    3. Details: This section provides additional details about the schema, including an optional description and the ability to toggle whether to show it on the table view.

    4. Properties: This section allows you to add properties to the schema. Each property can be of the same types as the schema itself (Text, Number, Date, etc.), and you can configure the display settings for each property.

    5. Display Name Template: This is an input field where you can enter a template for the display name of the schema. You can use property names enclosed in double curly braces to dynamically update the display name.

    6. Add Property: This button allows you to add a new property to the schema. You can add as many properties as needed, and you can reorder them using the drag-and-drop handle.

    7. Create Schema: This button allows you to save and add the new schema to your Ligantic solution.

Powered by Ligantic