Ontologies have been shown to be beneficial for representing domain knowledge, and are quickly becoming the backbone of the Semantic Web. The need for ontology ranking techniques is crucial as the ontology reuse becomes increasingly important. In this paper, a new approach has been proposed for ranking ontologies on the Semantic Web. In particular, query terms provided by users are regarded as containing special information about domain knowledge of interest. Each ontology candidates are analyzed separately and ranked with respect to the structure and semantics. Experiments are performed and the results show that our method is cost-effective.