The Be K-edge in beryllium oxide and chalcogenides: soft x-ray absorption spectra from first-principles theory and experiment