Abstract
Constructing effective SPARQL queries is a complex task, often characterized by a trial-and-error process. This paper provides the first systematic study of "organic" (human-generated) SPARQL search sessions. By analyzing how users iteratively refine queries across 10 diverse datasets, we identify predictable behavioral patterns. We employ directed hypergraphs to measure structural changes and Hidden Markov Models (HMM) to model user intentions. Our findings, such as the "Closing In" effect where query changes become smaller as a session progresses, offer a roadmap for developing more intuitive query suggestion and auto-completion tools.
Introduction
Writing a perfect SPARQL query on the first attempt is notoriously difficult. Users frequently lack precise knowledge of a database's underlying ontology or struggle with complex syntax. Consequently, they engage in "search sessions"—sequences of trial-and-error refinements. While previous research has analyzed SPARQL logs, it has largely focused on individual queries in isolation and failed to distinguish between human and robotic traffic, the latter of which accounts for over 99% of SPARQL requests. This study addresses this gap by focusing exclusively on human navigation of knowledge graphs over time, providing insights to improve SPARQL caching, relaxation, and auto-completion techniques.
Methodology
The authors developed a multi-stage pipeline to extract and analyze human behavior from the LSQ (Linked SPARQL Queries) collection, covering domains from Wikipedia (DBpedia) to bioinformatics (Bio2RDF).
- Bot Filtering: A two-step process was employed to remove robotic queries by filtering high-frequency requests and structural "loop patterns" where only IRIs or literals changed.
- Session Identification: A search session was defined as a sequence of queries from the same user within a one-hour window sharing at least one common term, ensuring topic continuity.
- Structural Analysis: Basic Graph Patterns (BGPs) were represented as directed hypergraphs. This allowed for the calculation of Graph Edit Distance (GED) to measure structural evolution between steps.
- Intention Modeling: A Hidden Markov Model (HMM) was applied to predict abstract user intentions based on observable query changes and endpoint feedback.
Key Insights and Behavioral Patterns
The analysis of 14,039 organic sessions revealed several "secrets" of user behavior:
- The "Closing In" Effect: Empirical data shows that the Graph Edit Distance (GED) between contiguous queries tends to decrease as a session progresses. This suggests that as users approach their information goal, their refinements become increasingly surgical and specific.
- Structure vs. Content: Users are significantly more likely to maintain a consistent graph structure while swapping specific terms (IRIs) than they are to add or delete entire triple patterns. They effectively explore the graph by sliding a fixed structural template over different data points.
- Feedback Loops: User behavior is heavily dictated by endpoint results. Excessive results typically trigger "specification" (adding constraints), while zero results lead to "generalization" or error correction.
Results and Predictive Power
The study yielded several quantitative findings regarding query evolution:
- Triple Pattern Dynamics: 78.24% of contiguous query pairs involved changes in triple patterns, with substitutions being far more common than additions or removals.
- Join Vertex Behavior: In complex "hybrid" join vertices, users most frequently modify incoming nodes, which often represent the core logic of the query.
- Domain Specificity: In spatial datasets (e.g., LGD), 90.53% of substitutions were number-specific within
FILTERconstraints, as users fine-tuned coordinates. - HMM Utility: The HMM case study demonstrated that observing early query changes allows a system to suggest reformulation strategies that help users avoid inefficient, zero-result paths.
Conclusion and Future Work
This research highlights the predictable nature of human SPARQL sessions. While the current model provides a strong foundation, future work will aim to incorporate semantic equivalence (queries that are syntactically different but semantically identical) and long-range correlations across entire sessions. Additionally, integrating the actual content of returned data, rather than just result sizes, could further refine the accuracy of intention modeling.
Summary updated