50 releases

new 0.4.3 Nov 7, 2024
0.4.0 Sep 22, 2024
0.4.0-alpha.7 May 22, 2024
0.4.0-alpha.6 Mar 25, 2024
0.1.1 Aug 14, 2020

#4 in Database implementations

Download history 113/week @ 2024-07-18 265/week @ 2024-07-25 227/week @ 2024-08-01 235/week @ 2024-08-08 112/week @ 2024-08-15 290/week @ 2024-08-22 244/week @ 2024-08-29 83/week @ 2024-09-05 201/week @ 2024-09-12 446/week @ 2024-09-19 361/week @ 2024-09-26 267/week @ 2024-10-03 397/week @ 2024-10-10 292/week @ 2024-10-17 543/week @ 2024-10-24 368/week @ 2024-10-31

1,651 downloads per month
Used in 19 crates (11 directly)

MIT/Apache

5MB
105K SLoC

C++ 58K SLoC // 0.1% comments Rust 38K SLoC // 0.0% comments C 4.5K SLoC // 0.1% comments Python 2K SLoC // 0.1% comments Visual Studio Project 1K SLoC Shell 758 SLoC // 0.2% comments GNU Style Assembly 135 SLoC // 0.1% comments Visual Studio Solution 82 SLoC INI 81 SLoC // 0.1% comments Bitbake 59 SLoC // 0.2% comments

Oxigraph

Latest Version Released API docs Crates.io downloads actions status Gitter

Oxigraph is a graph database library implementing the SPARQL standard.

Its goal is to provide a compliant, safe and fast on-disk graph database. It also provides a set of utility functions for reading, writing, and processing RDF files.

Oxigraph is in heavy development and SPARQL query evaluation has not been optimized yet.

Oxigraph also provides a CLI tool and a Python library based on this library.

Oxigraph implements the following specifications:

A preliminary benchmark is provided. Oxigraph internal design is described on the wiki.

The main entry point of Oxigraph is the Store struct:

use oxigraph::store::Store;
use oxigraph::model::*;
use oxigraph::sparql::QueryResults;

let store = Store::new().unwrap();

// insertion
let ex = NamedNode::new("http://example.com").unwrap();
let quad = Quad::new(ex.clone(), ex.clone(), ex.clone(), GraphName::DefaultGraph);
store.insert(&quad).unwrap();

// quad filter
let results = store.quads_for_pattern(Some(ex.as_ref().into()), None, None, None).collect::<Result<Vec<Quad>,_>>().unwrap();
assert_eq!(vec![quad], results);

// SPARQL query
if let QueryResults::Solutions(mut solutions) =  store.query("SELECT ?s WHERE { ?s ?p ?o }").unwrap() {
    assert_eq!(solutions.next().unwrap().unwrap().get("s"), Some(&ex.into()));
}

It is based on these crates that can be used separately:

To build the library locally, don't forget to clone the submodules using git clone --recursive https://github.com/oxigraph/oxigraph.git to clone the repository including submodules or git submodule update --init to add submodules to the already cloned repository.

It is possible to disable the RocksDB storage backend to only use the in-memory fallback by disabling the rocksdb default feature:

oxigraph = { version = "*", default-features = false }

This is the default behavior when compiling Oxigraph to WASM.

License

This project is licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
  • MIT license (LICENSE-MIT or <http://opensource.org/licenses/MIT>)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Oxigraph by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~6–18MB
~276K SLoC