KI - Künstliche Intelligenz

, Volume 31, Issue 4, pp 377–380 | Cite as

Using Ontology-Based Data Access to Enable Context Recognition in the Presence of Incomplete Information

  • Veronika Thost
Doctoral and Postdoctoral Dissertations

1 Introduction

Ontologies play an important role as a semantic layer for data access in various areas such as the Semantic Web, medicine, and enterprise applications. They capture the terminology of an application domain and describe domain knowledge in a machine-processable way. Formal ontology languages additionally provide semantics to these specifications.

In contrast to standard database systems, systems for ontology-based data access (OBDA) may thus infer additional information, only implicit in the given data, to answer queries. Moreover, they usually employ the open-world assumption, which means that knowledge that is not stated explicitly in the data and cannot be inferred is neither assumed to be true nor false. This faithfully models the real world and differs from database query answering, where knowledge not present in the data is assumed to be false.

All these features make ontologies valuable tools for systems that integrate heterogeneous data sources and need to automatically interpret the data, to support data analysis or to fully-automatedly recognize complex contexts.

This has been generally recognized and several standardized ontologies have recently been published [12, 14].

However, often, the processed data is changing and thus temporal in that it is associated to specific points in time, and this temporal dimension may be critical for analysis or for describing and recognizing real-world contexts; e.g., sensors produce data streams.

Classical OBDA regards however only a single moment [7], which means that information about time cannot be used for reasoning and is thus lost.

In the doctoral dissertation [17], we therefore investigate temporal query languages that allow to access temporal data through classical ontologies. In particular, we study the computational complexity of temporal query answering regarding ontologies written in lightweight description logics, such as DL-Lite [2, 11], which are known to allow for efficient reasoning in the atemporal setting and are successfully applied in practice.

We also present a so-called rewritability result for ontology-based temporal query answering, which suggests ways for implementation. In this article, we present an overview of our results. They may guide the choice of a query language for temporal OBDA in data-intensive applications that require fast processing, such as context recognition.

2 Ontology-Based Temporal Query Answering

Consider the following example context: “a user watches a video, but, after a while, works with a text editor that hides the video window”. In such a situation, the operating system could optimize resource consumption by decreasing quality parameters of the video. For recognizing the context, it has to be encoded into a temporal query and answered over data about different points in time (i.e., different system states). Ontologies can augment this approach by providing an abstract, user-friendly interface to the data and by stating general domain knowledge, which can be taken into account during query answering.
Fig. 1

Example OBDA scenario with a temporal query addressing a temporal knowledge base that consists of an ontology and three fact bases. The symbols \(\mathtt {User}\) and \(\mathtt {Component}\) are assumed to describe static knowledge, which once given (here at 20:11) holds always in time. The fact \(\mathtt {Component} (\mathtt {w1})\) is implied by \(\mathtt {Window} (\mathtt {w1})\) and axiom (2) at 20:11. \(\mathtt {FocusesOn} (\mathtt {bob},\mathtt {w1})\) is implied at 20:13. The query is answered at 20:15 (“now”) and yields the answer \(x=\mathtt {w1}\)

The setting we focus on is depicted in Fig. 1. The temporal query addresses a temporal knowledge base (TKB) that consists of an ontology and fact bases. We specifically focus on temporal conjunctive queries (TCQs), which combine standard conjunctive queries (CQs) with operators of linear temporal logic (LTL). That is, the CQs address single time points. The above TCQ combines the CQs \(\exists y. \mathtt {User} (y)\wedge \mathtt {FocusesOn} (y,x)\wedge \mathtt {Component} (x)\) and \(\mathtt {NotVisible} (x)\). It queries for all applications x for which, at some time in the past (\(\Diamond _P\)) there existed (\(\exists\)) a user y focusing on them, and (\(\wedge\)) that are not visible anymore now—now, since the CQ \(\mathtt {NotVisible} (x)\) is not prefixed by a temporal operator. x is called answer variable.

