rdf-store-sqlite 0.4.4

A SQLite storage adapter for RDF.rs knowledge graphs.
Documentation

RDF.rs Store: SQLite

License Compatibility Package Documentation

A SQLite storage adapter for RDF.rs knowledge graphs.

[!TIP] 🚧 We are building in public. This is presently under heavy construction.

[Features] | [Prerequisites] | [Installation] | [Examples] | [Reference] | [Development]

✨ Features

  • Implements a scalable, high-performance RDF store backed by SQLite.
  • Built on async Rust using lazily-evaluated streams throughout.
  • Plays nice with others: interoperates with Oxigraph, Rudof, and Sophia.
  • 100% pure and safe Rust with minimal dependencies and no bloat.
  • Supports opting out of any feature using comprehensive feature flags.
  • Adheres to the Rust API Guidelines in its naming conventions.
  • Cuts red tape: 100% free and unencumbered public domain software.

🛠️ Prerequisites

  • Rust 1.85+ (2024 edition)

⬇️ Installation

Installation via Cargo

cargo add rdf-store-sqlite

Installation in Cargo.toml

Enable all default features:

[dependencies]
rdf-store-sqlite = { version = "0.4" }

Enable only specific features:

[dependencies]
rdf-store-sqlite = { version = "0.4", default-features = false, features = ["tracing"] }

👉 Examples

Importing the Library

use rdf_store_sqlite::{SqliteStore, SqliteTransaction};

Creating a Store

let mut store = SqliteStore::new().await?;  // in-memory store

Mutating the Store

let mut tx = store.write().await?;

tx.remove(old_quad).await?;
tx.insert(new_quad).await?;

tx.commit().await?;

Accessing the Store

let tx = store.read().await?;

let count = tx.count(quad_pattern).await?;

tx.r#match(quad_pattern)
    .for_each(|quad| async move {
        eprintln!("{:?}", quad);
    })
    .await;

Querying the Store with SPARQL

To execute SPARQL queries on the store, use the sparql-store crate to wrap the underlying SqliteStore quad store into a SparqlStore:

use sparql_store::SparqlStore;

let mut store: SparqlStore<SqliteStore> = ... // TODO

let tx = store.read().await?;

📚 Reference

docs.rs/rdf-store-sqlite

See Also

Package Crate Docs
rdf-store-idb Package Documentation
rdf-store-mongo Package Documentation
rdf-store-neo4j Package Documentation
rdf-store-oxigraph Package Documentation
rdf-store-postgres Package Documentation
rdf-store-qlever Package Documentation
rdf-store-sqlite Package Documentation
rdf-store-turso Package Documentation
rdf-store-valkey Package Documentation
rdf-store-virtuoso Package Documentation

👨‍💻 Development

git clone https://github.com/rust-rdf/rdf.rs.git

Share on X Share on Reddit Share on Hacker News Share on Facebook Share on LinkedIn