Language Models as Ontology Encoders