Skip to content

Commit 6164e22

Browse files
committed
Update extractors
1 parent 82a2e6e commit 6164e22

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

src/engage/audiences/segment-query-language.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title: Segment Query Language Reference
33
plan: engage-foundations
44
---
55

6-
Segment's Query Language lets you define audience segments and computed traits. With clear syntax and practical functionality, the language simplifies the process of defining conditions and computations, helping you extract valuable insights from customer data.
6+
Segment's query language lets you define audience segments and computed traits. With clear syntax and practical functionality, the language simplifies the process of defining conditions and computations, helping you extract valuable insights from customer data.
77

8-
This reference provides a comprehensive overview of the Segment Query Language.
8+
This reference provides a comprehensive overview of the Segment query language.
99

1010
## Overview
1111

@@ -25,7 +25,7 @@ Follow these syntax rules when you create definitions:
2525
- Expressions are composed of chained functions, starting with an extractor and ending with a result.
2626
- `.` serves as the delimiter when chaining functions.
2727
- Audience definitions must return a boolean result (for example, a comparator), while computed trait definitions must return a scalar.
28-
- Functions have well-defined return types that determine the permissible functions in the call-chain.
28+
- Functions have well-defined return types that determine the permissible functions in the call chain.
2929
- When you use junctions, `AND` holds precedence over `OR`, but parentheses offer control over expression combination.
3030
- Each definition allows a maximum of 50 primary expressions.
3131

@@ -34,7 +34,7 @@ Follow these syntax rules when you create definitions:
3434
The language supports the following syntactic sugar adjustments:
3535

3636
- The language automatically wraps a 'literal' extractor function around string or number inputs wherever a scalar expression expects them.
37-
- You can invoke boolean comparator functions `eq`, `neq`, `gt`, `gte`, `lt`, and `lte` by omitting the period and parenthesis and replacing the function name with the equivalent symbols `=`, `!=`, `>`, `>=`, `<`, and `<=`. Regardless of the syntactic sugar, the comparison still dictates the operations allowed in the call-chain.
37+
- You can invoke the boolean comparator functions `eq`, `neq`, `gt`, `gte`, `lt`, and `lte` by omitting the period and parenthesis and replacing the function name with the equivalent symbols `=`, `!=`, `>`, `>=`, `<`, and `<=`. Regardless of the syntactic sugar, the comparison still dictates the operations allowed in the call-chain.
3838

3939
### Definition type
4040

@@ -48,38 +48,38 @@ The following tables list the query languages's available functions.
4848

4949
### Extractors
5050

51-
| `event` | |
52-
| ----------- | --------------------------------------------------------------------- |
53-
| Syntax | `event({s: String})` <br> s - name of event to build an extractor for |
54-
| Return Type | `VectorExtractor` |
55-
| Example | `event('Shoes Bought')` |
51+
| `event` | |
52+
| ----------- | ----------------------------------------------------------------------------- |
53+
| Syntax | `event({s: String})` <br> s - the name of the event to build an extractor for |
54+
| Return Type | `VectorExtractor` |
55+
| Example | `event('Shoes Bought')` |
5656

57-
| `trait` | |
57+
| `trait` | |
5858
| ----------- | --------------------------------------------------------------------------------------------------- |
59-
| Syntax | `trait({s: String})` <br> s - name of the trait to reference |
59+
| Syntax | `trait({s: String})` <br> s - the name of the the trait to reference |
6060
| Return Type | `ScalarExtractor` |
6161
| Description | Similar to the event operator, the trait operator is used to specify profile trait filter criteria. |
6262
| Example | `trait('total_spend')` |
6363

64-
| `property` | |
65-
| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66-
| Syntax | `property({s: String})` <br> s - name of property to build an extractor for <br> In the context of funnel audiences, a parent prefix can be added to reference the parent event. <br> `property(parent: {s: String})` |
67-
| Return Type | `ScalarExtractor` |
68-
| Notes | Only valid within a `where` function or a Reducer |
69-
| Example | `property('total')` |
70-
71-
| `context` | |
72-
| ----------- | ------------------------------------------------------------------------- |
73-
| Syntax | `context({s: String})` <br> s - name of context to build an extractor for |
74-
| Return Type | `ScalarExtractor` |
75-
| Notes | Only valid within a `where` function or a Reducer |
76-
| Example | `context('page.url')` |
77-
78-
| `literal` | |
79-
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
80-
| Syntax | `literal({a: Any})` <br> a - the value to treat as a literal expression |
81-
| Operations allowed in call-chain | None allowed - typically used within another function, like a comparison (with syntactic sugar, this would appear on the right side of the comparison). The outer function or comparison dictates the operations allowed in the call-chain. |
82-
| Example | `literal(100)` <br> |
64+
| `property` | |
65+
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66+
| Syntax | `property({s: String})` <br> s - the name of the property to build an extractor for <br> In the context of funnel audiences, you can add a parent prefix to reference the parent event. <br> `property(parent: {s: String})` |
67+
| Return Type | `ScalarExtractor` |
68+
| Notes | Only valid within a `where` function or a Reducer. |
69+
| Example | `property('total')` |
70+
71+
| `context` | |
72+
| ----------- | --------------------------------------------------------------------------------- |
73+
| Syntax | `context({s: String})` <br> s - the name of the context to build an extractor for |
74+
| Return Type | `ScalarExtractor` |
75+
| Notes | Only valid within a `where` function or a Reducer |
76+
| Example | `context('page.url')` |
77+
78+
| `literal` | |
79+
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
80+
| Syntax | `literal({a: Any})` <br> a - the value to treat as a literal expression |
81+
| Operations allowed in call-chain | None allowed; typically used within another function, like a comparison (with syntactic sugar, this would appear on the right side of the comparison). The outer function or comparison dictates the operations allowed in the call-chain. |
82+
| Example | `literal(100)` <br> |
8383

8484

8585

0 commit comments

Comments
 (0)