# Knowledge Reasoning via Jointly Modeling Knowledge Graphs and Soft Rules

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

- We propose a novel KGC method, Iterlogic-E, which jointly models logical rules and KGs in the framework of a KGE. Iterlogic-E combines the advantages of rules and embeddings in knowledge reasoning. Iterlogic-E models the conclusion labels as 0–1 variables and uses a confidence regularizer to eliminate the uncertain conclusions.
- We propose a novel iterative learning paradigm that strikes a good balance between efficiency and scalability. Iterlogic-E not only densifies the KG but can also filters out incorrect conclusions.
- Compared to traditional reasoning methods, Iterlogic-E offers better interpretability in determining conclusions. It not only knows why the conclusion holds but also knows which is true and which is false.
- We empirically evaluate the performance of Iterlogic-E with the task of link prediction on multiple benchmark datasets. The experimental results demonstrate that Iterlogic-E can outperform other methods on multiple evaluation metrics. The qualitative analysis confirms that Iterlogic-E exhibits higher robustness for rules with varying confidence levels.

## 2. Related Work

#### 2.1. Rule-Based Reasoning

#### 2.2. Embedding-Based Reasoning

#### 2.3. Hybrid Reasoning

## 3. The Proposed Method

#### 3.1. Overview

#### 3.2. Rule Mining and Reasoning

#### 3.2.1. Rule Mining

#### 3.2.2. Rule Reasoning

#### 3.3. Embedding Learning

#### 3.3.1. A Basic KGE Model

#### 3.3.2. Joint Modeling KG and Conclusions of Soft Rules

Algorithm 1: Iterative learning algorithm of Iterlogic-E | ||||

**Input:**- Knowledge graph $\mathcal{T}=\left\{({e}_{i},{r}_{k},{e}_{j})\right\}$, soft logical rules $\mathcal{F}=\left\{({f}_{p},{c}_{p})\right\}$, the number of iterative learning steps M.
**Output:**- Relation and entity embeddings $\mathsf{\Theta}$ ($\mathsf{\Theta}$ consists of two matrices: one containing the vector representation of all entities, and the other containing the vector representation of all relations).
| ||||

1 | Randomly initialize relation and entity embeddings $\mathsf{\Theta}\left(0\right)$ | |||

2 | for $n\leftarrow 1$ to N do | |||

3 | $\mathcal{C}\leftarrow \u2300$ | |||

4 | if n/[N/M] == 0 then | |||

5 | Generate a set of conclusions ${\mathcal{C}}^{\prime}=\left\{({e}_{i}^{\prime},{r}_{k}^{\prime},{e}_{j}^{\prime})\right\}$ by rule grounding from $\mathcal{T},\mathcal{F}$ | |||

6 | $\mathcal{C}=\mathcal{C}\cup {\mathcal{C}}^{\prime}$ | |||

7 | end | |||

8 | Sample a batch triples ${\mathcal{T}}^{b},{\mathcal{C}}^{b}$ from $\mathcal{T},\mathcal{C}$ | |||

9 | Generate negative examples ${\mathcal{T}}_{neg}^{b}$ | |||

10 | ${\mathcal{L}}^{b}\leftarrow \u2300$ | |||

11 | for each ${x}_{l}\in {\mathcal{T}}_{neg}^{b}\cup {\mathcal{T}}^{b}\leftarrow 1$ to N do | |||

12 | ${y}_{l}=+1/-1$ | |||

13 | ${\mathcal{L}}^{b}\leftarrow {\mathcal{L}}^{b}\cup ({x}_{l},{y}_{l})$ | |||

14 | end | |||

15 | ${\mathsf{\Theta}}^{\left(n\right)}\leftarrow $ Update ${\mathsf{\Theta}}^{(n-1)}$ by gradient backpropagation of Equation (10) | |||

16 | ${\mathcal{C}}_{t}\leftarrow \u2300$ | |||

17 | for each ${x}_{m}\in \mathcal{C}$ do | |||

18 | if $\sigma \left(f\left({x}_{m}\right)\right)\ge 0.99$ then | |||

19 | ${\mathcal{C}}_{t}\cup \left({x}_{m}\right)$ | |||

20 | end | |||

21 | end | |||

22 | $\mathcal{T}=\mathcal{T}\cup {\mathcal{C}}_{t}$ | |||

23 | end | |||

24 | return ${\mathsf{\Theta}}^{\left(N\right)}$ |

