#rdf #converter #hdt

bin+lib rdf2hdt

Library for converting a RDF data to HDT

1 unstable release

Uses new Rust 2024

0.2.0 Sep 12, 2025

#1225 in Encoding

Download history 142/week @ 2025-09-10 16/week @ 2025-09-17 14/week @ 2025-09-24 25/week @ 2025-10-01

197 downloads per month

BSD-3-Clause

2MB
313 lines

Latest Version Lint Build Documentation

rdf2hdt

Library for converting RDF data to HDT

This is a Rust-based tool that converts RDF data into HDT format. It uses the oxrdfio crate for RDF parsing and conversion, and then generates and saves the data as HDT. Implementation is based on the HDT specification and the output HDT is intended to be consumed by one of hdt crate, hdt-cpp, or hdt-java.

Installation

Install rdf2hdt with cargo:

cargo install rdf2hdt

Usage

The rdf2hdt CLI tool is used for generating HDT files from RDF input data.

$ rdf2hdt convert --help
Convert RDF to HDT.

The `convert` command parses RDF files, converts it to RDF triples using `oxrdfio` for parsing and conversion, and then generates and saves the data as HDT.

Usage: rdf2hdt convert [OPTIONS] --output <OUTPUT>

Options:
  -i, --input <INPUT>...
          Path to input RDF file(s).

          Provide the path to one or more RDF files that will be parsed and converted. Support file formats: https://crates.io/crates/oxrdfio

  -o, --output <OUTPUT>
          Path to output file.

          Specify the path to save the generated HDT.

  -v, --verbose...
          Increase logging verbosity

  -q, --quiet...
          Decrease logging verbosity

  -h, --help
          Print help (see a summary with '-h')

Using the build_hdt library

HDT files can be generated directly in Rust.

use rdf2hdt::hdt::buld_hdt;

let result = build_hdt(
  vec!["tests/resources/apple.ttl".to_string()],
  "output.hdt",
)?;

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

Dependencies

~12–19MB
~344K SLoC