Machine Learning and Constraint Programming for Relational-To-Ontology Schema Mapping

Diego de Uña, Nataliia Rümmele, Graeme Gange, Peter Schachte, Peter J. Stuckey

Introduction

Integrating heterogeneous data sources into a unified knowledge graph is a cornerstone of modern data engineering. A critical step in this process is Relational-To-Ontology (REL2ONTO) schema mapping, which involves defining how relational database columns correspond to classes and properties in a target ontology. Traditionally, this task has relied heavily on manual expert intervention due to the inherent ambiguity of data labels and the presence of "unmatchable" attributes that do not fit the target schema. This paper presents SERENE, a hybrid system that automates this mapping by combining Machine Learning (ML) for semantic labeling with Constraint Programming (CP) for structural optimization.

Methodology: The SERENE Pipeline

SERENE addresses the mapping problem through a three-stage automated pipeline designed to handle both semantic ambiguity and structural inconsistency.

1. Semantic Labeling via Machine Learning

The first stage employs a Random Forest classifier to predict the semantic type of each database column. Rather than relying solely on column headers, the system extracts features from the data values themselves, such as Shannon’s entropy and character frequency distributions. This data-driven approach allows the system to distinguish between visually similar but semantically distinct types, such as distinguishing a zip code from a phone number.

2. Frequent Graph Pattern Mining

To incorporate domain knowledge, SERENE mines previously mapped data to identify common structural patterns (e.g., the relationship where a Person typically worksFor an Organisation). These patterns serve as "prizes" in the subsequent optimization phase; if a proposed mapping includes a frequent pattern, its associated cost is reduced, encouraging the selection of semantically plausible structures.

3. Steiner Tree Optimization with Constraint Programming

The core of the system is the formulation of the mapping task as a Steiner Tree Problem (STP) on an alignment graph. The goal is to find the minimum-cost tree that connects all labeled attributes using the relationships defined in the ontology.

The alignment graph integrates links from known semantic models and those inferred from the target ontology to provide a search space for the optimal mapping.

Unlike traditional heuristic-based solvers, SERENE utilizes Constraint Programming (via the MiniZinc language and Chuffed solver). This allows for exact global optimization and the inclusion of "side constraints." A key innovation is the introduction of a "root" node and an "unknown" node. If a column lacks a strong match in the ontology, the CP solver can "park" it at the unknown node, preventing it from forcing erroneous connections and distorting the overall model.

Evaluation and Results

The researchers evaluated SERENE across two domains: Museum (29 sources, 443 attributes) and Soccer (12 sources, 138 attributes). Both datasets included significant numbers of "unknown" attributes to test the system's robustness against real-world "junk" data.

Precision and recall metrics for the Museum and Soccer datasets, comparing SERENE against the KARMA baseline.

The results demonstrate that SERENE significantly outperforms existing state-of-the-art tools like KARMA. In the Museum domain, the inclusion of pattern weighting pushed precision and recall toward nearly 90%, representing a substantial improvement over baseline methods. Crucially, the system remained efficient; despite the computational complexity of exact CP solving, the largest instances were resolved in under one second on average.

Conclusion

SERENE demonstrates the power of combining ML and CP for complex data integration tasks. By leveraging ML for fuzzy semantic matching and CP for rigorous logical optimization, the system provides a robust, high-accuracy solution for REL2ONTO mapping. Future work aims to further automate the process by incorporating relational schema constraints, such as foreign keys, directly into the CP framework.

Summary updated

BibTeX
@inproceedings{una2018machine,
  author = {Diego de Uña and Nataliia Rümmele and Graeme Gange and Peter Schachte and Peter J. Stuckey},
  title = {{Machine Learning and Constraint Programming for Relational-To-Ontology Schema Mapping}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.24963/ijcai.2018/178},
}
Figure