#### 3.4. Discussion

#### 3.4.1. Complexity

#### 3.4.2. Connection to Related Works

## 4. Experiments and Results

#### 4.1. Datasets

#### 4.2. Link Prediction

#### 4.2.1. Evaluation Protocol

#### 4.2.2. Comparison Settings

#### 4.2.3. Implementation Details

**Table 3.**Link prediction results on the test sets of FB15K and DB100K. The boldface scores are the best results, and “-” indicates the missing scores not reported in the literature. The first batch of baselines includes embedding-based models, which rely only on triples seen in the KGs. The middle batch of baselines includes the rule-based reasoning methods. The last batch of baselines further incorporates logical rules and embeddings.

Method | FB15K | DB100K | |||||||
---|---|---|---|---|---|---|---|---|---|

MRR | HITS@1 | HITS@3 | HITS@10 | MRR | HITS@1 | HITS@3 | HITS@10 | ||

1 | TransE [22] | 0.380 | 0.231 | 0.472 | 0.641 | 0.111 | 0.016 | 0.164 | 0.270 |

2 | DistMult [25] | 0.654 | 0.546 | 0.733 | 0.824 | 0.233 | 0.115 | 0.301 | 0.448 |

3 | HolE [28] | 0.524 | 0.402 | 0.613 | 0.739 | 0.260 | 0.182 | 0.309 | 0.4118 |

4 | ComplEx [26] | 0.627 | 0.550 | 0.671 | 0.766 | 0.272 | 0.218 | 0.303 | 0.362 |

5 | ANALOGY [27] | 0.725 | 0.646 | 0.785 | 0.854 | 0.252 | 0.143 | 0.323 | 0.427 |

6 | ComplEx-NNE [47] | 0.727 | 0.659 | 0.772 | 0.845 | 0.298 | 0.229 | 0.330 | 0.426 |

7 | ComplEx-CAS [48] | - | - | - | 0.866 | - | - | - | - |

8 | RotatE [24] | 0.664 | 0.551 | 0.751 | 0.841 | 0.327 | 0.200 | 0.417 | 0.526 |

9 | HAKE [41] | 0.408 | 0.312 | 0.463 | 0.579 | - | - | - | - |

10 | CAKE [40] | 0.741 | 0.646 | 0.825 | 0.896 | - | - | - | - |

11 | R-GCN+ [29] | 0.696 | 0.601 | 0.760 | 0.842 | - | - | - | - |

12 | ConvE [30] | 0.745 | 0.670 | 0.801 | 0.873 | - | - | - | - |

13 | DPMPN [49] | 0.764 | 0.726 | 0.784 | 0.834 | - | - | - | - |

14 | BLP [50] | 0.242 | 0.151 | 0.269 | 0.424 | - | - | - | - |

15 | MLN [21] | 0.321 | 0.210 | 0.370 | 0.550 | - | - | - | - |

16 | PTransE [51] | 0.679 | 0.565 | 0.768 | 0.855 | 0.195 | 0.063 | 0.278 | 0.416 |

17 | KALE [42] | 0.518 | 0.382 | 0.606 | 0.756 | 0.249 | 0.100 | 0.346 | 0.497 |

18 | ComplEx${}^{R}$ [52] | - | - | - | - | 0.253 | 0.167 | 0.294 | 0.420 |

19 | TARE [44] | 0.781 | 0.617 | 0.728 | 0.842 | - | - | - | - |

20 | RUGE [45] | 0.768 | 0.703 | 0.815 | 0.865 | 0.246 | 0.129 | 0.325 | 0.433 |

21 | ComplEx-NNE+AER [47] | 0.801 | 0.757 | 0.829 | 0.873 | 0.311 | 0.249 | 0.339 | 0.426 |

22 | IterE [16] | 0.576 | 0.443 | 0.665 | 0.818 | 0.274 | 0.215 | 0.299 | 0.386 |

23 | pLogicNet [46] | 0.776 | 0.706 | 0.817 | 0.885 | - | - | - | - |

24 | SoLE [17] | 0.801 | 0.764 | 0.821 | 0.867 | 0.306 | 0.248 | 0.328 | 0.418 |

25 | SLRE [18] | 0.810 | 0.774 | 0.829 | 0.871 | 0.340 | 0.261 | 0.372 | 0.490 |

26 | LogicENN [43] | 0.766 | - | - | 0.874 | - | - | - | - |

