Schema Editor
The Schema Editor is a tool for editing the structure of ontology entities and relationships in various ways. It supports three modes: visual UI-based editing, direct JSON editing, and bulk registration via CSV files.
Editing Mode Overview
| Mode | Purpose | Best For |
|---|---|---|
| UI Mode | Visually edit entities and relationships | Small-scale schema design, structure review |
| JSON Mode | Write schemas directly as JSON text | Precise schema control, copy/paste of existing schemas |
| CSV Mode | Bulk register entities and relationships via CSV files | Registering large numbers of entities/relationships at once |
Click the tabs at the top of the editor to switch modes. Content written in one mode is preserved when switching to another mode.
UI Mode
Edit schemas using the same visual interface as the Ontology Builder.
Editing Entities
- Click an entity node on the canvas to select it.
- In the right properties panel, you can edit the following items:
- Name: Entity label (e.g.,
Person,Product) - Description: A description of the entity
- Property List: Property names, data types, required status
- Name: Entity label (e.g.,
Editing Relationships
- Click a relationship (arrow) on the canvas to select it.
- In the properties panel, you can edit the following items:
- Relationship Type: Relationship name (e.g.,
PURCHASED,WORKS_FOR) - Direction: Source → Target direction
- Property List: Properties to assign to the relationship
- Relationship Type: Relationship name (e.g.,
JSON Mode
Write or modify the ontology schema directly in JSON format. This is useful when pasting schemas written externally, or exporting an existing schema, modifying it, and reapplying it.
JSON Schema Structure
{
"entities": [
{
"name": "Customer",
"description": "Customer information",
"properties": [
{ "name": "id", "type": "STRING", "required": true },
{ "name": "name", "type": "STRING", "required": true },
{ "name": "email", "type": "STRING", "required": false }
]
}
],
"relationships": [
{
"type": "PURCHASED",
"source": "Customer",
"target": "Product",
"properties": [
{ "name": "purchase_date", "type": "DATE" }
]
}
]
}
Key Features
- Syntax Validation: Displays syntax errors in real-time as you enter JSON.
- Auto-completion: Auto-completes keywords such as property types (
STRING,INTEGER,FLOAT,BOOLEAN,DATE). - Import/Export: Export the current schema as a JSON file, or import an external JSON file.
entities[].name, relationships[].type, relationships[].source, and relationships[].target are required fields. Omitting them will result in a validation error.
CSV Mode
Upload CSV files to bulk register entities and relationships. This allows you to quickly apply large schema definitions created in spreadsheets.
Entity CSV Format
| Column | Required | Description |
|---|---|---|
entity_name | Y | Entity name |
property_name | Y | Property name |
property_type | Y | Data type (STRING, INTEGER, FLOAT, BOOLEAN, DATE) |
required | N | Whether required (true/false, default false) |
description | N | Property description |
Relationship CSV Format
| Column | Required | Description |
|---|---|---|
relationship_type | Y | Relationship type name |
source_entity | Y | Source entity name |
target_entity | Y | Target entity name |
property_name | N | Relationship property name |
property_type | N | Relationship property type |
Upload Procedure
- Select the CSV tab in the editor.
- Click the Upload Entity CSV or Upload Relationship CSV button.
- Review the preview of the uploaded data.
- Click the Apply button to reflect it in the schema.
When uploading a CSV, if an entity or relationship with the same name already exists, the properties will be merged. Existing properties are preserved and only new properties are added. If overwriting is needed, delete the existing items first.