Skip to content

Repository files navigation

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.

Inputs ending in .gz or .bz2 are decompressed transparently, and .owl files are parsed as RDF/XML.

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. RDF syntaxes supported: see https://crates.io/crates/oxrdfio. `.owl` files are parsed as RDF/XML. Inputs ending in `.gz` or `.bz2` are transparently decompressed.

  -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::build_hdt;

let hdt = build_hdt(
    &["tests/resources/apple.ttl"],
    "output.hdt",
)?;

License

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

About

rdf2hdt converter library

Topics

Resources

Stars

4 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages