Source-linked AI summary

An Empirical Study of Real-World SPARQL Queries

Mario Arias, Javier D. Fernández, Miguel A. Martínez-Prieto, Pablo de la Fuente

arXiv:1103.5043v1cs.IRcs.AIcs.HC

TL;DR

The paper asks how users construct SPARQL queries in ways relevant to query evaluation and RDF-store design. It analyzes real-world query logs and finds that queries are usually simple, with few triple patterns and joins, predominantly star-shaped structures, and short chains. The study also identifies frequently used language elements and expensive operators such as UNION, OPTIONAL, and joins.

  • Problem

    Understanding how users tailor SPARQL queries matters for designing query evaluation engines and fine-tuning RDF stores for performance.

  • Method

    The study analyzes real-world SPARQL query logs, characterizing language elements, triple patterns, joins, and graph structures across DBPedia and SWDF.

  • Results

    Most queries are simple: 66.41% of DBPedia and 97.25% of SWDF queries contain one triple pattern; 99.97% have star-shaped graph patterns, while joins are mainly SS, SO, and OO.

  • Takeaways & Limitations

    The observed usage patterns can support assumptions and decisions by RDF-store designers working on evaluation planning, index construction, and related system components.

  • Takeaways & Limitations

    The authors plan to analyze additional query logs to determine which observed behaviors generalize and which depend on the domain.

Abstract

from arXiv · show

Understanding how users tailor their SPARQL queries is crucial when designing query evaluation engines or fine-tuning RDF stores with performance in mind. In this paper we analyze 3 million real-world SPARQL queries extracted from logs of the DBPedia and SWDF public endpoints. We aim at finding which are the most used language elements both from syntactical and structural perspectives, paying special attention to triple patterns and joins, since they are indeed some of the most expensive SPARQL operations at evaluation phase. We have determined that most of the queries are simple and include few triple patterns and joins, being Subject-Subject, Subject-Object and Object-Object the most common join types. The graph patterns are usually star-shaped and despite triple pattern chains exist, they are generally short.

1. INTRODUCTION

The paper situates SPARQL as a declarative language for extracting information from RDF graphs and motivates empirical analysis of real-world query usage to guide RDF-store design.

  • RDF represents resources as triples, and its use spans bioinformatics, social networks, geographic locations, books, and films.
  • The Linked Data Project promotes publishing structured RDF data on the Web in a distributed and interconnected manner.
  • SPARQL is a W3C-recommended declarative language that extracts information from RDF graphs through graph-pattern matching.
  • Prior work studies SPARQL evaluation optimization, including selective triple-pattern reordering, dynamic restrictions, RISC-style processing, and star-shaped groups.
  • The study analyzes real-world SPARQL queries to characterize user access patterns and inform indices, RDF stores, optimizers, and benchmarks.

2. SPARQL LOG ANALYSIS

The study analyzes heterogeneous DBPedia and SWDF query logs, finding that common SPARQL usage is dominated by simple queries, frequent filters, and a small number of triple patterns and joins. Structural analysis further shows mostly short, star-like graph patterns, while several advanced features are rarely used.

  • Data and preprocessing: The logs contain several months of DBPedia and SWDF usage data from both human users and machine agents.Queries were extracted from HTTP logs, parsed with Jena, and duplicate queries from the same host plus parsing failures were excluded.
  • Query features: SELECT dominates query forms at 96.9% of DBPedia queries and 99.7% of SWDF queries.ASK, CONSTRUCT, and DESCRIBE occur only rarely in both sources.
  • Query features: FILTER appears in almost 49% of queries in both sources, while 99.4% of filters affect only one variable.LANG accounts for 28% of DBPedia filters, and the equal comparator accounts for 23% in DBPedia and 93% in SWDF.
  • Triple patterns: Most queries contain one triple pattern: 66.41% in DBPedia and 97.25% in SWDF, with query frequency declining as pattern count increases.The reported distributions use a logarithmic scale, and the datasets differ substantially in triple-pattern usage.
  • Joins: Only 4.25% of DBPedia queries contain at least one join, with Subject-Subject, Subject-Object, and Object-Object among the most common join types.The study counts same-position joins first and different-position joins afterward to obtain a consistent join-type measure.
  • Graph structure: Graph patterns are usually simple and star-like: 98% of queries in both datasets have longest-path length 1, while only 1.8% have length 2.Longer chains occur only rarely, with very few queries reaching five jumps; out-degree serialization is used to characterize star shapes.

3. CONCLUSIONS AND FUTURE WORK

The study finds that real-world SPARQL queries are usually simple, though some contain expensive operations, and that their graph structures are overwhelmingly star-shaped. It presents these observations as useful for RDF store design while identifying broader-log validation as future work.

  • The findings are intended to support RDF store design, especially query-evaluation planification and index construction.
  • 66.41% of DBPedia queries and 97.25% of SWDF queries contain a single triple pattern.
  • Join usage ranges from 2.19% to 4.25%, with Subject-Subject, Subject-Object, and Object-Object joins predominating.
  • 99.97% of queries have star-shaped graph patterns; 98% of chains have length one, and the longest path has length five.
  • Future work will test which observed query behaviours generalize across additional logs and which depend on the domain.
Loading 1103.5043v1…