---
sidebar:
  hidden: true
title: roboto.domain.triggers.conditions
---
## Module Contents

### ConditionMatcher

```python
class roboto.domain.triggers.conditions.ConditionMatcher(
    namespace: roboto.domain.triggers.namespace.EventNamespace,
    default_root: str,
)
```

`from roboto.domain.triggers import ConditionMatcher`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/conditions.py#L65-L116)

Evaluates a trigger condition tree against an event namespace.

Reuses the query [`Condition`](/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Condition) comparators unchanged; only the value source differs. Each leaf routes to the namespace root its field targets and matches against that root's record, so roots hydrate lazily on first reference. A root whose record is missing evaluates to a non-match, so `NOT_EXISTS` and `IS_NULL` never match against an entity that was deleted before evaluation.

**Parameters**

- **namespace** (`roboto.domain.triggers.namespace.EventNamespace`)
- **default_root** (`str`)

#### ConditionMatcher.matches()

```python
def matches(condition: Optional[roboto.query.ConditionType]) -> bool
```

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/conditions.py#L87-L91)

Return whether `condition` holds for the event. A `None` condition always matches.

**Parameters**

- **condition** (`Optional[roboto.query.ConditionType]`)

**Returns**

- `bool`

### UNSTRIPPED_ROOTS

```python
roboto.domain.triggers.conditions.UNSTRIPPED_ROOTS: frozenset[str]
```

`from roboto.domain.triggers.conditions import UNSTRIPPED_ROOTS`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/conditions.py#L26-L28)

Namespace roots the query [`Field`](/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Field) parser does not recognize as resource prefixes, so it leaves them in the lookup path (`changed.vehicle_id` stays whole, unlike `dataset.x` which strips to `x`). Derived from the default catalog's exposed roots.

### explicit_root()

```python
def roboto.domain.triggers.conditions.explicit_root(
    condition: roboto.query.Condition,
) -> Optional[str]
```

`from roboto.domain.triggers.conditions import explicit_root`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/conditions.py#L44-L62)

Return the namespace root `condition`'s field explicitly names, or `None` if unqualified.

`dataset.*`/`file.*`/`topic.*`/`msgpath.*` prefixes are recognized by the query field parser; any other first segment counts as a root only when it is in [`UNSTRIPPED_ROOTS`](/reference/python-sdk/roboto/domain/triggers/conditions#roboto.domain.triggers.conditions.UNSTRIPPED_ROOTS). An unqualified field binds to the event's default root.

**Parameters**

- **condition** (`roboto.query.Condition`)

**Returns**

- `Optional[str]`

### iter_leaf_conditions()

```python
def roboto.domain.triggers.conditions.iter_leaf_conditions(
    condition: roboto.query.ConditionType,
) -> collections.abc.Iterator[roboto.query.Condition]
```

`from roboto.domain.triggers.conditions import iter_leaf_conditions`

[Source](https://github.com/roboto-ai/roboto-python-sdk/blob/main/src/roboto/domain/triggers/conditions.py#L35-L41)

Yield every leaf [`Condition`](/reference/python-sdk/roboto/query/conditions#roboto.query.conditions.Condition) in `condition`, depth-first.

**Parameters**

- **condition** (`roboto.query.ConditionType`)

**Returns**

- `collections.abc.Iterator[roboto.query.Condition]`
