Lune

AAAI2025Top-tier venue

Answering Conjunctive Queries with Safe Negation and Inequalities over RDFS Knowledge Bases

Gianluca Cima, Marco Console, Roberto Maria Delfino, Maurizio Lenzerini, Antonella Poggi

Abstract

Expressing negative conditions is a crucial feature of query languages for knowledge bases (KBs). Answering such queries over ontological KBs, however, is a very challenging task that becomes undecidable even for lightweight Description Logic (DL) ontologies. Such negative results hold even for Conjunctive Queries (CQs) equipped with basic forms of negative conditions such as the so-called safe negation or inequality atoms. One ontology language that is seemingly unaffected by these results is (the DL counterpart of) RDFS even if equipped with disjointness axioms. Answering CQs with inequalities over such ontologies is known to be Pi^p_2-complete, if the number of inequality atoms is unbounded, and NP-complete if we limit this number to one. Notably, these results leave open the cases of CQs with a fixed number greater than two of inequality atoms. Additionally, such a thorough analysis is missing for CQs with safe negation.

In this paper, we embark in a refined analysis of the combined complexity of answering CQs with inequality atoms and safe negation over RDFS ontologies augmented with disjointness axioms. Firstly, we provide a unified Pi^p_2 query answering algorithm for the general problem. Secondly, we confirm the generally held conjecture according to which answering CQs with two inequality atoms over such ontologies is already Pi^p_2-hard. This result closes an important gap in the current literature and has an impact on the widely influential problem of query containment. Lastly, for CQs with safe negation, we prove a behavior similar to that of CQs with inequality atoms. Specifically, we show that answering CQs with at most one negated atom can be done in NP, while allowing at most two negated atoms is sufficient to obtain Pi^p_2-hardness.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

1 top-tier paper has cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers1

  1. Foundations of Formal Reasoning over Knowledge Bases Combining Symbolic and Sub-Symbolic KnowledgeGianluca Cima, Marco Console, Laura PapiAAAI 2026

Builds on1

  1. Answering Conjunctive Queries with Inequalities in DL-LiteℛGianluca Cima, Maurizio Lenzerini, Antonella PoggiAAAI 2020 · 10 citations

Related papers

  1. Answering Queries with Negation over Existential RulesStefan Ellmauthaler, Markus Krötzsch, Stephan MennickeAAAI 2022 · 6 citations
  2. Resilient Logic Programs: Answer Set Programs Challenged by OntologiesSanja Lukumbuzya, Magdalena Ortiz, Mantas SimkusAAAI 2020 · 8 citations
  3. Ontology-Mediated Query Answering Using Graph Patterns with ConditionsPing Lu, Ting Deng, Haoyuan Zhang, Yufeng Jin et al.ICDE 2024
  4. The Price of Selfishness: Conjunctive Query Entailment for ALCSelf Is 2EXPTIME-HardBartosz Bednarczyk, Sebastian RudolphAAAI 2022 · 1 citation
  5. Revisiting Conjunctive Query Entailment for SYazmín Ibáñez-García, Jean Christoph Jung, Vincent Michielini, Filip MurlakAAAI 2026 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines