# An Embedding-Based Approach to Repairing OWL Ontologies
## 3 Approach
### Information Preparing  
When translating an axiom into one or multiple natural language sentences, we borrow the idea given in NaturalOWL [37]. Nonetheless, NaturalOWL does not translate all kinds of axioms or entities. It does not consider those axioms about properties such as property inclusion axioms and transitive properties. Furthermore, nested ObjectintersectionOf and ObjectUnionOf operators are not allowed. Table 1 presents most of the rules implemented in NaturalOWL to transfer concepts or axioms to phrases or sentences separately. These rules are summarized manually by taking a toy example as this tool's input and then observing its outputs. This example is an OWL ontology constructed by using a widely used ontology editor Protege ([[https://protege.stanford.edu/](https://protege.stanford.edu/)]([https://protege.stanford.edu/](https://protege.stanford.edu/)), accessed on 15 November 2022), and contains various kinds of axioms, complex concepts and properties. In case some axioms cannot be translated by NaturalOWL, we do transformation by keeping their main characteristic. For instance, the axiom \"SymmetricObjectProperty(op)\" is translated to \"op is symmetric\", and the axiom \"SubClassOf(A DataMaxCardinality(3 dp owl:real))\" is transformed to \"A dp at most 3 owl:real\". After obtaining the sentences for all axioms in an ontology, a pre-trained model could be adopted to represent the sentences with vectors, such as the models Word2 Vec [32], BERT [35], Sentence-BERT [36] and CoSENT (Cosine Sentence) ([[https://kexue.fm/archives/8847](https://kexue.fm/archives/8847)]([https://kexue.fm/archives/8847](https://kexue.fm/archives/8847)), accessed on 15 November 2022). In this paper, we use the models Sentence-BERT and CoSENT to compute embeddings due to their excellent performances in computing similarities for sentences in the English language. Sentence-BERT makes balances between performance and efficiency and trains the upper classification function by supervised learning. CoSENT uses a ranking loss function, which makes the training process closer \begin{table}
\begin{tabular}{l l l} \hline \hline
**Ontology Elements** & **OWL Representation** & **Phrases or Sentences** \\ \hline \multirow{5}{*}{Concepts} & ObjectSome/ValueFrom(op A) & op at least one A \\  & ObjectAllValueFrom(op A) & op only A \\  & ObjectHasValue(op a) & op a \\  & ObjectInGenOf(A B) & A and B \\  & ObjectUnionOf(A B) & A or B \\  & ObjectExactCardinality(n or A) & op exactly n A \\  & ObjectInCardinality(n op A) & op at least n A \\  & ObjectMaxCardinality(n op A) & op at most n A \\ \hline \multirow{5}{*}{Axioms} & SubClassOf(A B) & A is a kind of B \\  & DisjointClasses(A B) & A is n’t a kind of B \\  & EquivalentClasses(A B) & A is a kind of B \\  & ClassAssertion(A a) & a is a A \\  & ObjectPropertyAssertion(op a b) & a op b \\  & DataPropertyAssertion(dp a v) & a dp v \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Rules to translate OWL concepts or axioms into phrases or sentences, respectively, where \(a\) and \(b\) are individual names, \(A\) and \(B\) are concepts, \(n\) indicates an integer, \(op\) and \(dp\) indicate an object property and a data property separately, and \(v\) is a value. Figure 1: The embedding-based approach to repairing an ontology. to prediction. More details about the experimental results to evaluate various pre-trained models can be found on the official website of PyPi ([[https://pypi.org/project/text2](https://pypi.org/project/text2) vec/]([https://pypi.org/project/text2](https://pypi.org/project/text2) vec/), accessed on 15 November 2022), which indicates the Python Package Index and is a repository of software for the Python programming language.