rdf-store-postgres 0.3.3

RDF.rs is a Rust framework for working with RDF knowledge graphs.
Documentation

RDF.rs: PostgreSQL Store

License Compatibility Package Documentation

A PostgreSQL storage adapter for RDF.rs, a Rust framework for RDF 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 quad store backed by PostgreSQL.
  • Built on async Rust using lazily-evaluated streams throughout.
  • 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-postgres

Installation in Cargo.toml

Enable all default features:

[dependencies]
rdf-store-postgres = { version = "0.3" }

Enable only specific features:

[dependencies]
rdf-store-postgres = { version = "0.3", default-features = false, features = ["tls"] }

👉 Examples

Importing the Library

use rdf_store_postgres::{PostgresStore, PostgresTransaction};

Connecting to the Store

let mut store = PostgresStore::open("postgres://").await?;

Mutating the Store

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

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

tx.commit().await?; // ...or:
//tx.rollback().await?;

Accessing the Store

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

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

📚 Reference

docs.rs/rdf-store-postgres

👨‍💻 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