TL;DR
Ontop4theWeb bridges the gap between the Semantic Web and live web data by extending Ontology-Based Data Access (OBDA) to heterogeneous, fast-changing sources like REST APIs and HTML tables. It allows developers to query real-time web data using standard SPARQL queries on-the-fly, completely eliminating the need to download, convert, or materialize the data into RDF triples beforehand.
What Problem Does This Paper Address?
The modern web is defined by two major data challenges: Variety (data exists in countless formats like HTML tables, JSON, and XML) and Velocity (data changes constantly, like social media streams). For Semantic Web applications that rely on structured graph data (RDF) and query languages like SPARQL, integrating these fast-moving, heterogeneous sources is a massive headache.
Traditionally, developers have relied on a tedious "convert-and-store" (ETL) pipeline: scraping the data, parsing it, converting it to RDF, and storing it in a triple store before it can be queried. This approach fails when data updates every second (like Twitter) or when accessing the full dataset is economically or legally restrictive. While some state-of-the-art systems attempt to query APIs directly, they often require non-standard SPARQL extensions, force users to understand complex API documentation, or suffer from severe performance bottlenecks.
Methods
The authors introduce Ontop4theWeb, a system that treats external web data sources as virtual relational tables.
As shown in the architecture diagram above, the system operates through a clever multi-step translation process:
- Standard SPARQL Input: The user submits a standard SPARQL query based on a predefined ontology.
- SPARQL-to-SQL Translation: The OBDA engine translates the SPARQL query into an extended SQL query.
- Virtual Table Operators: The key innovation lies in embedding custom virtual table operators directly into the SQL
FROMclause. These operators are powered by MadIS (an extended SQLite database engine using Python). - On-the-Fly Fetching & Enrichment: When the SQL query executes, the virtual table operator calls the respective Web API or scrapes the HTML table in real-time. It can also route data through third-party microservices (e.g., a sentiment analysis classifier for tweets) before presenting the data as a clean, virtual relational table.
- Configurable Caching: To respect API limits and boost performance, the operators include a time-windowed cache parameter ($f$) tailored to the data source's velocity.
Datasets
The system was evaluated using both real-world use cases and a synthetic benchmark:
- Real-World Web Sources:
- HTML Tables: Combining movie ranking data from Rotten Tomatoes and Wikipedia to test HTML parsing and on-the-fly table joining.
- Twitter API: Fetching live tweets about academic events (e.g., EDBT 2020) and enriching them using an external SVM-based sentiment analysis classifier.
- Foursquare API: Querying live location and check-in data for venues (e.g., coffee shops in Chicago).
- Yelp API: Used specifically for direct quantitative comparison against the state-of-the-art SERVICE-to-API system.
- Synthetic Benchmark: To test scalability, the authors took an original Wikipedia table regarding Italian election opinion polls and multiplied it to create tables ranging from 10 to 100,000 rows.
Key Insights and Ideas
- Zero Materialization: By shifting the data transformation to query-time via virtual tables, the system ensures that users always receive the most up-to-date data without wasting storage on short-lived RDF dumps.
- Strict Standard Compliance: Unlike competing methods that alter SPARQL syntax, Ontop4theWeb uses standard SPARQL and R2RML mappings. This means it can be dropped into existing Semantic Web applications without rewriting application logic.
- Avoiding the Cartesian Product Trap: Competing systems like SERVICE-to-API execute API calls tuple-by-tuple, which frequently results in massive Cartesian products, false positives, and excessive API calls. Ontop4theWeb fetches entire virtual tables at once, allowing the underlying SQL engine to handle joins natively and accurately.
Key Results
The experimental evaluation proved that Ontop4theWeb is both highly efficient and robust:
- Performance & Caching: In real workload queries (Films, Twitter, Foursquare), utilizing a warm cache dropped execution times by an order of magnitude, keeping response times stable regardless of query complexity.
- Scalability: The synthetic tests demonstrated that the system scales superlinearly with table size. For highly selective queries, Ontop4theWeb successfully processed massive web tables of up to 100,000 rows within minutes.
- Comparison to State-of-the-Art: When pitted against the SERVICE-to-API system on the Yelp dataset, Ontop4theWeb was three times faster and made significantly fewer API calls due to its table-level caching design. Furthermore, Ontop4theWeb achieved perfect precision and recall (1.0), whereas SERVICE-to-API suffered from low precision (as low as 0.016) due to generating false positives from unjoined variable bindings.
Limitations and Future Work
While powerful, Ontop4theWeb has a few limitations:
- Mapping Overhead: Developers must still manually write R2RML mapping files for each web source schema, which can be time-consuming (though it only needs to be done once per schema).
- Join Optimization Limits: Because the data is not materialized, the OBDA system cannot leverage database constraints or indexes beforehand. Consequently, queries with low selectivity on very large web tables face noticeable performance degradation.
Future Directions: The authors plan to extend the framework to handle more complex data analysis tasks natively and expand the virtual table operators to support other ubiquitous web formats, such as XML documents.
Summary updated