Spread2RML: Constructing Knowledge Graphs by Predicting RML Mappings on Messy Spreadsheets

Markus Schröder, Christian Jilek, Andreas DengelK-CAP 2021 · DOI

Abstract

Spreadsheets remain a dominant yet problematic data format, often characterized by inconsistent types, mixed schemas, and semantic information hidden in visual formatting. Spread2RML is a novel framework designed to automate the construction of Knowledge Graphs from these "messy" sources. By predicting RDF Mapping Language (RML) rules through a heuristic-based ranking system, Spread2RML identifies data types, links entities, and extracts information from rich text formatting, significantly reducing the manual effort required for data integration.

Introduction: The Spreadsheet Bottleneck

While relational databases offer strict schemas, spreadsheets are frequently used as flexible, unstructured data stores. This flexibility leads to "messy" data: dates in varying formats, numeric columns containing strings like "N/A," and critical metadata encoded only in cell colors or font styles. Converting this data into a structured Knowledge Graph (KG) typically requires manually writing RDF Mapping Language (RML) rules—a process that is both tedious and error-prone when dealing with hundreds of inconsistent files. Spread2RML addresses this by automatically predicting the most likely RML mappings based on the content and formatting of the spreadsheet.

The Spread2RML Framework

The core of Spread2RML is a set of 15 predefined Mapping Templates that pair RML references with transformation functions from the Function Ontology (FnO). The system evaluates each column against these templates using specific heuristics.

Overview of Object Map Templates and their associated heuristics used for RML prediction.

As shown in the table above, heuristics range from simple type checks (e.g., what percentage of cells parse as integers) to more complex measures like the degree of duplication ($dup$). The $dup$ function is particularly vital for Entity Linking; a high frequency of repeated values in a column suggests it refers to recurring entities (like cities or product IDs) rather than unique literal descriptions.

Extracting Semantic Data from Formatting

A standout feature of Spread2RML is its ability to treat visual formatting—such as cell color, bolding, or italics—as "virtual columns." In many industrial spreadsheets, users use color to denote status or validity.

Example of a messy spreadsheet and its corresponding predicted RML mappings, including extraction of color-coded data.

In Figure 2, the column "valid from & planned valid from" contains two dates per cell, distinguished by color. Spread2RML uses the getEntitiesByColor function (Snippet E) to isolate the red-colored text, mapping it to a specific property (gl:plannedValidFrom). This allows the system to capture data that traditional CSV parsers would ignore.

Evaluation and Results

The authors evaluated Spread2RML across three datasets:

  1. Data Sprout: A synthetic dataset simulating industrial "messiness" (e.g., property values as colors).
  2. data.gov: 12 real-world public spreadsheets.
  3. Industry Dataset: Highly inconsistent metadata from a private partner.

The tool achieved an average F-score of 0.83 on the relatively clean data.gov files. On the more challenging synthetic and industrial datasets, F-scores ranged from 0.27 to 0.47. While these scores reflect the extreme difficulty of fully automated mapping on "wild" data, Spread2RML significantly outperformed baselines like Apache Any23, which often failed to extract any structured data from the most distorted patterns.

Conclusion and Future Work

Spread2RML demonstrates that heuristic-based prediction can effectively bridge the gap between messy spreadsheets and structured Knowledge Graphs. While the system occasionally struggles with mixed-type columns or ambiguous entities, it provides a robust starting point for data engineers. Future work focuses on a Human-in-the-loop (HumL) approach, where the system presents its predicted mappings to an expert for validation, allowing the model to learn from feedback and resolve ambiguities in real-time.

Summary updated

BibTeX
@inproceedings{schroder2021spread,
  author = {Markus Schröder and Christian Jilek and Andreas Dengel},
  title = {{Spread2RML: Constructing Knowledge Graphs by Predicting RML Mappings on Messy Spreadsheets}},
  booktitle = {K-CAP},
  year = {2021},
  doi = {10.1145/3460210.3493544},
}
Figure