Iterlogic-E(ComplEx) | 0.814 | 0.778 | 0.835 | 0.873 | 0.374 | 0.301 | 0.409 | 0.509 | |

Iterlogic-E(RotatE) | 0.837 | 0.794 | 0.868 | 0.904 | 0.387 | 0.287 | 0.449 | 0.559 |

#### 4.2.4. Main Results

#### 4.2.5. Ablation Study

#### 4.3. Influence of the Number of Iterations

#### 4.4. Influence of Confidence Levels

#### Runtime

#### 4.5. Case Study

## 5. Conclusions and Future Work

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## References

- Berant, J.; Chou, A.; Frostig, R.; Liang, P. Semantic parsing on freebase from question-answer pairs. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, Seattle, WA, USA, 18–21 October 2013; pp. 1533–1544. [Google Scholar]
- Huang, X.; Zhang, J.; Li, D.; Li, P. Knowledge graph embedding based question answering. In Proceedings of the Twelfth ACM International Conference on Web Search and Data Mining, Melbourne, VIC, Australia, 11–15 February 2019; pp. 105–113. [Google Scholar]
- Wang, X.; Wang, D.; Xu, C.; He, X.; Cao, Y.; Chua, T.S. Explainable reasoning over knowledge graphs for recommendation. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019; pp. 5329–5336. [Google Scholar]
- Cao, Y.; Wang, X.; He, X.; Hu, Z.; Chua, T.S. Unifying knowledge graph learning and recommendation: Towards a better understanding of user preferences. In Proceedings of the World Wide Web Conference, San Francisco, CA, USA, 13–17 May 2019; pp. 151–161. [Google Scholar]
- Auer, S.; Bizer, C.; Kobilarov, G.; Lehmann, J.; Cyganiak, R.; Ives, Z. Dbpedia: A nucleus for a web of open data. In Proceedings of the International Semantic Web Conference, Busan, Republic of Korea, 1–15 November 2007; pp. 722–735. [Google Scholar]
- Bollacker, K.; Evans, C.; Paritosh, P.; Sturge, T.; Taylor, J. Freebase: A collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, Vancouver, BC, Canada, 10–12 June 2008; pp. 1247–1250. [Google Scholar]
- Carlson, A.; Betteridge, J.; Kisiel, B.; Settles, B.; Hruschka, E.; Mitchell, T. Toward an architecture for never-ending language learning. In Proceedings of the AAAI Conference on Artificial Intelligence, Atlanta, GA, USA, 11–15 July 2010. [Google Scholar]
- Ji, S.; Pan, S.; Cambria, E.; Marttinen, P.; Yu, P.S. A survey on knowledge graphs: Representation, acquisition and applications. IEEE Trans. Neural Netw. Learn. Syst.
**2021**, 33, 494–514. [Google Scholar] [CrossRef] [PubMed] - Taskar, B.; Abbeel, P.; Wong, M.F.; Koller, D. Relational markov networks. Introd. Stat. Relational Learn.
**2007**, 175, 200. [Google Scholar] - Galárraga, L.A.; Teflioudi, C.; Hose, K.; Suchanek, F. Amie: Association rule mining under incomplete evidence in ontological knowledge bases. In Proceedings of the 22nd International Conference on World Wide Web, Rio de Janeiro, Brazil, 13–17 May 2013; pp. 413–422. [Google Scholar]
- Giarratano, J.C.; Riley, G. Expert Systems; PWS Publishing: Boston, MA, USA, 1998. [Google Scholar]
- Jackson, P. Introduction to Expert Systems; Addison-Wesley Longman Publishing: Boston, MA, USA, 1986. [Google Scholar]
- Nickel, M.; Murphy, K.; Tresp, V.; Gabrilovich, E. A review of relational machine learning for knowledge graphs. Proc. IEEE
**2016**, 104, 11–33. [Google Scholar] [CrossRef] - Wang, Q.; Mao, Z.; Wang, B.; Guo, L. Knowledge graph embedding: A survey of approaches and applications. IEEE Trans. Knowl. Data
**2017**, 29, 2724–2743. [Google Scholar] [CrossRef] - Pujara, J.; Augustine, E.; Getoor, L. Sparsity and noise: Where knowledge graph embeddings fall short. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, Copenhagen, Denmark, 7–11 September 2017; pp. 1751–1756. [Google Scholar]
- Zhang, W.; Paudel, B.; Wang, L.; Chen, J.; Zhu, H.; Zhang, W.; Bernstein, A.; Chen, H. Iteratively learning embeddings and rules for knowledge graph reasoning. In Proceedings of the World Wide Web Conference, San Francisco, CA, USA, 13–17 May 2019; pp. 2366–2377. [Google Scholar]
- Zhang, J.; Li, J. Enhanced knowledge graph embedding by jointly learning soft rules and facts. Algorithms
**2019**, 12, 265. [Google Scholar] [CrossRef] - Guo, S.; Li, L.; Hui, Z.; Meng, L.; Ma, B.; Liu, W.; Wang, L.; Zhai, H.; Zhang, H. Knowledge graph embedding preserving soft logical regularity. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management, Shanghai, China, 3–7 November 2014; pp. 425–434. [Google Scholar]
- Hájek, P. Metamathematics of Fuzzy Logic, Volume 4 of Trends in Logic; Kluwer: Boston, MA, USA, 1998. [Google Scholar]
- Galárraga, L.; Teflioudi, C.; Hose, K.; Suchanek, F.M. Fast rule mining in ontological knowledge bases with AMIE+. VLDB J.
**2015**, 24, 707–730. [Google Scholar] [CrossRef] - Richardson, M.; Domingos, P. Markov logic networks. Mach. Learn.
**2006**, 62, 107–136. [Google Scholar] [CrossRef] - Bordes, A.; Usunier, N.; Garcia-Duran, A.; Weston, J.; Yakhnenko, O. Translating embeddings for modeling multi-relational data. In Proceedings of the 26th International Conference on Neural Information Processing Systems, Lake Tahoe, NV, USA, 5–8 December 2013; pp. 1–9. [Google Scholar]
- Yang, S.; Tian, J.; Zhang, H.; Yan, J.; He, H.; Jin, Y. Transms: Knowledge graph embedding for complex relations by multidirectional semantics. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence (IJCAI-19), Macao, China, 10–16 August 2019; pp. 1935–1942. [Google Scholar]
- Sun, Z.; Deng, Z.H.; Nie, J.Y.; Tang, J. Rotate: Knowledge graph embedding by relational rotation in complex space. arXiv
**2019**, arXiv:1902.10197. [Google Scholar] - Yang, B.; Yih, W.; He, X.; Gao, J.; Deng, L. Embedding entities and relations for learning and inference in knowledge bases. arXiv
**2014**, arXiv:1412.6575. [Google Scholar] - Trouillon, T.; Welbl, J.; Riedel, S.; Gaussier, É.; Bouchard, G. Complex embeddings for simple link prediction. In Proceedings of the International Conference on Machine Learning, New York, NY, USA, 19–24 June 2016; pp. 2071–2080. [Google Scholar]
- Liu, H.; Wu, Y.; Yang, Y. Analogical inference for multi-relational embeddings. In Proceedings of the International Conference on Machine Learning, Sydney, Australia, 6–11 August 2017; pp. 2168–2178. [Google Scholar]
- Nickel, M.; Rosasco, L.; Poggio, T. Holographic embeddings of knowledge graphs. In Proceedings of the AAAI Conference on Artificial Intelligence, Phoenix, AZ, USA, 12–17 February 2016. [Google Scholar]
- Schlichtkrull, M.; Kipf, T.N.; Bloem, P.; Van DenBerg, R.; Titov, I.; Welling, M. Modeling relational data with graph convolutional networks. In Proceedings of the Semantic Web: 15th International Conference, ESWC 2018, Heraklion, Crete, Greece, June 3–7, 2018, Proceedings 15; Springer International Publishing: Cham, Switzerland, 2018; pp. 593–607. [Google Scholar]
- Dettmers, T.; Minervini, P.; Stenetorp, P.; Riedel, S. Convolutional 2d knowledge graph embeddings. In Proceedings of the AAAI Conference on Artificial Intelligence, New Orleans, LA, USA, 2–3 February 2018. [Google Scholar]
- Guo, L.; Sun, Z.; Hu, W. Learning to exploit long-term relational dependencies in knowledge graphs. In Proceedings of the International Conference on Machine Learning, Long Beach, CA, USA, 10–15 June 2019; pp. 2505–2514. [Google Scholar]
- Shang, C.; Tang, Y.; Huang, J.; Bi, J.; He, X.; Zhou, B. End-to-end structure-aware convolutional networks for knowledge base completion. In Proceedings of the AAAI Conference on Artificial Intelligence, Hilton, HI, USA, 27 January–1 February 2019; pp. 3060–3067. [Google Scholar]
- Shi, B.; Weninger, T. Proje: Embedding projection for knowledge graph completion. In Proceedings of the AAAI Conference on Artificial Intelligence, Hilton, CA, USA, 4–9 February 2017. [Google Scholar]
- Wang, Q.; Huang, P.; Wang, H.; Dai, S.; Jiang, W.; Liu, J.; Lyu, Y.; Zhu, Y.; Wu, H. Coke: Contextualized, knowledge, graph, embedding. arXiv
**2019**, arXiv:1911.02168. [Google Scholar] - Guo, S.; Wang, Q.; Wang, B.; Wang, L.; Guo, L. Semantically smooth knowledge graph embedding. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing, Beijing, China, 26–31 July 2015; pp. 84–94. [Google Scholar]
- Xie, R.; Liu, Z.; Sun, M. Representation learning of knowledge graphs with hierarchical types. In Proceedings of the 25th International Joint Conference on Artificial Intelligence (IJCAI-16), Palo Alto, CA, USA, 9–15 July 2016; pp. 2965–2971. [Google Scholar]
- Hao, J.; Chen, M.; Yu, W.; Sun, Y.; Wang, W. Universal representation learning of knowledge bases by jointly embedding instances and ontological concepts. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, Anchorage, AK, USA, 4–8 August 2019; pp. 1709–1719. [Google Scholar]
- Fatemi, B.; Ravanbakhsh, S.; Poole, D. Improved knowledge graph embedding using background taxonomic information. In Proceedings of the AAAI Conference on Artificial Intelligence, Hilton, HI, USA, 27 January–1 February 2019; pp. 3526–3533. [Google Scholar]
- Veira, N.; Keng, B.; Padmanabhan, K.; Veneris, A.G. Unsupervised embedding enhancements of knowledge graphs using textual associations. In Proceedings of the 28th International Joint Conference on Artificial Intelligence (IJCAI-19), Macao, China, 10–16 August 2019; pp. 5218–5225. [Google Scholar]
- Niu, G.; Li, B.; Zhang, Y.; Pu, S. CAKE: A Scalable Commonsense-Aware Framework For Multi-View Knowledge Graph Completion; ACL: Stroudsburg, PA, USA, 2022; pp. 2867–2877. [Google Scholar]
- Zhang, Z.; Cai, J.; Zhang, Y.; Wang, J. Learning hierarchy-aware knowledge graph embeddings for link prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, New York, NY, USA, 7–12 February 2020; pp. 3065–3072. [Google Scholar]
- Guo, S.; Wang, Q.; Wang, L.; Wang, B.; Guo, L. Jointly embedding knowledge graphs and logical rules. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, Austin, TX, USA, 1–5 November 2016; pp. 192–202. [Google Scholar]
- Nayyeri, M.; Xu, C.; Alam, M.M.; Yazdi, H.S. LogicENN: A Neural Based Knowledge Graphs Embedding Model with Logical Rules. IEEE Trans. Pattern Anal. Mach. Intell.
**2023**, 45, 7050–7062. [Google Scholar] [CrossRef] [PubMed] - Wang, M.; Rong, E.; Zhuo, H.; Zhu, H. Embedding knowledge graphs based on transitivity and asymmetry of rules. In Proceedings of the Advances in Knowledge Discovery and Data Mining: 22nd Pacific-Asia Conference, PAKDD 2018, Melbourne, VIC, Australia, June 3–6, 2018, Proceedings, Part II 22; Springer International Publishing: Cham, Switzerland; pp. 141–153.
- Guo, S.; Wang, Q.; Wang, L.; Wang, B.; Guo, L. Knowledge graph embedding with iterative guidance from soft rules. In Proceedings of the AAAI Conference on Artificial Intelligence, New Orleans, LA, USA, 2–7 February 2018. [Google Scholar]
- Qu, M.; Tang, J. Probabilistic logic neural networks for reasoning. In Proceedings of the Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, Vancouver, BC, Canada, 8–14 December 2019. [Google Scholar]
- Ding, B.; Wang, Q.; Wang, B.; Guo, L. Improving knowledge graph embedding using simple constraints. arXiv
**2018**, arXiv:1805.02408. [Google Scholar] - Yang, J.; Ying, X.; Shi, Y.; Tong, X.; Wang, R.; Chen, T.; Xing, B. Knowledge Graph Embedding by Adaptive Limit Scoring Loss Using Dynamic Weighting Strategy. arXiv
**2022**, arXiv:2202.13785. [Google Scholar] - Xu, X.; Feng, W.; Jiang, Y.; Xie, X.; Sun, Z.; Deng, Z. Dynamically pruned message passing networks for large-scale knowledge graph reasoning. arXiv
**2019**, arXiv:1909.11334. [Google Scholar] - De Raedt, L.; Kersting, K. Probabilistic inductive logic programming. In Probabilistic Inductive Logic Programming: Theory and Applications; Springer: Berlin/Heidelberg, Germany, 2008; pp. 1–27. [Google Scholar]
- Lin, Y.; Liu, Z.; Luan, H.; Sun, M.; Rao, S.; Liu, S. Modeling relation paths for representation learning of knowledge bases. arXiv
**2015**, arXiv:1506.00379. [Google Scholar] - Minervini, P.; Costabello, L.; Muñoz, E.; Novácek, V.; Vandenbussche, P. Regularizing knowledge graph embeddings via equivalence and inversion axioms. In Proceedings of the Machine Learning and Knowledge Discovery in Databases: European Conference, ECML PKDD 2017, Skopje, Macedonia, September 18–22, 2017, Proceedings, Part I 10; Springer International Publishing: Cham, Switzerland, 2017; pp. 668–683. [Google Scholar]

