MATIH Platform is in active MVP development. Documentation reflects current implementation status.
15. Workbench Architecture
Semantic Model Designer

Semantic Model Designer

The Semantic Model components at frontend/bi-workbench/src/components/SemanticModel/ provide a visual entity-relationship diagram (ERD) editor for designing and exploring semantic data models.


Components

ComponentFilePurpose
ERDViewerERDViewer.tsxInteractive ERD canvas with pan/zoom
ERDCanvasERDCanvas.tsxSVG canvas for entity rendering
EntityNodeEntityNode.tsxVisual entity box with columns
EntityDetailPanelEntityDetailPanel.tsxSide panel for entity properties
RelationshipLinesRelationshipLines.tsxSVG relationship lines with cardinality
SemanticModelDesignerSemanticModelDesigner.tsxFull designer with toolbar and panels

Types

// frontend/bi-workbench/src/components/SemanticModel/types.ts
interface SemanticEntity {
  id: string;
  name: string;
  displayName: string;
  columns: SemanticColumn[];
  position: { x: number; y: number };
  primaryKey: string[];
}
 
interface SemanticColumn {
  name: string;
  type: string;
  isPrimaryKey: boolean;
  isForeignKey: boolean;
  isNullable: boolean;
  description?: string;
}
 
interface SemanticRelationship {
  id: string;
  fromEntity: string;
  fromColumn: string;
  toEntity: string;
  toColumn: string;
  cardinality: 'one-to-one' | 'one-to-many' | 'many-to-many';
}

ERDViewer

The main ERD viewer provides:

  • Pan and zoom via mouse/trackpad
  • Entity selection with detail panel
  • Relationship line rendering with cardinality markers
  • Auto-layout using force-directed algorithms
  • Export to image

SemanticModelDesigner

The full designer view combines the ERD viewer with:

  • Entity creation and editing
  • Relationship definition
  • Column property management
  • Metric definition on entities
  • Integration with the SemanticApiClient for persistence