A description logic (DL) ontology may, for example, contain axioms stating that every video player is an application (1) or that everyone looking at something focuses on that object (3). The fact bases collect the data we get from sensors at the respective time points. The query is to be answered w.r.t. the last time point n (“now”) for which data is available.

In many applications, there is static knowledge that is true all over time. For instance, a user will always be a user and never become an application. In order to model such knowledge, we also consider the setting where some symbols, such as \(\mathtt {User}\) and \(\mathtt {Component}\), may be declared to be rigid. This increases expressivity but usually makes reasoning more complex. In Fig. 1, the fact \(\mathtt {FocusesOn} (\mathtt {bob},\mathtt {w1})\) and the rigid information \(\mathtt {Component} (\mathtt {w1})\) are implied by the TKB and, in turn, yield \(x=\mathtt {w1}\) as an answer to the first CQ at 20:13 (seen from n, “at some time in the past”). Thus, also the TCQ yields \(x=\mathtt {w1}\) as an answer, at 20:15.

Most related works on temporal query answering w.r.t. ontologies in lightweight DLs actually consider temporal extensions of these DLs (see, e.g., [3, 4, 5, 13]). That is, temporal logic operators may also occur within the ontology. However, reasoning in this setting has turned out to be surprisingly complex, even undecidable [4]. Results interesting for practice are therefore usually obtained by strongly restricting the ontology and/or query language. This is not necessary in our setting. Further, our approach has the advantage that it focuses on ontologies in standard DLs; hence, it can be applied together with existing ontologies.

3 Complexity Results

We study the computational complexity of the decision problem related to temporal query answering, query entailment [9, 10]; that is, the question whether the query can be deduced from the knowledge in the TKB (considering queries containing no answer variables).1 We investigate both combined and data complexity. For the former, the size of all the input is taken into consideration; the latter is only influenced by the number of fact bases and facts, the data. Data complexity has become important recently, since it well captures many practical applications, where the data is growing over time but the ontology and the queries only rarely change. Above all, our results show that the features we have studied can often be considered “for free”:
  • Regarding combined complexity, we show that there are many popular DLs for which the TCQ entailment problem w.r.t. a TKB is in \(\textsc {PSpace}\), even if rigid symbols are considered. This matches the complexity of satisfiability in LTL [15], which is much less expressive for there are no ontologies at all.

  • Concerning data complexity, the result for the DL \(\textit{DL-Lite}^\mathcal {H} _{\textit{horn}}\) is not much higher than the one of CQ entailment [2], and it even holds with rigid symbols.

4 A Generic Rewritability Result

