In this paper, the authors first analyze the research and development of semantic retrieval technology based on ontology, and introduce the key theoretical knowledge of ontology and semantic web, including the definition, description language, classification and semantic web. Secondly, this thesis makes a deep research on the ontology based semantic retrieval including semantic annotation, Chinese word segmentation, ontology storage, semantic association algorithm and so on. At the same time, it analyzes and introduces the construction principle, methods and tools involved in ontology. Finally, this paper designs and implements a complete ontology based semantic retrieval system based on the ontology of coal mine risk domain ontology, and verifies the feasibility of the system and the theory, and provides the basis for the development and popularization of the ontology based semantic retrieval technology.