**Figure 1.**We propose a novel iterative knowledge reasoning framework that fuses logical rules into a knowledge graph embedding (KGE). Previous methods associate each conclusion with a weight derived from its corresponding rule. In contrast, our method can infer the true conclusion via jointly modeling the deterministic KG and uncertain soft rules. The facts in red are erroneous conclusions filtered out by our method.

**Figure 2.**The framework outlines Iterlogic-E with two iterative stages: (i) rule mining and reasoning and (ii) embedding learning. In stage (i), rules and grounding rules are generated to derive new conclusions. In stage (ii), the framework simultaneously models the conclusions derived from grounding rules and the KG for learning embeddings. After embedding learning, the conclusions are injected into the KG, and then the rule reasoning module is executed to start the next round of iterative training. The weight of a rule is its partial closed-world assumption (PCA) confidence: refer to Equation (1). The facts in red are erroneous conclusions filtered out by our method. The yellow and green spots indicate the values of entity embedding and relation embedding values, respectively.

**Figure 3.**Link prediction results in different iterations. On the DB100K dataset, the performance changes of Iterlogic-E on the test set as the number of iterations increases.

**Figure 4.**Results of MRR (

**a**) and HITS@1 (

**b**) with different confidence thresholds on FB15K. We set all hyperparameters to their optimum values and change the confidence threshold within [0.5, 1] in 0.05-step increments.

