The Schema System provides typed data structure definitions that serve as contracts for data flowing through the Superlinked framework. Schemas define the structure, field types, and relationships of entities processed by spaces, indices, and queries, ensuring type safety and data integrity throughout the pipeline. For information about how schemas integrate with vector embeddings, see Space System. For query definition and execution, see Index and Query System.

Schema Type Reference

Schema TypePurposeDefinition MethodKey Fields
SchemaEntity data structuresClass inheritance or decoratorsl.String, sl.Float, sl.Timestamp, sl.IdField
EventSchemaBehavioral data trackingClass inheritance or decoratorEvent-specific fields with timestamps
IdSchemaObjectIdentifier managementSpecialized schema objectsUnique entity identification

Schema Components Reference

Schema Implementation Guide

Key Features

Schema components provide:
  • Type Safety: Strong typing and validation for all data fields with Python type annotation integration
  • Flexibility: Support for various data types and structures with both inheritance and decorator patterns
  • Event Handling: Specialized schemas for time-based event data and behavioral analytics
  • Data Integration: Seamless parsing and mapping from external data sources like DataFrames and JSON
  • Framework Integration: Native support for spaces, indices, and query operations
  • Validation: Automatic data validation and error handling at both compile-time and runtime
Schema definitions serve as the foundation for all data processing operations in Superlinked. Properly defined schemas ensure optimal performance, data integrity, and type safety throughout the entire pipeline.

Schema System Concepts

Schemas handle:
  1. Data Structure Definition: Establish the expected format and types of input data
  2. Type Validation: Ensure incoming data meets defined requirements at runtime
  3. Field Mapping: Map external data sources to internal schema representations
  4. Event Modeling: Support behavioral data tracking and dynamic embedding updates
  5. Framework Integration: Enable seamless interaction with spaces, indices, and queries
  6. Development Safety: Provide IDE support, autocomplete, and compile-time error detection