Typedef toolkit
With the typedef toolkit you can model your unique metadata and make it available as first-class objects in Atlan.
The toolkit uses a Pkl model to restrict the way you define the custom model so that it precisely fits the best practices and structures available in Atlan's underlying metadata model.
Your pkl files reside in the atlanhq/models repository, not in your connector's repository. This centralized approach ensures all typedefs are managed consistently across the Atlan ecosystem.
How toolkit works
The toolkit processes typedef definitions through several key mechanisms:
Single source of truth
One .pkl file defines all your connector's asset types
Automatic generation
The toolkit generates complete JSON schemas from your definitions
Inheritance handling
The toolkit automatically resolves and includes inherited properties
Relationship management
Bidirectional relationships are handled automatically
When you define an asset in your pkl file, you specify three key pieces of information:
- What it inherits from: Choose super types that provide relevant base functionality
- Its unique attributes: Properties specific to your asset type
- Its relationships: How it connects to other assets in your ecosystem
For example, if you're building a connector for the Dremio data platform, you might define:
dremio_table:
super_types: [SQL] # Inherits query metrics and SQL functionality
attributes:
- dremio_specific_id: string (required)
- last_sync_time: timestamp (optional)
relationships:
- belongs_to: dremio_database (single parent)
- contains: dremio_column (multiple children)
Within a single .pkl file for your connector, you define:
- Shared Attributes: Properties common to all asset types in your connector. These might include connector-specific metadata or custom tags.
- Asset Definitions: Individual asset types like
dremio_table,dremio_view, ordremio_space. Each definition specifies its unique attributes and lists its super types. - Custom Relationships: The connections between your assets. For example, you might define that a
dremio_spacecontains multipledremio_viewobjects, while eachdremio_viewbelongs to exactly onedremio_space.
Relationships in Atlan are always bidirectional, meaning you define both directions of the connection. When you specify that a dremio_space has a views attribute (containing multiple views), you must also specify that each dremio_view has a space attribute (referencing its parent space). This bidirectional approach ensures data integrity and enables rich querying capabilities. Users can navigate from spaces to their views, and from views back to their containing spaces.
See also
- Typedefs - Understanding what typedefs are and how they work
- Models Reference - Complete reference of available models in Atlan