  Isocyanic acid (HNCO) is a simple molecule with a potential to form prebiotic
and complex organic species. Using a spectral survey collected with the Atacama
Pathfinder EXperiment (APEX), in this work we report the detection of 42
transitions of HNCO in the hot molecular core/outflow G331.512-0.103 (hereafter
G331). The spectral lines were observed in the frequency interval $\sim$ 160 -
355 GHz. By means of Local Thermodynamic Equilibrium (LTE) analyses, applying
the rotational diagram method, we studied the excitation conditions of HNCO.
The excitation temperature and column density are estimated to be $T_{ex}$ =
58.8 $\pm$ 2.7 K and $N$ = (3.7 $\pm$ 0.5) $\times$ 10$^{15}$ cm$^{-2}$,
considering beam dilution effects. The derived relative abundance is between
(3.8 $\pm$ 0.5) $\times $10$^{-9}$ and (1.4 $\pm$ 0.2) $\times $10$^{-8}$. In
comparison with other hot molecular cores, our column densities and abundances
are in agreement. An update of the internal partition functions of the four
CHNO isomers: HNCO; cyanic acid, HOCN; fulminic acid, HCNO; and isofulminic
acid, HONC is provided. We also used the astrochemical code Nautilus to model
and discuss HNCO abundances. The simulations could reproduce the abundances
with a simple zero-dimensional model at a temperature of 60 K and for a
chemical age of $\sim$ 10$^5$ years, which is larger than the estimated
dynamical age for G331. This result could suggest the need for a more robust
model and even the revision of chemical reactions associated with HNCO.
