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/data-graph.md
+34-32Lines changed: 34 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,6 @@
1
1
---
2
2
title: Data Graph
3
3
plan: unify
4
-
beta: true
5
-
hidden: true
6
4
redirect_from:
7
5
- '/unify/linked-profiles/data-graph'
8
6
---
@@ -55,19 +53,21 @@ To connect your warehouse to the Data Graph:
55
53
56
54
## Step 3: Build your Data Graph
57
55
58
-
The Data Graph is a semantic layer that represents a subset of relevant business data that marketers and business stakeholders can use for audience targeting and personalization in downstream tools. Use the configuration language spec and key features below to build your Data Graph:
56
+
The Data Graph is a semantic layer that represents a subset of relevant business data that marketers and business stakeholders can use for audience targeting and personalization in downstream tools. Use the configuration language spec and the following features to build your Data Graph:
57
+
59
58
- Use the **Warehouse access** tab to view the warehouse tables you've granted Segment access to
60
59
- Begin typing to autopopulate the configuration spec within the editor, as well as to autocomplete your warehouse schema
61
60
- Validate your Data Graph using the **Preview** tab
62
61
63
62
### Key steps to build your Data Graph
63
+
64
64
1. First, define your entities. An entity corresponds to a table in your warehouse. Segment flexibly supports tables, views and materialized views.
65
-
2. Then, define the profile block. 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, etc.
65
+
2. Then, define the profile block. 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.
66
66
3. Finally, 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.
67
67
68
68
**Defining Relationships**
69
69
70
-
Similar to the concept of [cardinality in data modeling](/en.wikipedia.org/wiki/Cardinality_(data_modeling)), the Data Graph supports 3 types of relationships:
70
+
Similar to the concept of [cardinality in data modeling](en.wikipedia.org/wiki/Cardinality_(data_modeling)){:target="_blank"}, the Data Graph supports 3 types of relationships:
71
71
-**Profile-to-entity relationship:** This is a relationship between your entity table and the Segment Profiles tables, and is the first level of relationship.
72
72
-**1:many relationship:** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`.
73
73
-**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`.
@@ -174,7 +174,7 @@ data_graph {
174
174
175
175
```
176
176
177
-
### a) Define entities
177
+
### 3a: Define entities
178
178
The first step in creating a Data Graph is to define your entities. An entity corresponds to a table in the warehouse.
179
179
180
180
| Parameters | Definition |
@@ -204,7 +204,7 @@ data_graph {
204
204
}
205
205
```
206
206
207
-
### b) Define the profile
207
+
### 3b: Define the profile
208
208
> info ""
209
209
> Segments recommends that you select materialized views under the Profiles Sync Selective Sync settings to optimize warehouse compute costs.
210
210
@@ -233,7 +233,7 @@ data_graph {
233
233
234
234
```
235
235
236
-
### c) Define relationships
236
+
### 3c: Define relationships
237
237
238
238
Now define your relationships between your entities. The Data Graph supports three types of relationships:
239
239
- Profile:entity relationship. This is the first level of relationships
@@ -245,11 +245,11 @@ All relationship types require you to define the relationship slug, name, and re
245
245
#### Define profile-to-entity relationship
246
246
This is the first level of relationships and a unique type of relationship between Segment profile entity and a related entity.
|`relationship`| An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be inall lowercase, and supports dashes or underscores (e.g. `user-account`or`user_account`)|
251
-
|`name`| A label displayed throughout your Segment space for Linked Events, Linked Audiences, etc. This name can be modified at any time |
252
-
|`related_entity`| References your already defined entity |
|`relationship`| An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be inall lowercase, and supports dashes or underscores (e.g. `user-account`or`user_account`) |
251
+
|`name`| A label displayed throughout your Segment space for Linked Events, Linked Audiences, etc. This name can be modified at any time|
252
+
|`related_entity`| References your already defined entity|
253
253
254
254
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:
255
255
@@ -305,12 +305,12 @@ data_graph {
305
305
#### Define a 1:many relationship
306
306
For 1:many relationships, define the join on between the two entity tables using the spec below.
|`relationship`| An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be inall lowercase, and supports dashes or underscores (e.g. `user-account`or`user_account`) |
311
-
|`name`| A label displayed throughout your Segment space for Linked Events, Linked Audiences, etc. This name can be modified at any time |
312
-
|`related_entity`| References your already defined entity |
313
-
|`join_on`| Defines relationship between the two entity tables `[lefty entity slug].[column name] = [right entity slug].[column name]`. Note that since you’re referencing the entity slug for the join on, you do not need to define the full table reference |
|`relationship`| An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be inall lowercase, and supports dashes or underscores (e.g. `user-account`or`user_account`)|
311
+
|`name`| A label displayed throughout your Segment space for Linked Events, Linked Audiences, and so on. This name can be modified at any time|
312
+
|`related_entity`| References your already defined entity|
313
+
|`join_on`| Defines relationship between the two entity tables `[lefty entity slug].[column name] = [right entity slug].[column name]`. Note that since you’re referencing the entity slug for the join on, you do not need to define the full table reference |
314
314
315
315
**Example:**
316
316
@@ -349,19 +349,21 @@ For many:many relationships, define the join on between the two entity tables wi
349
349
> warning ""
350
350
> Attributes from a junction table are not referenceable via the Linked Audience Builder. If a marketer would like to filter upon a column on the junction table, you must define the junction as an entity and define a relationship.
|`relationship`| An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be inall lowercase, and supports dashes or underscores (e.g. `user-account`or`user_account`) |
355
-
|`name`| A label displayed throughout your Segment space for Linked Events, Linked Audiences, etc. This name can be modified at any time |
356
-
|`related_entity`| References your already defined entity |
|`relationship`| An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be inall lowercase, and supports dashes or underscores (e.g. `user-account`or`user_account`) |
356
+
|`name`| A label displayed throughout your Segment space for Linked Events, Linked Audiences, and so on. This name can be modified at any time |
357
+
|`related_entity`| References your already defined entity |
|`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 |
362
-
|`primary_key`| The unique identifier for the given table. Must be a column with unique values per row |
363
-
|`left_join_on`| Define 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 |
364
-
|`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 |
|`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 |
364
+
|`primary_key`| The unique identifier for the given table. Must be a column with unique values per row |
365
+
|`left_join_on`| Define 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 |
366
+
|`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 |
365
367
366
368
**Example:**
367
369
@@ -409,7 +411,7 @@ To edit your Data Graph:
409
411
410
412
### View Data Graph data consumers
411
413
412
-
A data consumer refers to a Segment feature (e.g. Linked Events, Linked Audiences) referencing datasets, such as entities and/or relationships, from the Data Graph. You can view a list of data consumers in two places:
414
+
A data consumer refers to a Segment feature (like Linked Events, Linked Audiences) referencing datasets, such as entities and/or relationships, from the Data Graph. You can view a list of data consumers in two places:
413
415
- Under **Unify > Data Graph**, click the **Data consumers** tab
414
416
- Under **Unify > Data Graph > Overview**or the **Data Graph editor > Preview**, click into a node on the Data Graph preview and a side sheet will pop up with the list of data consumers for the respective relationship
415
417
@@ -421,4 +423,4 @@ Upon editing and saving changes to your Data Graph, a modal will pop up to warn
421
423
422
424
### Detect warehouse breaking changes
423
425
424
-
Segment has a service that regularly scans and monitors the Data Graph for changes that occur in your warehouse that may break components of the Data Graph, such as when the table being referenced by the Data Graph gets deleted from your warehouse, the primary key column no longer exists, etc. An alert banner will be displayed on the Data Graph landing page. The banner will be removed once the issues are resolved in your warehouse and/or the Data Graph.
426
+
Segment has a service that regularly scans and monitors the Data Graph for changes that occur in your warehouse that may break components of the Data Graph, such as when the table being referenced by the Data Graph gets deleted from your warehouseor when the primary key column no longer exists. An alert banner will be displayed on the Data Graph landing page. The banner will be removed once the issues are resolved in your warehouse and/or the Data Graph.
0 commit comments