This paper presents an ontology-based digital library system, whose capability goes far beyond simple key word based query. There are two important components in our system: query expansion and ontology extraction. In the proposed system, we integrate ldquoWorldNetrdquo as the query expansion module to broaden the query scope, which leads to better recall rate for retrieval. A novel ontology inference algorithm was also proposed. The proposed ontology inference algorithm automatically constructs the ontology of the knowledge base for specific query domain. With this domain specific ontology based knowledge representation, our query system is capable of human-like general semantic reasoning to disambiguate the ambiguous words and improve the precision of retrieval. We evaluate the proposed system on a large set of documents from 10 different subject domains. Experimental results demonstrate the effectiveness of our proposed system. Our system achieves on average 5% improvement compared with the traditional key word based search method.