Link
A Link represents a relationship, transaction, or association between two or more Hubs (core business entities). Links establish the connections that define how business entities interact. They are essential for modeling the "unit of work" or events that occur between business concepts.
Key Characteristics:
- Relationship Focus: Captures relationships or transactions between business keys stored in Hubs.
- Connects Hubs: Contains foreign keys referencing the Hubs involved in the relationship. The primary key of a Link is typically a composite of the Hub hash keys it connects.
- No Descriptive Attributes (Typically): Standard Links do not store descriptive attributes about the relationship itself. Such attributes are stored in Link Satellites.
- Granularity: The granularity of a Link is defined by the combination of Hubs it connects.
Role in Data Vault:
Links are crucial for understanding how different parts of the business are connected. They provide the context for transactions and interactions, enabling analysis across different business domains. By separating relationships from descriptive data, Links contribute to the flexibility and scalability of the Data Vault model.
Simple Link Example:
This example defines a Link LNK_SALES_ORDER
that represents an item on an order, connecting HUB_SALES_ORDER
, HUB_MATERIAL
, HUB_PROFIT_CENTER
and HUB_CUSTOMER
.
name: 'LNK_SALES_ORDER'
entity_type: 'link'
enable_refresh: True
connected_hubs:
- CUSTOMER: 'HUB_CUSTOMER' # <Alias>: <Hub Name>
- SALES_ORDER: 'HUB_SALES_ORDER'
- PROFIT_CENTER: 'HUB_PROFIT_CENTER'
- MATERIAL: 'HUB_MATERIAL'
entity_sources:
- urn:s2v:link_source:SAP_OE: # Unique URN for this source
entity_source: '(SAP_OE, 2LIS_11_VAITM)' # Source: (Schema, Table)
source_filter: # Optional filter
source_system_configuration_urn: 'urn:s2v:source_setting:SAP' # Link to global source settings
use_source_cdc_flag: False
connected_hub_relations:
- CUSTOMER:
source_business_key: '' # Optional source system identifier
business_key_mapping:
- CUSTOMER_BK: # Business key name from HUB_CUSTOMER
- 'KUNNR' # Source column KUNNR participating in business key
- SALES_ORDER:
source_business_key: 'SAP_OE_SD'
business_key_mapping:
- SALES_ORDER_BK:
- 'VBELN'
- 'POSNR'
- PROFIT_CENTER:
source_business_key: ''
business_key_mapping:
- PROFIT_CENTER_BK:
- "PRCTR"
- "KOKRS"
- MATERIAL:
source_business_key: ''
business_key_mapping:
- MATERIAL_BK:
- 'MATNR'
- For a detailed step-by-step guide on building a Link, please refer to the How to build a Link? tutorial.
- For a comprehensive guide on all available properties and detailed explanations for defining a Hub, please refer to the Link Reference.