# `plays` statement

The statement `<LABEL> plays <SCOPED ROLE LABEL>` is used to identify the `<LABEL>` type as a role player of `<SCOPED ROLE LABEL>`.

Schema for the following examples

```typeql
#!test[schema, commit]
define
relation parentship, relates parent, relates child;
entity user, plays parentship:child;
```

## [](#_defining_role_players)Defining role players

The `plays` keyword can be used to define a type as a role player of a role type. Note that a scope is required to resolve role type names ambiguity.

```typeql
#!test[schema]
define user plays parentship:parent;
```

## [](#_undefining_role_players)Undefining role players

The `plays` keyword can be used to undefine a type’s role.

```typeql
#!test[schema]
undefine plays parentship:parent from user;
```

## [](#_matching)Matching

### [](#_matching_played_role_types)Matching played role types

The `plays` keyword can be used to match all role types a type plays.

```typeql
#!test[schema]
match user plays $r;
```

### [](#_matching_role_player_types)Matching role player types

The `plays` keyword can be used to match all role player types for a role type with a label `<LABEL>`.

```typeql
#!test[schema]
match $rp plays parent;
```

Note that a scope can be used to have more specific results. The previous query can return results for different role types with the same `<LABEL>`, while the following example returns only relation types with the specified scope.

```typeql
#!test[schema]
match $rp plays parentship:parent;
```

[relates](../relates/index.md) [value](../value/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/typeql-reference/modules/ROOT/pages/statements/plays.adoc) Edit this page on GitHub.