**Table 1.**The datasets’ statistics are presented, with each column representing the quantities of training/validation/test triples, relations, entities, and soft rules. “#” indicates number.

Dataset | # Train/Valid/Test | # Rel | # Ent | # Rule |
---|---|---|---|---|

FB15K | 483,142/50,000/59,071 | 1345 | 14,951 | 441 |

DB100K | 597,572/50,000/50,000 | 470 | 99,604 | 25 |

**Table 2.**Examples of rules that have been extracted. The upper part is three rules mined from the FB15K dataset, and the lower part is three rules mined from the DB100K dataset.

/location/contains$(y,x)\stackrel{0.84}{\Rightarrow}$/location/containedby(x,y) |

/production_company/films$(y,x)\stackrel{0.89}{\Rightarrow}$/location/ containedby(x,y) |

/hud_county_place/place$(x,y)\wedge $ hud_county_place/county$(y,z)$ |

$\stackrel{1.0}{\Rightarrow}$ /hud_county_place/county$(x,z)$ |

sisterNewspaper$(x,y)\wedge $sisterNewspaper$(z,y)\stackrel{0.82}{\Rightarrow}$ sisterNewspaper$(x,z)$ |

distributingCompany$(x,y)\stackrel{0.91}{\Rightarrow}$distributingLabel$(x,y)$ |

