{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/teilp-time-prediction-over-knowledge-graphs","title":"TEILP: Time Prediction over Knowledge Graphs via Logical Reasoning","arxiv_id":"2312.15816","date":"2023-12-25","proceeding":null,"authors":["Siheng Xiong","Yuan Yang","Ali Payani","James C Kerce","Faramarz Fekri"],"abstract":"Conventional embedding-based models approach event time prediction in temporal knowledge graphs (TKGs) as a ranking problem. However, they often fall short in capturing essential temporal relationships such as order and distance. In this paper, we propose TEILP, a logical reasoning framework that naturally integrates such temporal elements into knowledge graph predictions. We first convert TKGs into a temporal event knowledge graph (TEKG) which has a more explicit representation of time in term of nodes of the graph. The TEKG equips us to develop a differentiable random walk approach to time prediction. Finally, we introduce conditional probability density functions, associated with the logical rules involving the query interval, using which we arrive at the time prediction. We compare TEILP with state-of-the-art methods on five benchmark datasets. We show that our model achieves a significant improvement over baselines while providing interpretable explanations. In particular, we consider several scenarios where training samples are limited, event types are imbalanced, and forecasting the time of future events based on only past events is desired. In all these cases, TEILP outperforms state-of-the-art methods in terms of robustness.","url_abs":"https://arxiv.org/abs/2312.15816v2","url_pdf":"https://arxiv.org/pdf/2312.15816v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"teilp-time-prediction-over-knowledge-graphs","repo_url":"https://github.com/xiongsiheng/TEILP","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"logical-reasoning","task_name":"Logical Reasoning"},{"task_slug":"prediction","task_name":"Prediction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.15816","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.15816"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/xiongsiheng/TEILP","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":9},"by_repo_kind":{"listed":{"samples":9,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"5bb356883ace4e9e","entry":"convert_walk_dict_into_path","repo":"xiongsiheng/TEILP","repo_kind":"listed","path":"src/random_walk_for_timestamp_datasets.py","file_url":"https://github.com/xiongsiheng/TEILP/blob/HEAD/src/random_walk_for_timestamp_datasets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5bb356883ace4e9e"}},{"code_sha256_prefix":"6158ba7818cb93d9","entry":"interval_intersection","repo":"xiongsiheng/TEILP","repo_kind":"listed","path":"src/utlis.py","file_url":"https://github.com/xiongsiheng/TEILP/blob/HEAD/src/utlis.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6158ba7818cb93d9"}},{"code_sha256_prefix":"9d53d9f01595414d","entry":"obtain_dataset","repo":"xiongsiheng/TEILP","repo_kind":"listed","path":"src/dataset_setting.py","file_url":"https://github.com/xiongsiheng/TEILP/blob/HEAD/src/dataset_setting.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9d53d9f01595414d"}},{"code_sha256_prefix":"6e0676cc112d7058","entry":"obtain_inv_edges","repo":"xiongsiheng/TEILP","repo_kind":"listed","path":"src/dataset_setting.py","file_url":"https://github.com/xiongsiheng/TEILP/blob/HEAD/src/dataset_setting.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6e0676cc112d7058"}},{"code_sha256_prefix":"ac628f145cccd717","entry":"read_dataset_txt","repo":"xiongsiheng/TEILP","repo_kind":"listed","path":"src/dataset_setting.py","file_url":"https://github.com/xiongsiheng/TEILP/blob/HEAD/src/dataset_setting.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ac628f145cccd717"}},{"code_sha256_prefix":"79d4517e4b0c6309","entry":"shuffle_data","repo":"xiongsiheng/TEILP","repo_kind":"listed","path":"src/utlis.py","file_url":"https://github.com/xiongsiheng/TEILP/blob/HEAD/src/utlis.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"79d4517e4b0c6309"}},{"code_sha256_prefix":"24f5605c6d8557e5","entry":"store_edges","repo":"xiongsiheng/TEILP","repo_kind":"listed","path":"src/Walker_with_sampling.py","file_url":"https://github.com/xiongsiheng/TEILP/blob/HEAD/src/Walker_with_sampling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"24f5605c6d8557e5"}},{"code_sha256_prefix":"1e22a4f282698ce9","entry":"store_neighbors","repo":"xiongsiheng/TEILP","repo_kind":"listed","path":"src/Walker_with_sampling.py","file_url":"https://github.com/xiongsiheng/TEILP/blob/HEAD/src/Walker_with_sampling.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1e22a4f282698ce9"}},{"code_sha256_prefix":"815099e636cab36b","entry":"str_tuple","repo":"xiongsiheng/TEILP","repo_kind":"listed","path":"src/utlis.py","file_url":"https://github.com/xiongsiheng/TEILP/blob/HEAD/src/utlis.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"815099e636cab36b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}