TypeDB 3.0 is live! Get started for free.

isa statement

The statement <VAR> isa <TYPE> is used to identify the <VAR> as an instance of <TYPE>.

Inserting instance of type

The isa keyword can be used to create a new instance of a given type.

insert $person isa person;

Deleting instance of type

The isa keyword is not used to delete an instance of type. Simply delete the variable that is bound to the instance.

delete $person;

Matching

Matching instances of type

The isa keyword can be used to match all instances of a given type and its subtypes.

match $person isa person;

The isa! keyword can be used to match all instances of a type excluding subtypes.

match $person isa! person;

Matching owner types

The isa keyword can be used to match all types of an instance.

match $person isa $type;

The isa! keyword can be used to match the exact type of an instance.

match $person isa! $type;