Introduction
As social networks and semantic webs expand, graph databases have become essential for modeling complex relationships. However, standard graph queries often overwhelm users with thousands of results. Finding the "best" answers—such as the most highly-rated restaurants near a friend—requires a framework that combines subgraph matching with personalized scoring.
The Challenge of Top-K Graph Search
Subgraph matching involves finding patterns within a large graph. For instance, a user might search for "friends of my parents who live in London." In massive datasets, such queries can return an unmanageable number of matches. Existing RDF triple stores (e.g., Jena, OWLIM) typically compute all possible matches before sorting them, which is computationally expensive and inefficient for "top-K" queries where only the most relevant results are needed.
Importance Queries
To address this, the authors introduce Importance Queries. This framework extends standard SPARQL-style queries by incorporating user-defined scoring functions (e.g., MIN, MAX, SUM, or AVG).
As shown in Figure 2, an Importance Query might look for a restaurant (?r) with a high star rating (?r.stars) that is liked by a person (?p) who is a friend of a specific anchor node (Alice) and resides in a specific city (London).
The OptIQ Algorithm
The core contribution of this research is OptIQ (Optimized Importance Query), an algorithm designed to find the top-K results without exploring the entire search space. OptIQ employs several key optimizations:
- Integrated Top-K Selection: The algorithm maintains a running list of the top-K results, using their scores to prune the search tree dynamically.
- Pruning via Upper Bounds: By calculating the maximum possible score a partial match could achieve, OptIQ can discard entire branches of the search if their "upper bound" is lower than the current K-th best result.
- Disk-Based Indexing: Utilizing a partitioning strategy, the algorithm stores "Internal Partition Distances" (IPD) and local property maximums. This allows the system to decide which disk blocks to load without reading unnecessary data, mitigating the I/O bottleneck.
- Processing Order (WCOST): A heuristic selects the next query variable to map based on a balance between potential score benefit and computational cost.
Evaluation and Results
The authors evaluated OptIQ on four real-world datasets, including CiteSeerX, YouTube, Flickr, and GovTrack, with graphs containing up to 6.2 million vertices and 15.2 million edges.
The results demonstrate that OptIQ and its variants consistently outperform popular triple stores like Apache Jena TDB and OWLIM-SE. For complex, non-selective queries, OptIQ achieved speedups of up to one order of magnitude. Furthermore, the algorithm scales sub-linearly with the number of answers, often returning results in less than a second even on large-scale networks.
Conclusion and Future Work
OptIQ provides a robust solution for personalized search in large-scale graph databases by focusing on "anchored" queries—those starting from a known entity. While highly effective for exact matching on static graphs, future research may explore extending this framework to dynamic graphs or approximate matching scenarios where edges represent probabilistic relationships.
Summary updated