Ontology-based temporal query answering can also be considered as a rewritability problem (see also [11]). In general, rewritability of ontology-based query answering for given query languages \(\mathcal {QL}\) and \(\mathcal {QL} '\), and an ontology language \(\mathcal {L}\), means that every \(\mathcal {QL}\)-query q and ontology \(\mathcal {O}\) written in \(\mathcal {L}\), can be encoded into a \(\mathcal {QL} '\)-query \(q'\) such that, for all facts \(\mathcal {F}\),

the answers to q w.r.t. the knowledge base \(\langle \mathcal {O},\mathcal {F} \rangle\) are the same as the answers to \(q'\) over \(\mathcal {F}\)—the data alone. Rewritability is often investigated w.r.t. the target query language \(\mathcal {QL} '\) of first-order logic (FOL) since these formulas can be expressed in standard SQL. For example, CQ answering w.r.t. ontologies in \(\textit{DL-Lite}^\mathcal {H} _{\textit{horn}}\) is FOL-rewritable [2], which means that every ontology-based CQ answering problem can be solved by answering a corresponding SQL query over the facts stored in a standard database, which usually is optimized and provides high performance.

We prove a generic rewritability result for ontology-based temporal query answering [8]; rewritability is defined analogously in the temporal setting, considering a sequence of fact bases and a time-stamped database. The temporal (\(\mathcal {QL}\)-)queries are formed by combining queries in some atemporal query language \(\mathcal {QL}\), such as CQs, with operators of LTL. On the one hand, these queries hence generalize TCQs, but we disallow the negation operator, which may occur in TCQs. Also the ontology language \(\mathcal {L}\) is generic. We specifically show that, if \(\mathcal {QL},\mathcal {QL} '\), and \(\mathcal {L}\) satisfy certain properties, then temporal \(\mathcal {QL}\)-query answering w.r.t. ontologies in \(\mathcal {L}\) can be rewritten into temporal \(\mathcal {QL} '\)-queries. Most importantly, the properties require that \(\mathcal {QL}\)-query answering w.r.t. \(\mathcal {L}\) ontologies is \(\mathcal {QL} '\)-rewritable. Since there are many instantiations of \(\mathcal {QL},\mathcal {QL} '\), and \(\mathcal {L}\), which have been shown to satisfy all our properties, our rewritability result turns out to be quite interesting. For instance, it shows that TCQ answering without negation w.r.t. ontologies in \(\textit{DL-Lite}^\mathcal {H} _{\textit{horn}}\) can be solved by answering temporal SQL queries over a temporal database.

5 Conclusions

The goal of the thesis was to systematically analyze ontology-based access to temporal data in terms of computational complexity, and rewritability to existing formalisms.

We have focused on a scenario that reflects many applications of today: the temporal queries are based on LTL, one of the most important temporal logics; the ontologies are written in standard lightweight logics; and the fact bases allow to capture data streams.

Our results show that there are, indeed, lightweight ontology languages that suit applications that require fast processing. For example, the data complexities we have proven imply that there are efficient parallel algorithms for TCQ answering w.r.t. ontologies written in \(\textit{DL-Lite}^\mathcal {H} _{\textit{horn}}\).2 Moreover, if the queries do not contain negation, that problem can even be solved by applying standard temporal database systems. The latter also holds w.r.t. ontologies in \(\textit{DL-Lite} _\mathcal {R},\) the DL underlying OWL 2 QL. For several other DL-Lite logics, we however get the same, rather high complexities as for very expressive DLs.

There are many directions for future work. We have recently shown that, even for rather expressive DLs such as \(\mathcal {ALCHI}\), TCQ answering is not harder than standard CQ answering in terms of data complexity [16]. We have also started considering metric temporal logic operators such as \(\Diamond _{P[0,3]}\) (“at some of the previous three time points”), which allow to capture contexts more precisely [6]. Regarding the implementation of our algorithms (i.e., the ones yielding the complexity results),it is open which kinds of algorithms are useful in applications, especially, if rigid symbols are considered. On the other hand, application knowledge discerning rigid symbols in advance could improve performance. Our rewritability result leads to a special kind of algorithms, based on rewriting. Maybe implementations can be obtained easily based on existing systems rewriting the atemporal queries. In [8], we describe algorithms for temporal query answering that rely on such existing approaches, but the implementation is still future work.


  1. 1.

    For a detailed definition of the problem, we refer to [17].

  2. 2.

    Containment in the class \(\textsc {NC}\) is considered as an indicator for the existence of efficient parallel implementations [1].



I want to thank Stefan Borgwardt for his considerable contributions. This work was supported by the German Research Foundation (DFG) in CRC 912.


  1. 1.
    Arora S, Barak B (2009) Computational complexity—a modern approach. Cambridge University Press, CambridgeCrossRefzbMATHGoogle Scholar
  2. 2.
    Artale A, Calvanese D, Kontchakov R, Zakharyaschev M (2009) The \(\textit{ DL-Lite }\) family and relations. J Artif Intell Res 36:1–69zbMATHMathSciNetGoogle Scholar
  3. 3.
    Artale A, Kontchakov R, Kovtunova A, Ryzhikov V, Wolter F, Zakharyaschev M (2015) First-order rewritability of ontology-mediated temporal queries. In: Yang Q, Wooldridge M (eds) Proceedings of the 24th international joint conference on artificial intelligence (IJCAI’15), pp 2706–2712. AAAI PressGoogle Scholar
  4. 4.
    Artale A, Kontchakov R, Lutz C, Wolter F, el Zakharyaschev M (2007) Temporalising tractable description logics. In: Goranko V, Wang XS (eds) Proceedings of the 14th international symposium on temporal representation and reasoning (TIME’07), pp 11–22. IEEE PressGoogle Scholar
  5. 5.
    Artale A, Kontchakov R, Ryzhikov V, Zakharyaschev M (2014) A cookbook for temporal conceptual data modelling with description logics. ACM Trans Comput Logic 15(3):25CrossRefzbMATHMathSciNetGoogle Scholar
  6. 6.
    Baader F, Borgwardt S, Koopmann P, Ozaki A, Thost V (2017) Metric temporal description logics with interval-rigid names. In: Proceedings of the 11th international symposium on frontiers of combining systems (FroCoS’17)Google Scholar
  7. 7.
    Baader F, Calvanese D, McGuinness DL, Nardi D, Patel-Schneider PF (2007) The description logic handbook: theory, implementation, and applications, 2nd edn. Cambridge University Press, CambridgeCrossRefzbMATHGoogle Scholar
  8. 8.
    Borgwardt S, Lippmann M, Thost V (2015) Temporalizing rewritable query languages over knowledge bases. J Web Semant 33:50–70CrossRefGoogle Scholar
  9. 9.
    Borgwardt S, Thost V (2015) Temporal query answering in \(\textit{ DL-Lite }\) with negation. In: Gottlob G, Sutcliffe G, Voronkov A (eds) Proceedings of the 1st global conference on artificial intelligence, GCAI’15, EPiC series in computing, vol 26, pp 51–65. EasyChairGoogle Scholar
  10. 10.
    Borgwardt S, Thost V (2015) Temporal query answering in the description logic \(\cal{EL}\). In: Yang Q, Wooldridge M (eds) Proceedings of the 24th international joint conference on artificial intelligence (IJCAI’15), pp 2819–2825. AAAI PressGoogle Scholar
  11. 11.
    Calvanese D, De Giacomo G, Lembo D, Lenzerini M, Rosati R (2007) Tractable reasoning and efficient query answering in description logics: the dl-lite family. J Autom Reason 39(3):385–429CrossRefzbMATHMathSciNetGoogle Scholar
  12. 12.
    Compton M, Barnaghi P, Bermudez L, Garcıa-Castro R, Corcho O, Cox S, Graybeal J, Hauswirth M, Henson C, Herzog A, Huang V, Janowicz K, Kelsey WD, Phuoc DL, Lefort L, Leggieri M, Neuhaus H, Nikolov A, Page K, Passant A, Sheth A, Taylor K (2012) The SSN ontology of the W3C Semantic Sensor Network Incubator Group. J Web Semant 17:25–32CrossRefGoogle Scholar
  13. 13.
    Gutiérrez-Basulto V, Jung JC, Kontchakov R (2016) Temporalized \(\cal{EL}\) ontologies for accessing temporal data: complexity of atomic queries. In: Kambhampati S (ed) Proceedings of the 25th international joint conference on artificial intelligence (IJCAI’16), pp 1102–1108. AAAI PressGoogle Scholar
  14. 14.
    Ontologies for Robotics and Automation Working Group (2015) Ieee standard ontologies for robotics and automation. IEEE Std 1872–2015:1–60Google Scholar
  15. 15.
    Sistla AP, Clarke EM (1985) The complexity of propositional linear temporal logics. J ACM 32(3):733–749CrossRefzbMATHMathSciNetGoogle Scholar
  16. 16.
    Thost V (2017) News on temporal conjunctive queries. In: Proceedings of the 1st web stream processing workshop (To appear) Google Scholar
  17. 17.
    Thost V (2017) Using ontology-based data access to enable context recognition in the presence of incomplete information. Ph.D. Thesis, TU Dresden.

Copyright information

© Springer-Verlag GmbH Deutschland 2017

Authors and Affiliations

  1. 1.Center for Advancing Electronics Dresden (cfaed), Institute of Theoretical Computer ScienceTU DresdenDresdenGermany

Personalised recommendations