In this article, we propose an ontology learning algorithm for ontology similarity measure and ontology mapping in view of distance function learning techniques. Using the distance computation formulation, all the pairs of ontology vertices are mapped into real numbers which express the distance of their corresponding vectors. The more distance between two vertices, the smaller similarity between their corresponding concepts. The stabilities of our learning algorithm are defined and several bounds are yielded via stability assumptions. The simulation experimental conclusions show that the new proposed ontology algorithm has high efficiency and accuracy in ontology similarity measure and ontology mapping in certain engineering applications.