> For the complete documentation index, see [llms.txt](https://docs.atfinity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.atfinity.io/rule-language/declarations/is-with-where.md).

# is with where

An **Existence** **declaration** that allows selecting specific *Instances* based on some condition that has to be fulfilled regarding that *Instance*.

### Syntax

`VARIABLE is ONTOLOGY, ROLE_1, ... ROLE_N where CONDITION`

A match with the name `VARIABLE` is created for an instance that has the Ontology `ONTOLOGY` and all the roles (`ROLE_1` to `ROLE_N`), and the value for the `Information Field` matches the `CONDITION`.

`self` can be used inside the condition instead of `VARIABLE`.

### Example: with VARIABLE Information Field

```python
p is Person where p.first_name = 'John'
```

If there is a `Person` Instance in the Case and the value of its Information Field `first_name` is 'John', it will be available in the variable `p`. In this example the `CONDITION` is `p.first_name = 'John'`.

### Example: with self Information Field

```
p is Person where self.first_name = 'John'
```

The same expression can be written with `self` inside the `CONDITION` to obtain the same result.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/declarations/is-with-where.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
