Skip to content

Commit 316bf37

Browse files
authored
Update data-graph.md
1 parent c3fc998 commit 316bf37

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

src/unify/data-graph/data-graph.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@ redirect_from:
77
- '/unify/linked-profiles/data-graph'
88
---
99

10-
The Data Graph is a semantic layer unifying all your customer datasets, enabling you to define relationships between any entity data set in the warehouse (i.e. accounts, subscriptions, households, products, etc) with the Segment Profiles you send with Profiles Sync. Once defined, the Data Graph allows you to make this rich relational data accessible to marketers and business stakeholders to empower them to create targeted and personalized customer engagements.
10+
The Data Graph is a semantic layer unifying all your customer datasets, enabling you to define relationships between any entity data set in the warehouse (i.e. accounts, subscriptions, households, products, etc.) with the Segment Profiles you send with [Profiles Sync](/docs/unify/profiles-sync/). Once defined, the Data Graph allows you to make this rich relational data accessible to marketers and business stakeholders to empower them to create targeted and personalized customer engagements.
1111
- **[Linked Audiences](/docs/engage/audiences/linked-audiences/)**: Enables marketers to self-serve and build targeting logic based on any data sets defined in the Data Graph unlocking a world of new hyper-personalized campaigns.
1212
- **[Linked Events](/docs/unify/data-graph/linked-events/)**: Enables data teams to enrich event streams, in real time, with any data set coming from a data warehouse or data lake, and send those enriched events to any Destination. Available for Destinations Actions and Functions.
1313

1414
## Prerequisites
1515

1616
To use the Data Graph, you'll need the following:
1717

18-
- A supported data warehouse
19-
- If using Linked Audiences, [Profiles Sync](/docs/unify/profiles-sync/) will need to be set up with ready-to-use [data models and tables](/docs/unify/profiles-sync/tables/) in your warehouse. Note: Profiles Sync is not required for Linked Events
18+
- A supported data warehouse with appropriate Data Graph permissions
19+
- For Linked Audiences, [Profiles Sync](/docs/unify/profiles-sync/) will need to be set up for a Unify space with ready-to-use [data models and tables](/docs/unify/profiles-sync/tables/) in your warehouse. When setting up selective sync, Segment recommends the following settings for Linked Audiences:
20+
- Under **Profile materialized tables**, select all the tables (`user_identifier`, `user_traits`, `profile_merges`) for faster and more cost-efficient Linked Audiences computations in your data warehouse.
21+
- Under **Track event tables**, select "Sync all Track Call Tables" to enable filtering on event history for Linked Audiences conditions.
2022
- Workspace Owner or Unify Read-only/Admin and Entities Admin permissions
2123

2224
## Step 1: Set up Data Graph permissions in your data warehouse
@@ -64,7 +66,7 @@ Similar to the concept of [cardinality in data modeling](/en.wikipedia.org/wiki/
6466
- **Profile-to-entity relationship:** This is a relationship between your entity table and the Segment Profiles tables, and is the first level of relationship.
6567
- **1:many relationship:** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`.
6668
- **many:many relationship:** For example, a user can have many `carts`, and each `cart` can have many `products`. However, these `products` can also belong to many `carts`.
67-
- The Data Graph currently supports 5 levels of relationships starting from the profile. For example, relating the accounts table to the profile block is the first level of relationship, relating a 1:many relationship between the accounts and carts table is the second level of relationship, and so on. There are no limits on the breadth of your Data Graph.
69+
- The Data Graph currently supports 6 levels of depth (or nodes) starting from the profile. For example, relating the `profile` to the `accounts` table to the `carts` table is 3 levels of depth. There are no limits on the width of your Data Graph or the number of entities.
6870
- Relationships are nested under the profile. Refer to the example below.
6971

7072
**Data Graph Example**
@@ -113,24 +115,27 @@ data_graph {
113115
profile_folder = "PRODUCTION.SEGMENT"
114116
type = "segment: materialized"
115117

116-
# First branch - relate accounts table to the profile. Unique type of relationship between an entity and the profile block
118+
# First branch - relate accounts table to the profile
119+
# This is a unique type of relationship between an entity and the profile block
117120
relationship "user-accounts" {
118121
name = "Premium Accounts"
119122
related_entity = "account-entity"
120-
# Join the profile entity with user_id, email, or phone as the identifier on the entity table
123+
# Join the profile entity with an identifier (e.g. email) on the related entity table
121124
# Option to replace with the traits block below to join with a profile trait on the entity table instead
122125
external_id {
123126
type = "email"
124127
join_key = "EMAIL_ID"
125128
}
126129

127-
# Define 1:many relationship between accounts and carts (e.g. an account can be associated with many carts)
130+
# Define 1:many relationship between accounts and carts
131+
# e.g. an account can be associated with many carts
128132
relationship "user-carts" {
129133
name = "Shopping Carts"
130134
related_entity = "cart-entity"
131135
join_on = "account-entity.ID = cart-entity.ACCOUNT_ID"
132136

133-
# Define many:many relationship between carts and products (e.g. there can be multiple carts, and each cart can be associated with multiple products)
137+
# Define many:many relationship between carts and products
138+
# e.g. there can be multiple carts, and each cart can be associated with multiple products
134139
relationship "products" {
135140
name = "Purchased Products"
136141
related_entity = "product-entity"
@@ -153,7 +158,8 @@ data_graph {
153158
join_key = "EMAIL_ID"
154159
}
155160

156-
# Define 1:many relationship between households and subscriptions (e.g. a household can be associated with multiple subscriptions)
161+
# Define 1:many relationship between households and subscriptions
162+
# e.g. a household can be associated with multiple subscriptions
157163
relationship "user-subscriptions" {
158164
name = "Subscriptions"
159165
related_entity = "subscription-entity"
@@ -209,10 +215,11 @@ Next, define the profile. This is a special class of entity that represents Segm
209215
```python
210216

211217
data_graph {
212-
# Define your entities
218+
# Define entities
213219
...
214220

215-
# Define the profile entity
221+
# Define the profile entity, which corresponds to Segment Profiles tables synced via Profiles Sync
222+
# Recommend setting up Profiles Sync materialized views to optimize warehouse compute costs
216223
profile {
217224
profile_folder = "PRODUCTION.SEGMENT"
218225
type = "segment:materialized"
@@ -274,13 +281,13 @@ data_graph {
274281
name = "Premium Accounts"
275282
related_entity = "account-entity"
276283

277-
# Option 1: Join with an external ID block
284+
# Option 1: Join the profile entity with an identifier (e.g. email) on the related entity table
278285
external_id {
279286
type = "email"
280287
join_key = "EMAIL_ID"
281288
}
282289

283-
# Option 2: Join with a trait block
290+
# Option 2: Join the profile entity with a profile trait on the related entity table
284291
trait {
285292
name = "cust_id"
286293
join_key = "ID"

0 commit comments

Comments
 (0)