Skip to content

Basic Types

Fundamental type definitions used throughout OpenMetadata schemas.

Overview

Basic types are the building blocks for all OpenMetadata schemas. They provide standardized, reusable type definitions.

String Types

UUID

Definition: type/basic.json#/definitions/uuid

RFC 4122 compliant universally unique identifiers:

{
  "type": "string",
  "format": "uuid",
  "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
}

Usage: Entity IDs, references

Email

Definition: type/basic.json#/definitions/email

RFC 5322 email addresses:

{
  "type": "string",
  "format": "email",
  "pattern": "^[\\w\\.\\-]+@[\\w\\-]+\\.[\\w\\-\\.]+$"
}

Markdown

Definition: type/basic.json#/definitions/markdown

CommonMark formatted text for rich descriptions:

{
  "type": "string",
  "description": "Markdown formatted text"
}

URI

Definition: type/basic.json#/definitions/href

HTTP/HTTPS URIs:

{
  "type": "string",
  "format": "uri"
}

Temporal Types

Timestamp

Definition: type/basic.json#/definitions/timestamp

ISO 8601 timestamps:

{
  "type": "number",
  "description": "Unix epoch timestamp in milliseconds"
}

Example: 1704067200000 (2024-01-01T00:00:00Z)

Date

Definition: type/basic.json#/definitions/date

ISO 8601 dates:

{
  "type": "string",
  "format": "date",
  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
}

Example: "2024-01-01"

Time

Definition: type/basic.json#/definitions/time

ISO 8601 times:

{
  "type": "string",
  "format": "time"
}

Example: "14:30:00"

Duration

Definition: type/basic.json#/definitions/duration

ISO 8601 durations:

{
  "type": "string",
  "format": "duration"
}

Example: "P1DT12H30M" (1 day, 12 hours, 30 minutes)

Numeric Types

Integer

Standard JSON integer:

{
  "type": "integer"
}

Number

JSON number (float/double):

{
  "type": "number"
}

Boolean

Standard JSON boolean:

{
  "type": "boolean"
}

Expression Types

SQL Expression

Definition: type/basic.json#/definitions/sqlQuery

SQL query strings:

{
  "type": "string",
  "description": "SQL expression or query"
}

SQL Function

SQL function expressions:

{
  "type": "string",
  "description": "SQL function like COUNT(*), SUM(column)"
}

Definition: type/basic.json#/definitions/entityLink

Links to specific entities or entity fields:

<#E::table::db.schema.table>
<#E::table::db.schema.table::columns::column_name>

Format: <#E::{entityType}::{fqn}[::{field}::{fieldValue}]>

Enum Types

Style Enums

Constrained string values:

{
  "type": "string",
  "enum": ["Regular", "View", "MaterializedView", "Temporary"]
}

Validation Patterns

Name Pattern

Valid entity names:

{
  "type": "string",
  "minLength": 1,
  "maxLength": 256,
  "pattern": "^[a-zA-Z0-9_.-]+$"
}

FQN Pattern

Fully qualified names:

{
  "type": "string",
  "minLength": 1,
  "maxLength": 3072
}

Best Practices

  1. Use Standard Types: Always reference basic types instead of redefining
  2. Validation: Leverage format and pattern validations
  3. Constraints: Add min/max length where appropriate
  4. Documentation: Document custom constraints