HDT
A Rust library for the Header Dictionary Triples compressed RDF format, including:
- loading the HDT default format as created by hdt-cpp
- efficient querying by triple patterns
- serializing into other formats like RDF Turtle and N-Triples using the Sophia adapter
However it cannot:
- load other RDF formats
- load other HDT variants
For this functionality and acknowledgement of all the original authors, please look at the reference implementations in C++ and Java by the https://github.com/rdfhdt organisation.
It also cannot:
- swap data to disk
- modify the RDF graph in memory
- run SPARQL queries
If you need any of the those features, consider using a SPARQL endpoint instead.
Examples
[]
= "0.0.12"
use Hdt;
let file = open.expect;
let hdt = Rc new.expect;
// query
let majors = hdt.triples_with_sp;
println!;
You can also use the Sophia adapter to load HDT files and reduce memory consumption of an existing application based on Sophia:
use ;
use BoxTerm;
use Graph;
let file = open.expect;
let hdt = new.expect;
let graph = new;
let s = new_iri_unchecked;
let p = new_iri_unchecked;
let majors = graph.triples_with_sp;
If you don't want to pull in the Sophia dependency, you can exclude the adapter:
[]
= { = "0.0.12", = false }