Skip to main content

Foundations: Object Types

Object Types are the core building blocks of your semantic layer. Each Object Type represents a business entity — a "thing" that exists in your data model.

object-types-diagram

What is an Object Type?

An Object Type is a named business concept with:

  • A name — typically plural (e.g., "Customers", "Orders", "Products", "Campaigns")
  • A description — what this entity represents in your business
  • Attributes — the properties/fields of this entity
  • Relationships — how this entity connects to other entities
  • Source mappings — which database tables contain this entity's data

Examples

Object TypeDescriptionKey Attributes
CustomersPeople who have created an accountemail, name, signup_date, region
OrdersPurchase transactionsorder_id, amount, status, order_date
ProductsItems available for purchaseproduct_id, name, category, price
CampaignsMarketing campaignscampaign_id, name, channel, start_date, budget
EventsUser behavioral eventsevent_id, event_type, timestamp, device_id

Views in the UI

The Object Types tab offers two ways to view your entities:

Diagram View

A visual graph showing all your Object Types as connected nodes. Relationships are displayed as lines between entities, making it easy to see how your data model fits together at a glance. This is great for understanding the big picture.

object-types-table

Table View

A structured list of all Object Types with their details. Each entity can be expanded to show its attributes, relationships, and source mappings. This is better for detailed editing and review.

Attributes

Each Object Type has a list of attributes — the fields that describe the entity. For each attribute, you define:

PropertyDescription
NameThe attribute name (e.g., email, total_amount, signup_date)
Data TypeA semantic type from the Data Types library (e.g., Email, Currency, Date) — or a base type (string, integer, etc.)
DescriptionWhat this attribute represents
RequiredWhether this attribute must always have a value

Semantic Types vs. Base Types

Whenever possible, use semantic types (defined in the Data Types tab) rather than basic storage types. For example:

  • Use Email instead of "string" for email addresses
  • Use Currency instead of "decimal" for monetary amounts
  • Use PhoneNumber instead of "string" for phone numbers

Semantic types carry validation rules and business context that make your data model smarter.

Static Metrics

Some attributes represent pre-calculated metrics (e.g., lifetime_value, total_orders). These are marked as static metrics within the Object Type and are preserved when the entity is updated.

Relationships

Relationships define how Object Types connect to each other. They represent the foreign key connections in your data.

Key Rule

Relationships are defined on the entity that holds the foreign key. For example:

  • Correct: Orders have a relationship to Customers (because the orders table has a customer_id column)
  • Incorrect: Customers have a relationship to Orders (the customers table doesn't have an order_id column)

You don't need to create "reverse" or "collection" relationships — Datalinx infers those automatically.

Cardinality

Each relationship specifies how many records can be connected:

CardinalityMeaningExample
Many-to-OneMany of this entity reference one parentMany Orders → one Customer
One-to-OneThis entity references exactly one parent uniquelyOne UserProfile → one User
Many-to-ManyRequires a junction/bridge tableProducts ↔ Categories (via product_categories table)

Relationship Properties

PropertyDescription
NameA descriptive name (e.g., "customer", "product")
TargetThe Object Type this relationship points to
ColumnThe foreign key column in this entity's table
Cardinalitymany_to_one, one_to_one, or many_to_many

Source Mappings

Each Object Type can be linked to one or more source database tables. This tells Datalinx where the entity's data actually lives. Source mappings are typically generated automatically during the ontology scan.

Creating Object Types

Via the UI

  1. Click Add Object Type
  2. Fill in the name and description
  3. Add attributes with their data types
  4. Define relationships to other entities
  5. Save

Via the Foundations Agent

Ask the agent to create entities for you:

  • "Create a Customers object type with email, name, signup_date, and region attributes"
  • "Add a relationship from Orders to Customers using the customer_id column"
  • "Scan my source database and generate object types for all business entities"

Via Ontology Scan

The most efficient way for large databases is to use the ontology scanning tools (through the Foundations Agent). The scanner:

  1. Analyzes all your source tables
  2. Identifies business concepts (groups of related tables)
  3. Generates Object Types with attributes, descriptions, and relationships
  4. You review and refine the results

Tips

  • Use plural names for Object Types (e.g., "Customers" not "Customer") — this avoids conflicts with SQL reserved words
  • Foreign key columns should NOT be listed as attributes — define them as relationships instead
  • Keep descriptions clear and specific — the AI agents rely on them to understand your data model
  • Start with core entities (Customers, Orders, Products) and expand from there
  • The diagram view is great for presentations and team alignment; the table view is better for detailed work