The electron energy-loss near-edge structure (ELNES) or the x-ray absorption near-edge structure (XANES) spectra of the anion (O, N) and cation (Si,Y) (O-K, N-K, Si-K, $\mathrm{Si}\text{\ensuremath{-}}{\mathrm{L}}_{3}$, Y-K, and $\mathrm{Y}\text{\ensuremath{-}}{\mathrm{L}}_{3}$) edges in 12 crystals of the Y-Si-O-N system have been calculated using an ab initio supercell method based on density functional theory in its local approximation. The collection consists of six binary ($\ensuremath{\alpha}\text{\ensuremath{-}}\mathrm{Si}{\mathrm{O}}_{2}$, stishovite $\mathrm{Si}{\mathrm{O}}_{2}$, $\ensuremath{\beta}\text{\ensuremath{-}}{\mathrm{Si}}_{3}{\mathrm{N}}_{4}$, $\ensuremath{\alpha}\text{\ensuremath{-}}{\mathrm{Si}}_{3}{\mathrm{N}}_{4}$, $\ensuremath{\gamma}\text{\ensuremath{-}}{\mathrm{Si}}_{3}{\mathrm{N}}_{4}$, and ${\mathrm{Y}}_{2}{\mathrm{O}}_{3}$), three ternary (${\mathrm{Si}}_{2}{\mathrm{N}}_{2}\mathrm{O}$, ${\mathrm{Y}}_{2}{\mathrm{Si}}_{2}{\mathrm{O}}_{7}$, and ${\mathrm{Y}}_{2}\mathrm{Si}{\mathrm{O}}_{5}$), and three quaternary (${\mathrm{Y}}_{2}{\mathrm{Si}}_{3}{\mathrm{N}}_{4}{\mathrm{O}}_{3}$, ${\mathrm{Y}}_{4}{\mathrm{Si}}_{2}{\mathrm{O}}_{7}{\mathrm{N}}_{2}$, and ${\mathrm{Y}}_{3}{\mathrm{Si}}_{5}{\mathrm{N}}_{9}\mathrm{O}$) crystals. The calculations took into account the core-hole effect and included the explicit evaluation of the transition matrix elements. Based on the extensive data calculated, attempts were made to correlate the spectral features in the calculated spectra with the local structural environments of the atoms in the crystal. It is shown that with the exception of the fourfold tetrahedrally coordinated Si ion, there is no clear evidence of trends in the ELNES/XANES spectra that can be established to justify a so-called finger printing capability. In crystals with well-defined $\mathrm{Si}\text{\ensuremath{-}}{\mathrm{O}}_{4}$ units, very different Si-K edges were obtained. For the O-K and N-K edges, there are numerous counterexamples of such a correlation that can be traced to effects beyond the nearest neighbor coordination. In the Y-K and $\mathrm{Y}\text{\ensuremath{-}}{\mathrm{L}}_{3}$ edges, no meaningful correlations can be established because of the longer bond lengths and more ionic nature of the bonding. For simpler crystals where nonequivalent sites of a particular ion exist, the weighted sum of the spectra from individual sites should be used for comparison with experiment. These results indicate that for proper interpretation of the experimentally measured spectra in complex ceramics, or for ceramic materials containing microstructures, calculated spectra based on simpler crystals with similar coordination should not be used. It is argued that the proper way to understand these spectra would be to actually model the structure and then carry out the full spectral calculations on the constructed models.