Label Expressions

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

A label is the name you gave a vertex or edge in the graph definition, such as individual or orderProduct. A label expression lets you combine those names.

Write the expression after the colon: (v:<label_expression>) for an object, -[e:<label_expression>]-> for a connection.

OperatorNameMeaningEcommerce example
:LabelLabelHas this label(i:individual)
&ConjunctionHas both labels(i:individual & loyaltyMember)
|DisjunctionHas either label(item:individual | product)
!NegationDoesn’t have this label(v:!loyaltyMember)
%WildcardAny vertex or any edge(item:%)

A bare (v) is the same as (v:%).

Operators bind in this order: !, then &, then |. So individual | product & featured means individual | (product & featured). And !individual & product means (!individual) & product. Use parentheses to override the default. To negate a negation, parenthesize the inner expression: !(!individual).

That matches a featured product, not a featured customer, unless you also gave customers the featured label.

The commerce graph in Defining a Property Graph has one label per table. Use this copy of that definition, with extra labels, for the examples on this page.

Don’t put loyaltyMember on every customer if you want individual & !loyaltyMember to return rows. This definition uses a second Individual vertex table, otherCustomers, for customers who aren’t loyalty members. Filter each Individual table so the same customer isn’t in both, or every customer still matches loyaltyMember through loyaltyCustomers.

The two Individual subqueries keep loyalty members and other customers in separate vertex tables. The two customerOrder edge tables give both groups a path to orders.

Using the same variable twice keeps only the records that match both patterns.

That is the same as MATCH (item:product & (featured | seasonal)).