Ontology Builder
The Ontology Builder at frontend/data-workbench/src/components/OntologyBuilder/ provides a visual canvas for designing data ontologies with object types, properties, and relationships.
Components
| Component | File | Purpose |
|---|---|---|
OntologyCanvas | OntologyCanvas.tsx | Main canvas with SVG rendering |
ObjectTypeNode | ObjectTypeNode.tsx | Visual object type box |
ObjectTypeDialog | ObjectTypeDialog.tsx | Create/edit object type dialog |
LinkLine | LinkLine.tsx | Relationship line rendering |
PropertyPanel | PropertyPanel.tsx | Property configuration panel |
Toolbar | Toolbar.tsx | Canvas toolbar (add, delete, layout) |
Types
// frontend/data-workbench/src/components/OntologyBuilder/types.ts
interface ObjectType {
id: string;
name: string;
displayName: string;
description?: string;
properties: Property[];
position: { x: number; y: number };
color?: string;
}
interface Property {
id: string;
name: string;
type: 'string' | 'number' | 'boolean' | 'date' | 'reference';
required: boolean;
description?: string;
}
interface OntologyLink {
id: string;
sourceId: string;
targetId: string;
label: string;
cardinality: 'one-to-one' | 'one-to-many' | 'many-to-many';
}OntologyCanvas
Features:
- Drag-and-drop object type creation
- Property editor with type selection
- Relationship drawing by connecting nodes
- Auto-layout algorithms
- Zoom/pan controls
- Export to OWL/RDF formats
- Integration with
OntologyApiClient