You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/unify/data-graph/index.md
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ redirect_from:
6
6
- '/unify/data-graph/data-graph'
7
7
---
8
8
9
-
The Data Graph acts as a semantic layer that enables businesses to define relationships between various entity datasets in the warehouse — such as accounts, subscriptions, households, and products — with the Segment Profile. It makes these relational datasets accessible to business teams for targeted and personalized customer engagements. The Data Graph powers both Linked Audiences and Linked Events.
9
+
The Data Graph acts as a semantic layer that enables businesses to define relationships between the Segment Profile and various entity datasets in the warehouse — such as accounts, subscriptions, households, and products. It makes these relational warehouse datasets accessible to business teams for targeted and personalized customer engagements. The Data Graph powers both Linked Audiences and Linked Events.
10
10
11
11
-**[Linked Audiences](/docs/engage/audiences/linked-audiences/)**: Empowers marketers to effortlessly create targeted audiences by combining behavioral data from the Segment Profile and warehouse entity data within a self-serve, no-code interface. This tool accelerates audience creation, enabling precise targeting, enhanced customer personalization, and optimized marketing spend without the need for constant data team support. The Data Graph is used in Linked Audiences for defining relationships between warehouse tables and views, which are then used to build audiences of Segment Profiles.
12
12
-**[Linked Events](/docs/unify/data-graph/linked-events/)**: Enables data teams to enrich event streams in real time using datasets from data warehouses or lakes, and send these enriched events to any destination. Linked Events is available for both Destination Actions and Functions. The Data Graph is used in Linked Events to specify which tables to use in enrichments.
@@ -60,15 +60,15 @@ Segment recommends you to use the visual builder for most use cases because it h
60
60
Follow these key steps to build your Data Graph:
61
61
62
62
1. Define your entities. An entity corresponds to a table, view, or materialized view in your warehouse. If you're only using Linked Events, this is the only step you need to do. If you're using Linked Audiences, you'll need to perform steps 2 and 3 as well.
63
-
2. Define the profile. This is a special class of entity that represents Segment Profiles, which corresponds to the Profiles Sync tables and models. For Linked Audiences, this allows marketers to filter on profile traits, event history, and so on. Based on your Profiles Sync settings, the Data Graph attempts to define the profile block.
63
+
2. Define the profile. This is a special class of entity that represents Segment Profiles, which corresponds to the Profiles Sync tables and models. For Linked Audiences, this allows marketers to filter on profile traits, event history, and so on. Based on your Profiles Sync settings, the Data Graph automatically attempts to define the profile block.
64
64
3. Define how your datasets are related to each other. The Data Graph preserves these relationships and carries this rich context to the destinations to unlock personalization.
65
65
66
66
**Defining Relationships**
67
67
68
68
Similar to the concept of [cardinality in data modeling](https://w.wiki/Ay$u){:target="\_blank"}, the Data Graph supports 3 types of relationships:
69
69
70
70
-**Profile-to-entity relationship:** This is the first level of relationship, and is the relationship between your entity table and the Segment Profiles tables. This relationship is required for Linked Audiences because it connects Segment Profiles data with all the entity data you have in your warehouse.
71
-
-**1:many relationship:** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`.
71
+
-**1:many relationship:** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`. A 1:many relationship can also be a 1:1 relationship.
72
72
-**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`.
73
73
74
74
The Data Graph 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. Relationships are nested under the profile. Refer to the example below.
@@ -222,7 +222,7 @@ Parameter | Defintion
222
222
Now define the relationships between your entities. Similar to the concept of [cardinality in data modeling](<en.wikipedia.org/wiki/Cardinality_(data_modeling)>), the Data Graph supports 3 types of relationships below. All relationship types require you to define the relationship slug, name, and related entity. Each type of relationship has unique join on conditions.
223
223
224
224
-**[Profile-to-entity relationship](#define-profile-to-entity-relationship):** This is a relationship between your entity table and the Segment Profiles tables, and is the first level of relationship.
225
-
-**[1:many relationship](#define-a-1many-relationship):** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`.
225
+
-**[1:many relationship](#define-a-1many-relationship):** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`. A 1:many relationship can also be a 1:1 relationship.
226
226
-**[many:many relationship](#define-manymany-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`.
227
227
***Note:** To add many:many relationships, you need to use the [code editor](#using-the-code-editor).
228
228
@@ -235,8 +235,8 @@ Parameter | Definition
235
235
`Select related entity`| The left-hand-side entity represents the Segment profile. On the right-hand-side, you can select which entity to relate it to. <br><br>Note: you can select the preview icon to preview both the Segment profile and the associated table or view representing the entity.
236
236
`Relationship name`| A label displayed throughout your Segment space for Linked Audiences. This name can be modified at any time.
237
237
`Description` (**Optional**) | An optional descriptor used to add additional context to the relationship.
238
-
`Join on external IDor trait`| The Segment external IDor trait you’ll use to join to your entity. To define a profile-to-entity relationship, reference your entity table. Depending on the column in it that you would like to link to your Segment profile, you can select either an [external identifier](/docs/unify/identity-resolution/externalids/) such as`user_id`, `email`, or`phone`or a [trait](/docs/unify/#enrich-profiles-with-traits) in your Unify Profiles.
239
-
`Join key`| The column on the entity table that matches the external IDor trait selected directly above.
238
+
`Join on external IDor trait`| The Segment external IDor trait you’ll use to join to your entity. To define a profile-to-entity relationship, reference your entity tableor view. Depending on the column in it that you would like to link to your Segment profile, you can select either an [external identifier](/docs/unify/identity-resolution/externalids/) such as`user_id`, `email`, or`phone`or a [trait](/docs/unify/#enrich-profiles-with-traits) in your Unify Profiles.
239
+
`Join key`| The column on the entity table or view that matches the external IDor trait selected directly above.
240
240
241
241
> info ""
242
242
> Segment recommends using materialized views with Profiles Sync. However, Segment may still reference unmaterialized tables during setup for schema detection.
@@ -250,7 +250,7 @@ For 1:many relationships, select the relationship node you’d like to add a new
250
250
Parameters | Definition
251
251
----------|------------
252
252
`Select related entity`| The left-hand-side entity represents the entity referenced in the relationship you had previously defined. This is immutable. On the right-hand-side, you can select which entity to relate it to. <br><br>Note: you can select the preview icon to preview both associated tables or views.
253
-
`Join keys`| Defines relationship between the two entity tables – i.e. how they should be joined together.
253
+
`Join keys`| Defines relationship between the two entity tables or views, in other words, how they should be joined together.
254
254
`Relationship name`| A label displayed throughout your Segment space for Linked Audiences. This name can be modified at any time
255
255
256
256
By selecting **Compute count**, you can check the number of rows returned when joining the two entity tables or views together based on the join keys you provided. This is a good way to ensure results are as expected.
@@ -333,7 +333,7 @@ data_graph {
333
333
Now define the relationships between your entities. Similar to the concept of [cardinality in data modeling](<en.wikipedia.org/wiki/Cardinality_(data_modeling)>), the Data Graph supports 3 types of relationships below. All relationship types require you to define the relationship slug, name, and related entity. Each type of relationship has unique join on conditions.
334
334
335
335
-**[Profile-to-entity relationship](#define-profile-to-entity-relationship):** This is a relationship between your entity table and the Segment Profiles tables, and is the first level of relationship.
336
-
-**[1:many relationship](#define-a-1many-relationship):** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`.
336
+
-**[1:many relationship](#define-a-1many-relationship):** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`. A 1:many relationship can also be a 1:1 relationship.
337
337
-**[many:many relationship](#define-manymany-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`.
338
338
***Note:** To add many:many relationships, you need to use the [code editor](#using-the-code-editor).
339
339
@@ -349,17 +349,17 @@ Parameter | Definition
349
349
350
350
To define a profile-to-entity relationship, reference your entity table and depending on your table columns, choose to join on one of the following:
351
351
352
-
***Option 1- Join on an external ID (*most common*):** Use the `external_id` block to join the profile entity with an entity table using external IDs from your [Unify ID resolution](/docs/unify/identity-resolution/externalids/) settings. Typically these identifiers are `user_id`, `email`, or`phone` depending on the structure of your entity table.
352
+
***Option 1- Join on an external ID (*most common*):** Use the `external_id` block to join the profile entity with an entity table or view using external IDs from your [Unify ID resolution](/docs/unify/identity-resolution/externalids/) settings. Typically these identifiers are `user_id`, `email`, or`phone` depending on the structure of your entity table.
353
353
-`type`: Represents the [external IDtype](/docs/unify/identity-resolution/externalids/#default-externalids) (`email`, `phone`, `user_id`) in your ID resolution settings.
354
-
- This maps to the `type` column in the `user_identifiers` table when using materialized views.
354
+
- This maps to the `type` column in the `user_identifiers` table when using Profiles Sync materialized views.
355
355
-`join_key`: The column on the entity table that matches the external ID.
356
356
357
357
> info ""
358
358
> Segment recommends using materialized views with Profiles Sync. However, Segment still needs to reference unmaterialized tables during setup for schema detection.
359
359
360
360
***Option 2- Join on a profile trait:** Use the `trait` block to join the profile entity with an entity table using [Profile Traits](/docs/unify/#enrich-profiles-with-traits).
361
361
362
-
-`name`: Represents a trait name in your Unify profiles. This maps to the `name` column in the `user_traits` table when using materialized views.
362
+
-`name`: Represents a trait name in your Unify profiles. This maps to the `name` column in the `user_traits` table when using Profiles Sync materialized views.
363
363
-`join_key`: The column on the entity table that you're matching to the trait.
364
364
365
365
**Example:**
@@ -403,7 +403,7 @@ data_graph {
403
403
404
404
Select a Data Graph node to see an overview of the relationship and to also confirm what data isin your entity tables or views by previewing the first 10 rows.
405
405
406
-
Click **Compute count** to check the number of rows returned when joining the profile and entity together based on the join keys you provide. This enables you to make sure that entity joins occur correctly while setting up the Data Graph by returning the number of rows produced when joining two associated tables or view.
406
+
Click **Compute count** to check the number of rows returned when joining the profile and entity together based on the join keys you provide. This enables you to make sure that entity joins occur correctly while setting up the Data Graph.
407
407
408
408
##### Define 1:many relationship
409
409
Define the join between the two entity tables using the spec below.
@@ -451,7 +451,7 @@ data_graph {
451
451
452
452
Select a Data Graph node to see an overview of the relationship and to also confirm what data isin your entity tables or views by previewing the first 10 rows.
453
453
454
-
Click **Compute count** to check the number of rows returned when joining the profile and entity together based on the join keys you provide. This enables you to make sure that entity joins occur correctly while you’re setting up the Data Graph by returning the number of rows produced when joining two associated tables or view.
454
+
Click **Compute count** to check the number of rows returned when joining 2 entities together based on the join keys you provide. This enables you to make sure that entity joins occur correctly while you’re setting up the Data Graph.
455
455
456
456
457
457
##### Define many:many relationship
@@ -476,8 +476,8 @@ Parameter | Definition
476
476
---------|-----------
477
477
`table_ref`| Defines the fully qualified table reference to the join table: `[database name].[schema name].[table name]`. Segment flexibly supports tables, views and materialized views.
478
478
`primary_key`| The unique identifier for the given table. Must be a column with unique values per row.
479
-
`left_join_on`| Defines the relationship between the left entity table and the junction table: `[left entity slug].[column name] = [junction table column name]`. Note that schema and table are implied within the junction table column name, so you do not need to define it again.
480
-
`right_join_on`| Define the relationship between the junction table and the right entity table: `[junction table column name] = [right entity slug].[column name]`. Note that schema and table are implied within the junction table column name, so you do not need to define it again.
479
+
`left_join_on`| Defines the relationship between the left entity table or view and the junction table: `[left entity slug].[column name] = [junction table column name]`. Note that schema and table are implied within the junction table column name, so you do not need to define it again.
480
+
`right_join_on`| Define the relationship between the junction table and the right entity tableor view: `[junction table column name] = [right entity slug].[column name]`. Note that schema and table are implied within the junction table column name, so you do not need to define it again.
481
481
482
482
483
483
When you define a many-to-many relationship using a junction table, `left_join_on`and`right_join_on` tell Data Graph how to connect each entity to the junction table:
@@ -526,7 +526,7 @@ data_graph {
526
526
527
527
Select a Data Graph node to see an overview of the entity and to also confirm what data isin your entity tables or views by previewing the first 10 rows.
528
528
529
-
Click **Compute count** to check the number of rows returned when joining the profile and entity together based on the join keys you provide. This enables you to make sure that entity joins occur correctly while you’re setting up the Data Graph by returning the number of rows produced when joining two associated tables or view.
529
+
Click **Compute count** to check the number of rows returned when joining when joining 2 entities together based on the join keys you provide. This enables you to make sure that entity joins occur correctly while you’re setting up the Data Graph.
0 commit comments