Module oxigraph::store

source ·
Expand description

API to access an on-disk RDF dataset.

Usage example:

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

let store = Store::new()?;

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

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

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

Structs

  • A bulk loader allowing to load at lot of data quickly into the store.
  • An error return if some content in the database is corrupted.
  • An iterator returning the graph names contained in a Store.
  • An iterator returning the quads contained in a Store.
  • An on-disk RDF dataset. Allows to query and update it using SPARQL. It is based on the RocksDB key-value store.
  • An object to do operations during a transaction.

Enums