# Cosine-Based Embedding for Completing Lightweight Schematic Knowledge in DL-Lite\({}_{core}\)+
## 4 Method
### The Framework of CosE  
For each axiom \((C_{i},r,C_{j})\) with transitivity or symmetry relation \(r\) expressed in DL-Lite\({}_{core}\), the existing KG embedding models prefer to treat relation \(r\) as one single symbol, but they usually ignore its logical properties. Therefore, the transitivity and symmetry of relations cannot be preserved in the semantic space, which is hardly applied to schematic knowledge completion. To better complete lightweight schematic knowledge, we propose a cosine-based embedding model called CosE, which can simultaneously preserve the transitivity of \(subclassOf\) and symmetry of \(disjointWith\) well. Figure 2 shows the framework of CosE for schematic knowledge embedding with a concrete example, where the relations \(subclassOf\) and \(disjointWith\) are denoted by solid lines and dotted lines, respectively. Given a set of axioms expressed in DL-Lite\({}_{core}\) shown in Figure 2a, CosE divides them into two disjoint sets, \(S\cup D\) shown in Figure 2b, where \(S\) and \(D\) contain all the \(subclassOf\) axioms and \(disjointWith\) axioms, respectively. Then, all the concepts in \(S\) and \(D\) are projected according to the type of relations into angle-based semantic space and translation-based semantic space shown in Figure 2c. The angle-based semantic space is employed to preserve the transitivity or symmetry of relations in axioms, and the translation-based semantic space is used to measure the confidence of each axiom. Finally, the embedding of concepts will be obtained when the process of training CosE is finished. Notice that \(subclassOf\) and \(disjointWith\) relations are 1-to-N and N-to-N ones. For example, one concept could belong to (or disjoint with) several concepts. To measure the confidences of axioms more accurately, CosE introduces the mapping matrix \(\mathbf{M_{C_{i}C_{j}}}\) to encode concepts as vectors in translation-based semantic space, where \(C_{i}\), \(C_{j}\) are the concepts in given axioms. For the axiom \((C_{1},subclassOf,C_{2})\) shown in Figure 2c, the concepts \(C_{1}\), \(C_{2}\) will be projected by \(\mathbf{M_{C_{i}C_{j}}}\). It indicates that each axiom will be projected into one translation-based semantic space tailored for itself. More specifically, as shown in Figure 2c, we assume that \(\mathbf{C_{1,1}^{12}}\), \(\mathbf{C_{2,1}^{12}}\) are the projected vectors of \(C_{1}\) and \(C_{2}\) by \(\mathbf{M_{C_{1}C_{2}}}\), and \(\mathbf{C_{2,1}^{23}}\) and \(\mathbf{C_{3,1}^{23}}\) are the projected vectors of \(C_{2}\) and \(C_{3}\) by \(\mathbf{M_{C_{2}C_{3}}}\). It is easy to observe that the located translation-based semantic spaces of them are different, which is helpful for each axiom to obtain a suitable confidence in its projected space. Given one axiom \((C_{i},r,C_{j})\), we define its mapping matrix \(\mathbf{M_{C_{i}C_{j}}}\) as follows:  
\[\mathbf{M_{C_{i}C_{j}}}=\mathbf{C_{ip}C_{jp}^{\top}}+\mathbf{I^{n\times n}}, \tag{1}\]  
where \(\mathbf{C_{ip}},\mathbf{C_{jp}}\in\mathbb{R}^{n}\) are the projection vectors of head concept \(C_{i}\) and tail concept \(C_{j}\) in axiom \((C_{i},r,C_{j})\). \(\mathbf{I^{n\times n}}\) is an identity matrix. According to the defined mapping matrix \(\mathbf{M_{C_{i}C_{j}}}\), the projected vectors of concepts \(C_{i}\) and \(C_{j}\) in its translation-based semantic space are calculated as follows:  
\[\mathbf{C_{i\perp}}=\mathbf{M_{C_{i}C_{j}}C_{i}},\quad\mathbf{C_{j\perp}}= \mathbf{M_{C_{i}C_{j}}C_{j}}. \tag{2}\]  
As shown in Figure 2c, the translation-based semantic space introduced in CosE can only measure the confidence of axioms, while the logical properties of relations need to be encoded through the angle-based semantic space. To deal with the transitivity of axioms \((C_{1},subclassOf,C_{2})\) and \((C_{2},subclassOf,C_{3})\) in \(\mathcal{S}\), we hope the angles among vectors of \(C_{1}\), \(C_{2}\) and \(C_{3}\) should be close to \(0^{\circ}\).