Abstract
Managing arbitrary levels of metadata (such as provenance, confidence scores, and versioning) in RDF graphs is notoriously difficult and inefficient with current tools. This paper introduces TrieDF, an in-memory tuple store that uses prefix-trees (tries) to efficiently index and query RDF data augmented with any number of metadata fields. By treating n-tuples as strings of items, TrieDF achieves up to a 1,000x speedup in retrieval times compared to state-of-the-art solutions, with only a modest increase in memory consumption.
Introduction
Knowledge Graphs (KGs) represent data as RDF triples: ⟨subject, predicate, object⟩. However, real-world KGs require extensive metadata to be useful, including temporal validity, provenance, and confidence metrics. Currently, RDF engines are optimized for standard triples. To add metadata, developers usually rely on workarounds like reification (which bloats datasets) or named graphs (which limits metadata to quads). TrieDF addresses this gap by designing an engine natively built for arbitrary-length RDF tuples, treating metadata as additional dimensions of a single tuple.
Methodology: Trie-Based Architecture
TrieDF is an in-memory architecture that models data using tries (prefix-based trees). This approach leverages the inherent redundancy in RDF data through two primary components:
- Trie-based Indexes: Instead of standard B-trees, TrieDF treats an RDF tuple (regardless of length) as a "string" of integers. Each element in the tuple is a node in the trie. Shared prefixes, such as common subjects and predicates, are naturally deduplicated, enabling compressed storage and extremely fast prefix-based lookups.
- Trie-based Dictionary: RDF engines map long URI strings to integer IDs. TrieDF uses a bidirectional trie for its dictionary, coalescing nodes between occurrences of the
/character to compress common URI chunks.
Evaluation and Key Results
The authors evaluated TrieDF across various tuple lengths using datasets including DBpedia, YAGO 4, and NELL.
- Triples (3-tuples): TrieDF is at least one order of magnitude (10x) faster at retrieval than competitors like Jena and RDFLib for single-variable queries.
- Quads (4-tuples): For Version Queries (VQ), TrieDF's optimized indexes are up to 1,000x faster than Jena and RDFLib. It also avoids the massive memory bloat seen in Jena, which often duplicates entire graphs for each version.
- 5-tuples: Compared against an in-memory SQLite database, TrieDF loads faster and achieves comparable or superior query runtimes.
While TrieDF uses slightly more memory than the highly-compact RDFLib (up to 28% more for quads), it provides massive, game-changing retrieval speedups that justify the minor footprint increase.
Conclusion and Future Work
TrieDF demonstrates that tries are a natural fit for RDF redundancy. By treating tuples as paths in a tree, the engine scales to arbitrary metadata dimensions without requiring fundamental architectural changes. Future work will focus on reducing the memory footprint further, implementing full SPARQL support, and developing disk-based storage strategies to move toward a production-ready database engine.
Summary updated