Abstract
Ontology engineering relies heavily on Competency Questions (CQs) to define the scope and requirements of a knowledge base. However, the manual translation of these natural language questions into formal SPARQL-OWL queries remains a significant bottleneck. This paper introduces BigCQ, a massive synthetic dataset comprising over 77,000 question-query pairs. By leveraging frequent axiom patterns found in real-world ontologies, BigCQ provides the necessary scale to train machine learning models for automated ontology validation and translation, moving the field beyond the limitations of existing small-scale datasets.
Introduction
Ontologies serve as the structural backbone for knowledge representation, yet ensuring their completeness and correctness is a grueling, manual process. Developers typically use Competency Questions (CQs)—natural language queries such as "Which pizzas contain meat?"—to specify the requirements an ontology must satisfy. To verify these requirements, CQs must be translated into formal query languages like SPARQL-OWL.
This translation is notoriously difficult due to the complex logic required by SPARQL-OWL, including the Open-World Assumption. Historically, this task has been performed by human experts. While automated approaches using machine learning have been proposed, progress has been stifled by a lack of data; existing datasets often contain fewer than 250 examples, a volume insufficient for training robust neural networks. BigCQ addresses this data scarcity by providing a large-scale, high-quality synthetic alternative.
Methodology
The authors developed a three-step pipeline to generate BigCQ, ensuring the synthetic data remains grounded in realistic modeling practices.
1. From Axiom Patterns to Axiom Shapes
The process began with a 2018 dataset of "frequent axiom patterns," which represent common ways humans structure knowledge in real-world ontologies (derived from 331 ontologies in BioPortal). The authors abstracted these patterns by removing domain-specific vocabulary (e.g., "Pizza," "Heart") and replacing them with generic placeholders (e.g., ex:C1, ex:OP1). This resulted in 239 "axiom shapes" that represent the logical skeletons of common knowledge structures.
2. Shapes to Queries
These logical shapes were then automatically wrapped in SPARQL syntax. For every axiom shape, the pipeline generated both ASK queries (to verify the existence of a relationship) and multiple SELECT queries (to retrieve specific entities fitting the pattern). This ensures the dataset covers different functional requirements of ontology querying.
3. Shapes to Questions
To generate the natural language component, the authors utilized the ACE Verbalizer (Attempto Controlled English) to convert the underlying logic into grammatical English. They then applied handcrafted templates (e.g., "Is it true that...?", "What relates X and Y?") and synonym sets. This approach allowed for the creation of thousands of linguistic variations for each logical pattern, simulating the diverse ways users might phrase a question.
The BigCQ Dataset
The primary contribution of this work is the BigCQ dataset, which contains 77,575 CQ patterns mapped to 575 SPARQL-OWL query templates. This represents an increase of several orders of magnitude over previous benchmarks.
Key characteristics of the dataset include:
- Real-World Foundations: By basing synthetic data on frequent axioms, the dataset reflects actual engineering practices rather than random logical permutations.
- Domain-Agnosticism: The "materializable" nature of the shapes allows developers to plug in their own domain labels, facilitating the creation of custom training data for specific industries.
- Controlled Complexity: The authors intentionally focused on understandable logical structures, avoiding overly nested class expressions that would result in human-unreadable questions.
Results and Impact
BigCQ significantly advances the state of the art in ontology engineering by providing the first dataset of sufficient scale for deep learning applications. The utility of the dataset was demonstrated through its application in SeeQuery, an automatic SPARQL-OWL recommender system. The synthetic patterns proved effective for assessing ontology completeness, showing that models trained on BigCQ can generalize to real-world validation tasks.
Furthermore, the inclusion of synonym sets and multiple query types (ASK vs. SELECT) ensures that the dataset covers a wide variety of linguistic archetypes, preparing translation models for the nuances of natural language.
Limitations and Future Work
While BigCQ offers unprecedented scale, it faces challenges regarding logical complexity. Highly nested statements are difficult to verbalize into natural-sounding English, often resulting in questions that are technically correct but difficult for humans to parse.
Future research will explore the use of Large Language Models (LLMs) to refine the synthetic questions, making them sound less formulaic and more "human." Additionally, while the dataset is intended to fuel neural network training, further studies are needed to benchmark the performance of models trained exclusively on BigCQ versus those trained on human-annotated data.
Summary updated