Officially out now: The TypeDB 3.0 Roadmap


The type keyword is used in TypeQL for matching a type by its label.


The syntax of a type statement includes:

  • Subject — a concept variable

  • Predicate — the type keyword

  • Object — a type label

<concept-variable> type <type label>;


TypeQL statements with the type keyword are used in match clauses. The type keyword adds a constraint for a concept variable to be of a specified type.

Usage in a match pattern

For this example, use a database with the IAM schema and sample data loaded.

Let’s fetch the user entity type:

Fetch type example
$u type user;
fetch $u;
See example output
Output example
{ "u": { "label": "user", "root": "entity" } }

Learn more

Learn more about sub statement in TypeQL.

Learn about types in TypeQL.

Provide Feedback