Approximate spectral type and luminosity given apparent magnitude and distance I am looking at the data acquired from the Gaia DR2 survey. I found that most of the stars had their distance and apparent magnitude catalogued, but not their spectral type and luminosity class. Is there a way to approximate this?
You can calculate the absolute magnitude of a star:
$$M=m-5\log_{10}(\frac{d}{10\,\text{pc}})$$
where $M$ is absolute magnitude, $m$ is apparent magnitude and $d$ is the distance.
Then you take a look at the HR diagram.

One can easily see, that you need two data to obtain the third one, but we have only one data (absolute magnitude). That means, that you also have to know the luminosity classification of a star:

I: supergiants
II: bright giants
III: giants
IV: subgiants
V: main sequence
VI: white dwarfs

Then you just look at the intersection of the class and absolute magnitude.

If you know radius, then this is even easier. All you need is this formula:
$$T={\Big{(}\frac{10^{0.4(4.77-M)}}{4\pi R^2 \sigma}\Big{)}}^{0.25}$$
$T$ is the temperature in Kelvins, $M$ is absolute magnitude of the star, $R$ is radius of the star, $\sigma$ is Stefan-Boltzmann constant.
With these data you look at the table of temperature and spectral classes or HR diagram.

If you are given color, then you already have an answer (spectral class is defined with color). If you are given temperature, you can look at the HR diagram.