Entities
Last updated
Last updated
Entities are real-world concepts like customers, orders, payments etc. These are first-class citizens in Lynk, meaning everything we build and consume is around entities.
The main concept of Lynk Semantic Layer is to create a central source of truth for each of the entities in the business, in a trusted and accessible way. In other words, from a business perspective, for each business entity it should be clear what we know of it, how was it defined, and where we can find it. We call these pieces of information on an entity level - .
Entities can be defined either via code or via Lynk Studio UI.
The below example shows how we define a customer
entity as a YAML file:
key_table
An entities is defined by it's key data asset. An entity key data asset is a table or a view in the data warehouse, that has all the entity instances, and each entity instance exists only once on this asset.
For example, if our entity is customer, it's key data asset should have all the customers, and each customer appears only once in that data asset.
aliases
Sometimes different people might call the same entity by different names. e.g a customer
can also be referred to as a user
. This is relevant especially when interacting with AI apps to ask questions. Lynk supports aliases to entity names.
features
related_assets
Entities have unique names
Entities have unique Key data asset
Entity key asset validation (no duplications, no missing instances)
Entities do not share the same aliases
For a quick onboarding, use the process to automatically extract business entities from your Data Warehouse schemas and SQL code.
Features are attributes that represent all we know about our Entities. It can be simple fields, aggregated metrics, first - last features, period-over-period formulas, custom formulas and more. See page for in depth information on this.
Define which Data Assets are related to the entity. Related assets will be shown and used when creating new features for an entity. For example, if the data asset db_prod.core.orders
is related to the entity customer
, we will be able to extract features from db_prod.core.orders
to the customer
level. See for in depth information on this.
To see how to define and use relationships between entities, please see page.
Entities and Features are consumed via , or via Lynk . See for in depth information on this.
Lynk makes sure Entities are unique:
Lynk Discovery makes it easy to bootstrap your project and define entities automatically. Read more on this on the page.