Skip to content

Commit ea92e9b

Browse files
committed
final cleanup
1 parent f9e352b commit ea92e9b

File tree

1 file changed

+34
-32
lines changed

1 file changed

+34
-32
lines changed

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

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
---
22
title: Data Graph
33
plan: unify
4-
beta: true
5-
hidden: true
64
redirect_from:
75
- '/unify/linked-profiles/data-graph'
86
---
@@ -55,19 +53,21 @@ To connect your warehouse to the Data Graph:
5553

5654
## Step 3: Build your Data Graph
5755

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+
5958
- Use the **Warehouse access** tab to view the warehouse tables you've granted Segment access to
6059
- Begin typing to autopopulate the configuration spec within the editor, as well as to autocomplete your warehouse schema
6160
- Validate your Data Graph using the **Preview** tab
6261

6362
### Key steps to build your Data Graph
63+
6464
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.
6666
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.
6767

6868
**Defining Relationships**
6969

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:
7171
- **Profile-to-entity relationship:** This is a relationship between your entity table and the Segment Profiles tables, and is the first level of relationship.
7272
- **1:many relationship:** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`.
7373
- **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 {
174174

175175
```
176176

177-
### a) Define entities
177+
### 3a: Define entities
178178
The first step in creating a Data Graph is to define your entities. An entity corresponds to a table in the warehouse.
179179

180180
| Parameters | Definition |
@@ -204,7 +204,7 @@ data_graph {
204204
}
205205
```
206206

207-
### b) Define the profile
207+
### 3b: Define the profile
208208
> info ""
209209
> Segments recommends that you select materialized views under the Profiles Sync Selective Sync settings to optimize warehouse compute costs.
210210

@@ -233,7 +233,7 @@ data_graph {
233233

234234
```
235235

236-
### c) Define relationships
236+
### 3c: Define relationships
237237

238238
Now define your relationships between your entities. The Data Graph supports three types of relationships:
239239
- 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
245245
#### Define profile-to-entity relationship
246246
This is the first level of relationships and a unique type of relationship between Segment profile entity and a related entity.
247247

248-
| Parameters | Definition |
249-
| ----------- | --------------------------------------------------------------------- |
250-
| `relationship` | An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be in all 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 |
248+
| Parameters | Definition |
249+
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
250+
| `relationship` | An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be in all 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 |
253253

254254
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:
255255

@@ -305,12 +305,12 @@ data_graph {
305305
#### Define a 1:many relationship
306306
For 1:many relationships, define the join on between the two entity tables using the spec below.
307307

308-
| Parameters | Definition |
309-
| ----------- | --------------------------------------------------------------------- |
310-
| `relationship` | An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be in all 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 |
308+
| Parameters | Definition |
309+
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
310+
| `relationship` | An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be in all 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 |
314314

315315
**Example:**
316316

@@ -349,19 +349,21 @@ For many:many relationships, define the join on between the two entity tables wi
349349
> warning ""
350350
> 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.
351351

352-
| Parameters | Definition |
353-
| ----------- | --------------------------------------------------------------------- |
354-
| `relationship` | An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be in all 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 |
352+
353+
| Parameters | Definition |
354+
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
355+
| `relationship` | An immutable slug for the relationship, and will be treated as a delete if you make changes. The slug must be in all 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 |
357358

358359
**Junction table spec**
359-
| Parameters | Definition |
360-
| ----------- | --------------------------------------------------------------------- |
361-
| `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 |
360+
361+
| Parameters | Definition |
362+
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
363+
| `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 |
365367

366368
**Example:**
367369

@@ -409,7 +411,7 @@ To edit your Data Graph:
409411

410412
### View Data Graph data consumers
411413

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:
413415
- Under **Unify > Data Graph**, click the **Data consumers** tab
414416
- 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
415417

@@ -421,4 +423,4 @@ Upon editing and saving changes to your Data Graph, a modal will pop up to warn
421423

422424
### Detect warehouse breaking changes
423425

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 warehouse or 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

Comments
 (0)