nationality$(x,y)\stackrel{0.99}{\Rightarrow}$stateOfOrigin$(x,y)$ |

**Table 4.**Results of link prediction on the test sets of FB15K-sparse. This dataset’s settings are derived from IterE. The training set is identical to FB15K, but the validation and test sets mainly consist of triples involving sparse entities. The boldface scores indicate the best results.

Method | FB15K-Sparse | |||
---|---|---|---|---|

MRR | HITS@1 | HITS@3 | HITS@10 | |

TransE | 0.398 | 0.258 | 0.486 | 0.645 |

DistMult | 0.600 | 0.618 | 0.651 | 0.759 |

ComplEx | 0.616 | 0.540 | 0.657 | 0.761 |

IterE | 0.628 | 0.551 | 0.673 | 0.771 |

SoLE | 0.668 | 0.604 | 0.699 | 0.794 |

Iterlogic-E(ComplEx) | 0.674 | 0.611 | 0.701 | 0.800 |

**Table 5.**Ablation study for different constraints used in Iterlogic-E on DB100K. The boldface scores are the best results. $\mathsf{\Theta}$ indicates the embedding of entities and relations, and “*” indicates replacing the soft constraints of Equations (7)–(9) to select n (where n is the rounded product of the number of conclusions and their confidence value).

