The C3 AI Type System is a foundational component of the platform’s model-driven architecture. This powerful system provides a comprehensive framework for defining data structures, managing relationships between entities, and enforcing business rules within applications—enabling developers to create sophisticated, data-driven solutions with remarkable efficiency.Documentation Index
Fetch the complete documentation index at: https://devdocs-shaunak-branch.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
What is the C3 AI Type System?
The C3 AI Type System is a powerful abstraction layer that lets you define domain models that represent real-world entities and their relationships. Instead of designing software around specific data sources or manufacturers, you define abstract models that standardize how applications interact with real-world objects. For example, rather than writing separate code for different wind turbine brands, you can work with a unified wind turbine model. This approach decouples application logic from data sources, making it easier to integrate new systems and extend functionality without major rewrites.
The model-driven architecture is made possible by employing a domain-specific language that structures how you program around the models that are predefined in the C3 AI Type System.
Core concepts
The C3 AI Type System is built around several core concepts:Types
Classes that define the structure and behavior of domain entities. Types can represent physical assets (like turbines), abstract concepts (like maintenance schedules), or system components.
Fields
Properties that store data within a Type. Fields can be simple values (like strings or numbers) or references to other Types, creating relationships between entities.
Methods
Functions that define the behavior of a Type. Methods can perform calculations, transform data, or trigger actions based on business rules.
Mixins
Reusable components that can be combined with Types to add functionality. Mixins promote code reuse and modular design.
How the Type System works
The C3 AI Type System translates your high-level domain models into concrete implementations:- You define Types using a domain-specific language in
.c3typefiles - The platform validates your Type definitions for correctness
- The platform generates database schemas, APIs, and UI bindings based on your Types
- Your application interacts with these Types through a consistent interface
Benefits of the Type System
The C3 AI Type System provides several key benefits:Abstraction from technical details
You can define domain models without worrying about how they’re implemented in the database or API layer. The platform handles the technical details, allowing you to focus on business logic.WindTurbine Type with properties and relationships. The platform automatically creates the necessary database tables, API endpoints, and UI bindings.
Consistent data access
The Type System provides a consistent interface for accessing data, regardless of where it’s stored. You can query, create, update, and delete objects using the same patterns, whether the data is in a relational database, a NoSQL store, or an external system.Relationship management
The Type System makes it easy to define and navigate relationships between entities. You can define one-to-one, one-to-many, and many-to-many relationships, and the platform handles the underlying implementation.Sensor has a relationship to a WindTurbine and multiple SensorReading objects. You can navigate these relationships in either direction:
Business rule enforcement
The Type System allows you to define business rules and validations that are enforced consistently across your application. You can define constraints on fields, validation logic in methods, and event handlers that respond to changes.Type System components
The C3 AI Type System includes several components that work together to provide a comprehensive modeling framework:Class types
Class types define the structure and behavior of domain entities. They can be abstract (base classes that aren’t instantiated directly) or concrete (classes that can be instantiated).Fields
Fields define the properties of a Type. They can be simple values (strings, numbers, dates) or references to other Types.Methods
Methods define the behavior of a Type. They can be implemented in JavaScript, Python, or other supported languages.Schema versioning
The Type System supports schema versioning, allowing you to evolve your data model over time without breaking existing applications. You can add new fields, deprecate old ones, and migrate data between versions.Practical application
The C3 AI Type System is used across industries to model complex domains:- In energy, it models power plants, transmission networks, and consumption patterns
- In manufacturing, it models production lines, equipment, and quality metrics
- In healthcare, it models patients, treatments, and medical devices
- In finance, it models transactions, accounts, and risk factors
Related concepts
Class Types
Learn more about defining class types in the C3 AI Type System.
Fields
Explore how to define and use fields in your Types.
Methods
Understand how to implement behavior in your Types.