Abstract
We present an approach for practical rule-based temporal reasoning over RDF/OWL using Allen’s Interval Algebra (IA). Reasoning in Allen’s IA is only tractable for certain subalgebras and is done through path-consistency, a constraint propagation algorithm whose rule-based implementation requires \(O(n^2)\) rules for a subalgebra with n relations. Our approach uses custom built-ins to implement path-consistency using a constant number of rules (just 6) and in a way that is subalgebra-agnostic. In the paper, we present the approach, its implementation in Apache Jena, and an experimental evaluation against traditional rule-based implementations. The evaluation shows a considerable speed-up when backward-chaining is used. A further contribution of the paper is the problem set used in the evaluations.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
When dates and durations do occur they can be used to infer further qualitative relations: If A occurred in 2020 and B in 2021, then A occurred before B.
- 2.
- 3.
- 4.
Inconsistent graphs are those that contain contradictory statements, such as “\(x\mathbin {\{ b \}}y\) and \(y\mathbin {\{ b \}}x\)” (x and y cannot be both, at the same time, “before” each other).
- 5.
Strictly speaking this is the algorithm for 3-consistency, a notion which is equivalent to the more general notion of path-consistency. It has become standard practice to conflate the two notions [20].
- 6.
Before deciding to extend Jena with custom built-ins, we tried to use its math and string manipulation built-ins to implement these operations. But that was really cumbersome, especially due to the lack of built-ins for integer division and modulus.
- 7.
https://github.com/sbatsakis/TemporalRepresentations/blob/master/intervals/qualitative-Allen.owl (commit 3656fa5 on Jun 13, 2015).
- 8.
Our qualitative reasoning framework, called QReason, is a generic framework written in Python which adopts an architecture similar to that of GQR [12]. The user specifies a calculus by giving its basic relations and the framework derives the general relations and the calculus properties. Currently, QReason implements two problem generation algorithms. The first, adapted from [25], is a brute-force algorithm. Starting with an empty graph, we add one random edge at a time and check whether the graph is consistent at each step. If the graph becomes inconsistent, we backtrack the last edge choice and try again. The second algorithm, adapted from [20], consists in first generating a random initial solution (set of intervals) and then adding redundant edges until the required parameters of the \(\mathcal {H}\)-model are met. We used both algorithms to generate the problem set of this paper.
- 9.
- 10.
- 11.
- 12.
In [4], the authors also report being able to reason over 500 intervals under 150s using HermiT, but the exact type of reasoning they consider is not clear and their problem set, which was derived from a dataset of dates of marriages, seems to be easier than the one we are using here.
References
Achich, N., Ghorbel, F., Hamdi, F., Métais, E., Gargouri, F.: Approach to reasoning about uncertain temporal data in OWL 2. Procedia Comput. Sci. 176 (2020)
Allen, J.F.: Maintaining knowledge about temporal intervals. Commun. ACM 26(11) (1983)
Anagnostopoulos, E., Batsakis, S., Petrakis, E.G.M.: CHRONOS: a reasoning engine for qualitative temporal information in OWL. Procedia Comput. Sci. 22 (2013)
Batsakis, S., Petrakis, E., Tachmazidis, I., Antoniou, G.: Temporal representation and reasoning in OWL 2. Semant. Web 8(6) (2016)
Batsakis, S., Tachmazidis, I., Antoniou, G.: Representing time and space for the semantic web. Int. J. Artif. Intell. Tools 26(3) (2017)
van Beek, P.: Reasoning about qualitative temporal information. Artif. Intell. 58 (1992)
Beek, P.V., Cohen, R.: Exact and approximate reasoning about temporal relations. Comput. Intell. 6(3) (1990)
Cox, S.J.D., Little, C.: Time ontology in OWL. Candidate Recommendation, W3C, March 2020
Drakengren, T., Jonsson, P.: Towards a complete classification of tractability in Allen’s algebra. In: Proceedings of the 15th IJCAI (1997)
Dylla, F., et al.: A survey of qualitative spatial and temporal calculi: algebraic and computational properties. ACM Comput. Surv. 50(1) (2017)
Forgy, C.L.: Rete: a fast algorithm for the many pattern/many object pattern match problem. Artif. Intell. 19, 17–37 (1982)
Gantner, Z., Westphal, M., Wölfl, S.: GQR: a fast reasoner for binary qualitative constraint calculi. In: Proceedings of the AAAI WS on Spatial and Temporal Reasoning (2008)
Glimm, B., Horrocks, I., Motik, B., Stoilos, G., Wang, Z.: HermiT: an OWL 2 reasoner. J. Automat. Reason. 53(3) (2014)
Golumbic, M.C., Shamir, R.: Complexity and algorithms for reasoning about time: a graph-theoretic approach. J. ACM 40(5), 1108–1133 (1993)
Holzmann, C.: Rule-based reasoning about qualitative spatiotemporal relations. In: Proceedings of 5th International Workshop on Middleware for Pervasive and Ad-Hoc Computing: Held at the ACM/IFIP/USENIX 8th International Middleware Conference. ACM (2007)
Horridge, M., Bechhofer, S.: The OWL API: a Java API for working with OWL 2 ontologies. In: Proceedings of the 6th International Conference OWL: Experiences and Directions. CEUR-WS.org (2009)
Horrocks, I., Patel-Schneider, P.F., Boley, H., Tabet, S., Grosof, B., Dean, M.: SWRL: a semantic web rule language combining OWL and RuleML. W3C member submission, W3C, May 2004
Krokhin, A., Jeavons, P., Jonsson, P.: Reasoning about temporal relations: the tractable subalgebras of Allen’s interval algebra. J. ACM 50(5), September 2003
Ladkin, P.B., Maddux, R.D.: On binary constraint networks. Technical report. KES.U.88.8, Kestrel Institute (1988)
Ladkin, P.B., Reinefeld, A.: Effective solution of qualitative interval constraint problems. Artif. Intell. 57(1) (1992)
Ligozat, G.: Qualitative Spatial and Temporal Reasoning. Wiley, Hoboken (2012)
Llorens, H., Chambers, N., UzZaman, N., Mostafazadeh, N., Allen, J., Pustejovsky, J.: SemEval-2015 task 5: QA TempEval: evaluating temporal information understanding with question answering. In: Proceedings of the 9th International Workshop on Semantic Evaluation. ACL, June 2015
Mantle, M., Batsakis, S., Antoniou, G.: Large scale distributed spatio-temporal reasoning using real-world knowledge graphs. Knowledge-Based Syst. 163 (2019)
Milea, V., Frasincar, F., Kaymak, U.: tOWL: a temporal web ontology language. IEEE Trans. Syst. Man Cybern. 42(1) (2012)
Nebel, B.: Solving hard qualitative temporal reasoning problems: evaluating the efficiency of using the ORD-Horn class. Constraints 1 (1997)
Nebel, B., Bürckert, H.J.: Reasoning about temporal relations: a maximal tractable subclass of Allen’s interval algebra. J. ACM 42(1) (1995)
Sirin, E., Parsia, B., Grau, B.C., Kalyanpur, A., Katz, Y.: Pellet: a practical OWL-DL reasoner. J. Web Semant. 5(2) (2007)
Stravoskoufos, K., Petrakis, E.G.M., Mainas, N., Batsakis, S., Samoladas, V.: SOWL QL: Querying spatio-temporal ontologies in OWL. J. Data Semant. 5 (2016)
Terziyan, V., Kaikova, O.: Ontology for temporal reasoning based on extended Allen’s interval algebra. Int. J. Metadata Semant. Ontol. (2016)
The Apache Software Foundation: Apache Jena (2021). https://jena.apache.org/. Accessed 03 Nov 2021
Villain, M., Kautz, H.: Constraint propagation algorithms for temporal reasoning. In: Proceedings of the AAAI Conference on Artificial Intelligence (AAAI 1986). AAAI Press (1986)
Acknowledgments
This work was partially supported by the DARPA KAIROS program.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Lima, G., Machado, M., Uceda-Sosa, R., Moreno, M. (2021). Practical Rule-Based Qualitative Temporal Reasoning for the Semantic Web. In: Moschoyiannis, S., Peñaloza, R., Vanthienen, J., Soylu, A., Roman, D. (eds) Rules and Reasoning. RuleML+RR 2021. Lecture Notes in Computer Science(), vol 12851. Springer, Cham. https://doi.org/10.1007/978-3-030-91167-6_13
Download citation
DOI: https://doi.org/10.1007/978-3-030-91167-6_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-91166-9
Online ISBN: 978-3-030-91167-6
eBook Packages: Computer ScienceComputer Science (R0)