An important precondition for the success of the Semantic Web is founded on the principle that the content of web pages will be semantically annotated. In this paper, we propose a method, CMSA, of automatically acquiring semantic annotations. In the CMSA method, semantic annotations are acquired from semantic relationships. Class hierarchy is used to describe semantic relationships. One key feature of CMSA is that the hybrid algorithm of exploiting the desirable properties of both clustering algorithms and inference mechanism is proposed to construct semantic annotations. Another key feature of CMSA is that the k-nearest-neighbor query is introduced to maintain semantic annotations. The method can find more useful semantic information, improve precision, and manage semantic annotations easily.