Schema Type Reference
Schema Type | Purpose | Definition Method | Key Fields |
---|---|---|---|
Schema | Entity data structures | Class inheritance or decorator | sl.String , sl.Float , sl.Timestamp , sl.IdField |
EventSchema | Behavioral data tracking | Class inheritance or decorator | Event-specific fields with timestamps |
IdSchemaObject | Identifier management | Specialized schema objects | Unique entity identification |
Schema Components Reference
Foundation components for schema definition and management:
Schema Implementation Guide
Schema Definition Methods
Schema Definition Methods
Field Types and Usage
Field Types and Usage
The schema system supports several built-in field types for different data categories, each optimized for specific data characteristics and space integration.
Field Type Implementation
Field Type Usage Examples
Field Type | Purpose | Usage Example |
---|---|---|
sl.String | Text data and categorical values | description: sl.String |
sl.Timestamp | Temporal data and dates | created_at: sl.Timestamp |
sl.Float | Floating-point numerical values | price: sl.Float |
sl.IdField | Unique entity identifiers | id: sl.IdField |
Schema Instantiation and Pipeline Integration
Schema Instantiation and Pipeline Integration
Schemas are instantiated to create pipeline objects that reference specific data entities and their fields, enabling type-safe data processing throughout the framework.
Pipeline Integration Flow
Data Parsing and Mapping
Data Parsing and Mapping
Event Schemas and Behavioral Modeling
Event Schemas and Behavioral Modeling
Event schemas capture behavioral data and interactions that can modify entity embeddings over time through the Event Effects System, enabling dynamic and adaptive recommendations.For detailed information about event schemas and behavioral modeling, see Event Schema documentation. For event effects implementation, see Event Effects System.
Event Schema Definition
Event-Entity Integration Flow
Event Effects Implementation
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:- Data Structure Definition: Establish the expected format and types of input data
- Type Validation: Ensure incoming data meets defined requirements at runtime
- Field Mapping: Map external data sources to internal schema representations
- Event Modeling: Support behavioral data tracking and dynamic embedding updates
- Framework Integration: Enable seamless interaction with spaces, indices, and queries
- Development Safety: Provide IDE support, autocomplete, and compile-time error detection