Towards Practicable Algorithms for Rewriting Graph Queries beyond DL-Lite

Bianca Löhnert,Nikolaus Augsten,Cem Okulmus,Magdalena Ortiz
2024-06-08
Abstract:Despite the many advantages that ontology-based data access (OBDA) has brought to a range of application domains, state-of-the-art OBDA systems still do not support popular graph database management systems such as Neo4j. Algorithms for query rewriting focus on languages like conjunctive queries and their unions, which are fragments of first-order logic and were developed for relational data. Such query languages are poorly suited for querying graph data. Moreover, they also limit the expressiveness of the ontology languages that admit rewritings, restricting them to those where the data complexity of reasoning is not higher than it is in first-order logic. In this paper, we propose a technique for rewriting a family of navigational queries for a suitably restricted fragment of ELHI that extends DL-Lite and that is NL-complete in data complexity. We implemented a proof-of-concept prototype that rewrites into Cypher queries, and tested it on a real-world cognitive neuroscience use case with promising results.
Databases,Logic in Computer Science
What problem does this paper attempt to address?
### What problems does this paper attempt to solve? This paper aims to address the limitations of the current Ontology - Mediated Query Answering (OMQA) techniques in graph databases. Specifically, it attempts to solve the following two main problems: 1. **Limitations of Existing OMQA Technologies**: - Current OMQA systems are mainly for Relational Database Management Systems (RDBMS) and do not support popular graph databases and their query languages. - Existing query - rewriting algorithms mainly focus on Conjunctive Queries (CQs) and their unions. These queries are developed based on first - order logic fragments, which are suitable for relational data but not for the query requirements of graph data. - These query languages limit the expressive power of the ontology languages that can be rewritten, restricting them to those with data complexity not exceeding first - order logic, such as DL - Lite. 2. **Requirements for Graph Data Queries**: - Graph databases adopt the Property Graph (PG) data model, where both nodes and edges can have labels and can be assigned key - value pairs. - Graph query languages (such as C2RPQ and GQL) have navigation features, allowing queries to traverse paths of arbitrary length that conform to certain regular path expressions, which results in a higher data complexity (usually NL - complete) than SQL. - Therefore, it is necessary to develop a new query - rewriting technique that can handle such more complex graph query languages and can perform reasoning under NL data complexity. To solve these problems, the paper proposes a navigation query - rewriting technique for Extended DL - Lite (i.e., ℰℒℋℐ𝑙𝑖𝑛), enabling the effective execution of OMQA in graph databases. Specific contributions include: - **Exploring the Limitations of C2RPQ Rewriting**: It shows that even for lightweight ontologies, it is not possible to rewrite C2RPQ to capture all inferences from the ontology. - **Defining Navigation Conjunctive Queries (NCQs)**: It identifies a subset of C2RPQ, called Navigation Conjunctive Queries (NCQs), which can be rewritten as unions of C2RPQ. - **Proposing a Rewriting Algorithm**: It proposes a rewriting method for OMQA that pairs NCQs with ℰℒℋℐ𝑙𝑖𝑛 ontologies, which is achieved through three steps: standard reasoning, atomic query rewriting, and combining the ideas of Clipper rewriting. - **Prototype Implementation and Evaluation**: A prototype of this technique is implemented and evaluated in a real - world case in cognitive neuroscience. Through these contributions, the paper provides a theoretical basis and technical support for more powerful OMQA implementation in graph databases.