If $x$ is related to $y$ and $y$ to $z$, then $x$ and $z$ are related.
Let $R$ be a relation from $X$ to $Y$ and $S$ a relation from $Y$ to $Z$. The composite relation from $X$ to $Z$ contains the pair $(x, z) \in (X \times Z)$ if and only if there exists a $y \in Y$ such that $(x, y) \in R$ and $(y,z) \in S$. This composite relation is sometimes called the relative product.
We denote the composite relation of $R$ and $S$ by $R \circ S$ or $RS$.
Let $X$ be the set of people and let $R$ be the relation in $X$ “is a brother of” and $S$ be the relation in $X$ “is a father of”. Then $RS$ is the relation “is an uncle of”.
Composition of relation is associative but not commutative.1