DB100K | |||||
---|---|---|---|---|---|

MRR | HITS@1 | HITS@3 | HITS@10 | ||

Iterlogic-E | 0.374 | 0.301 | 0.409 | 0.509 | |

1 | w/o ${l}_{2}$ on $\mathsf{\Theta}$ | 0.323 | 0.278 | 0.342 | 0.409 |

2 | w/o NNE | 0.371 | 0.295 | 0.409 | 0.509 |

3 | 1+2 | 0.324 | 0.279 | 0.342 | 0.410 |

4 | w/o IL | 0.372 | 0.300 | 0.407 | 0.505 |

5 | w/o IL + ${L}_{dc}$ | 0.347 | 0.258 | 0.395 | 0.510 |

6 | w/o IL + ${L}_{rc}$ | 0.351 | 0.257 | 0.406 | 0.515 |

7 | w/o IL + ${L}_{dc}$ + ${L}_{rc}$ | 0.328 | 0.279 | 0.348 | 0.422 |

8 | Iterlogic-E* | 0.369 | 0.298 | 0.404 | 0.502 |

9 | ComplEx + AC + IL | 0.285 | 0.223 | 0.312 | 0.407 |

10 | ComplEx + WC + IL | 0.295 | 0.231 | 0.327 | 0.422 |

ComplEx | 0.272 | 0.218 | 0.303 | 0.362 |

**Table 6.**A case study with 4 conclusions (true or false as predicted by Iterlogic-E), which are reasoned on by 2 rules from the FB15K dataset. The score change indicates the impact on the model prediction score before and after adding rule reasoning.

True | False | |
---|---|---|

Conclusions | (Albany_Devils,/hockey_roster_position/position,Centerman) | (San_Diego_State_Aztecs_football,/hockey_roster_position/position,Linebacker) |

Predicted by rules | /sports_team_roster/position$(x,y)\stackrel{0.808}{\Rightarrow}$ /hockey_roster_position/position$(x,y)$ | |

Score change | 5.4888 → 9.4039 | −4.6518 →−8.3547 |

Conclusions | (Chris_Nurse,/football_roster_position/ team,Stevenage_F.C.) | (Brett_Favre,/football_roster_position/ team,Green_Bay_Packers) |

Predicted by rules | /sports_team_roster/ team$(x,y)\stackrel{0.847}{\Rightarrow}$/football_roster_position/team$(x,y)$ | |

Score change | 5.8123 → 9.5991 | −3.0131 →−11.3952 |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Lan, Y.; He, S.; Liu, K.; Zhao, J.
Knowledge Reasoning via Jointly Modeling Knowledge Graphs and Soft Rules. *Appl. Sci.* **2023**, *13*, 10660.
https://doi.org/10.3390/app131910660

**AMA Style**

Lan Y, He S, Liu K, Zhao J.
Knowledge Reasoning via Jointly Modeling Knowledge Graphs and Soft Rules. *Applied Sciences*. 2023; 13(19):10660.
https://doi.org/10.3390/app131910660

**Chicago/Turabian Style**

Lan, Yinyu, Shizhu He, Kang Liu, and Jun Zhao.
2023. "Knowledge Reasoning via Jointly Modeling Knowledge Graphs and Soft Rules" *Applied Sciences* 13, no. 19: 10660.
https://doi.org/10.3390/app131910660