C3 AI Documentation Home

Add and Update Entities in the Object Model

Add and update entities

The entities in the Object Model are the C3 AI Types that make up your application's data model. Each entity defines a category of data your application stores and operates on — its fields, its relationships to other entities, and the methods that act on it. Adding an entity extends your data model with a new Type so that you can integrate, store, relate, and analyze a kind of data that the model does not yet describe.

You typically add an entity when you need to:

  • Model a part of your business domain that has no Type yet, such as Customer, Order, or Asset.
  • Create a target for integrated data. Before you can map and load a source (a database table, a streaming source, or an uploaded file) into the platform, a Type must exist to receive the records. The new entity becomes that destination in a Data Integration pipeline.
  • Establish relationships. Once the entity exists in the Object Model, you can connect it to other entities through primary and foreign keys, which is what the ERD visualizes.
  • Enable platform behaviors such as normalized time series or machine learning features by mixing in the appropriate template (described below).

When you add an entity, Data Fusion writes a new C3 AI Type into the root package of your application. The Type becomes part of the live data model immediately: it appears as a node in the Object Model (grid, list, and Diagram views), it is available as a mapping target in Data Integration, and you can define fields, relationships, and methods on it or preview its data from the Type Detail panel. Like edits to an existing entity, a new entity persists in the running application until someone upgrades it; to keep it at the package level, push your changes to GitHub.

To add an entity, select Add new entity to open the code editor, which shows the Select an entity template screen. Choose a template to start from a Type that already includes the behavior you need, or select Create entity from scratch when none of the templates fit. The available templates are:

TemplateDescriptionMixes
Simple RelationalA simple relational type with string and double fields.
Simple CalcAn entity with simple calc fields.
Timeseries headerAn entity with a time series header representing a collection of time series.IntervalDataHeader
Simple Timeseries consisting of IntervalDataPointsAn entity with a time series made of interval data points.IntervalDataPoint
Sample Time Series Complex PartitioningAn entity with a time series that uses complex partitioning.FeatureEvaluatable
Entity with Feature EvaluatableAn entity used to derive features for machine learning.FeatureEvaluatable
Timed Interval RelationA relation between two entities with a start and end timestamp.TimedIntervalValue

See each mixed-in Type's documentation for what it provides and why you would use it. The exact set of templates can vary with the packages installed in your application.

Edit an existing entity

To edit an existing entity, right-click the entity in the Diagram view and select View or Modify Code. After editing the entity, select Save to update the entity in your application. Changes persist until someone upgrades the application. To save at the package level, push your changes to GitHub. For more information, see Version Control with GitHub.

Delete an entity

To delete an entity, right-click it in the Diagram view and select Delete. Data Fusion removes the Type from your application's root package.

Delete is available only for editable Types in your root package. It is disabled for Types that belong to a dependency package and for Types marked final; in those cases the menu item shows the tooltip "Cannot delete types outside the root package or final types." As with other schema changes, your application must be in development or trial mode, and the deletion persists in the running application until someone upgrades it. To remove the entity at the package level, push your changes to GitHub.

Was this page helpful?