[Tech Review] RelSeeker: Bridging the Logic Gap in Graph Databases for Social Networks
RelSeeker: Relationship-based Query Language in a Graph Database for Social Networks
RelSeeker is a graph database query language based on Datalog, specifically designed to handle "relationship-based queries" in social networks. It extends Datalog to support structured data types and property access, enabling the definition of implicit relationships and complex "relationships of relationships" that traditional graph query languages like Cypher often struggle to capture naturally.
TL;DR
RelSeeker is an innovative extension of Datalog designed to solve a critical limitation in modern graph databases: the inability to effectively query relationships of relationships. While popular tools like Cypher are great for finding nodes, they often fail to capture the nuances of implicit connections (e.g., if A is B's son, then A must "know" B). RelSeeker introduces a relationship-based query framework that treats connection properties and logical inclusions as primary data structures.
Problem & Motivation: The "Empty Result" Paradox
In a typical social network graph, a user might want to find "everyone who knows John." If the database only contains specific edges like isSonOf, isStudentOf, or isFriendOf, a traditional query looking for a knows label will return nothing.
The authors argue that:
- Relationship Properties are Underutilized: Standard languages make it difficult to filter by relationship attributes (like "since 2008") in a recursive manner.
- Implicit Logic is Missing: Relationships in social networks are hierarchical. A "Brother" relationship is implicitly a "Knows" relationship, but most databases require manual, redundant tagging to make this searchable.
Methodology: Extending Datalog for Graphs
The core innovation lies in using the mathematical rigor of Datalog—a declarative logic language—and extending it to handle structured "property graph" data.
1. Structured Data Types
RelSeeker introduces C-like structures for nodes and relationships. This allows the system to access properties using dot notation (e.g., F.since > "2018"), making relationship attributes as queryable as node attributes.
2. Relationship Inclusions
By using Horn clauses, RelSeeker allows users to define "rules" for relationships. In the figure below, we see how different social connections are unified under a single logical predicate.

3. The RelSeeker Stack
The system doesn't just theorize; it implements a full stack where Datalog queries are parsed, processed, and translated into optimized SQL requests executed on a cloud-based MySQL server.
Experiments & Results: Proving the Logic
The researchers tested RelSeeker against a sample social network where "John" has various connections (Son, Student, Brother) but no explicit "Knows" edge.
- Cypher (Neo4j): Returned an empty set because it couldn't infer the "Knows" relationship from the sub-types.
- RelSeeker: By defining a simple rule—
knows(X,Y) :- isSonOf(X,Y)—it successfully traversed the graph and returned the correct names (Sara, Steve, Maria, etc.).

The experiment confirmed that recursive transitive closure (finding friends of friends of friends) is handled far more elegantly in RelSeeker than in standard imperative or graph-pattern matching languages.
Critical Analysis & Conclusion
RelSeeker brings much-needed formal logic back to graph databases. By allowing developers to define what a relationship means via Datalog rules, it reduces the need for "data cleaning" where developers would otherwise have to manually add thousands of redundant labels.
Takeaway: This work highlights a shift toward "Intelligent Databases" where the schema isn't just a static box but a set of logical rules that can infer new data on the fly.
Limitations: While powerful, the current implementation translates to SQL, which may face performance bottlenecks on extremely large-scale graphs compared to native graph engines. Future work integrating this logic directly into a native graph kernel would be a significant leap forward.
