Writing a conditional probability as a marginal

So I understand that using sum-rule one can write a probability as a marginal:

\begin{equation*} P(x) = \int{P(x,\theta)d\theta} = \int{P(x|\theta)P(\theta)}d\theta \end{equation*}

But how is this applied to a conditional probability? For instance in bayesian model comparison I come across this formula a lot:

\begin{equation*} P(\mathcal{D}|m) = \int{P(\mathcal{D}|\theta,m)}P(\theta|m)d\theta \end{equation*}

First of all I'm confused about the notation. Where are the parentheses in $P(\mathcal{D}|\theta,m)$? Is it $P(\mathcal{D}|(\theta,m))$ or is it $P((\mathcal{D}|\theta),m)$? And how is it derived anyway?

• it is exactly the same, $m$ being fixed all over. No need for further parentheses, with $P((\mathcal{D}|\theta),m)$ being not a meaningful notion. Commented Aug 9, 2018 at 21:43

Its $P(\mathcal{D}|\theta,m)$ and it denotes the conditional of $\mathcal{D}$ given both $\theta$ and $m$.
The intuition is exactly the same as the first equation. But since $m$ was given to begin with, it will appear in all conditionals in the right-hand side.