Officially out now: The TypeDB 3.0 Roadmap >>

Conjunctions

A conjunction of patterns requires all its constituent patterns to match its concepts. It is most commonly encountered as the body of a match clause.

Syntax

A conjunction is represented by a sequence of patterns, each terminated by a semicolon.

<pattern>; <pattern>; [ <pattern>; ... ]

Optionally, the conjunction may be enclosed in braces. In that case, like any pattern, the conjunction is also terminated by a semicolon.

{ <pattern>; <pattern>; [ <pattern>; ... ] };

Example

The following conjunction matches all users with name Bob Dylan:

{
  $u isa user;
  $u has name "Bob Dylan";
};

This is a conjunction of two patterns: it must match some concept $u that is an instance of type user, and $u must have an attribute of type name with value "Bob Dylan".