There are several places (e.g. this SE answer), where the formula for the semi-partial correlation coefficient of a variable $x$ with $y$, controlling for another variable $z$, say, is given as $$ r_{xy|z} = \frac{r_{xy} - r_{xz} r_{yz}}{\sqrt{1 - r_{yz}^2}}\ . $$ How would this formula generalise to the case of $k$ predictors $\{x_1, x_2, \ldots, x_k\}$, where I wish to compute the semi-partial correlation between each predictor and $y$ while controlling for all the other predictors? Based solely on the form of the above formula, I would conjecture $$ r_{iy|J} = \frac{r_{iy} - \left( r_{i2}\cdots r_{ik} \right) \left( r_{2y} \cdots r_{(i-1)y} r_{(i+1)y} \cdots r_{ky} \right)}{\sqrt{1 - \left( r_{i2}\cdots r_{ik} \right)^2}}\ , $$ where with $J$ I denote the set $\{ 1, 2, \ldots, k\} \setminus i$.
Is this correct? I have been unable to locate a reference for the same.
The context for this question is that I would like to able to convert between the semi-partial correlation coefficient and the corresponding $\beta$ of a multiple linear regression, similar to this question.