# LibTmux.Snapshot.related/4

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/snapshot.ex#L297
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-snapshot-related-4/

```
related(snapshot, entity, id, relation)
@spec related(
        t(),
        LibTmux.Schema.entity_selector(),
        LibTmux.Ref.id(),
        atom()
      ) ::
        LibTmux.Schema.observation()
        | nil
        | [LibTmux.Schema.observation()]
```

Resolves one source's covered relation through captured indexes; never refreshes.

Ambiguity in another source does not affect this lookup. Whole-selection
filtering still validates its entire required relationship domain first.

See the [worked example](api-examples.html#local-graph-and-filtering).

## Parameters

- `snapshot` (`t()`)
- `entity` (`LibTmux.Schema.entity_selector()`)
- `id` (`LibTmux.Ref.id()`)
- `relation` (`atom()`)

## Guides

Pages that discuss `related/4`.

- [Captured tmux state](/en/elixir/pr-173/concepts/observations/)
