nostralink 0.2.1

Linked data library for nostr
Documentation
//! [`RdfEventsStore`]: crate::oxistore::manager::RdfEventsStore
//! [`run_query`]: crate::oxistore::manager::RdfEventsStore::run_query
//! [`Client`]: nostr_sdk::Client
//!
//! *nostralink* is a Rust crate that allows you to transform [nostr](https://nostr.how)
//! events to linked data and save them to an [RDF](https://www.w3.org/RDF) triple store.
//! It also offers APIs to write events as linked data (using JSON-LD) and make queries.
//!
//! # RDF events store
//!
//! In order to activate nostralink for a nostr [`Client`] , open an [`RdfEventsStore`]
//! and set it as the client's [database](https://crates.io/crates/nostr-database).
//! Incoming events will automatically be converted to RDF triples and saved to the store.
//!
//! ```rust
//! use nostralink::prelude::*;
//! use std::path::PathBuf;
//!
//! #[tokio::main]
//! async fn main() {
//!     let keys = Keys::generate();
//!     let store = RdfEventsStore::open(PathBuf::from("store")).expect("Cannot open store");
//!     let client = Client::builder().database(store).signer(keys).build();
//! }
//! ```
//!
//! # Querying
//!
//! Use [`run_query`] to run a SparQL query. There is a built-in
//! [collection](https://codeberg.org/nostralink/nostralink/src/branch/master/sparql)
//! of SparQL queries. Use [`crate::querydb::nrq_get`] to retrieve a query by its name.
//!
//! ```
//! use nostralink::prelude::*;
//! use std::path::PathBuf;
//!
//! fn main() -> Result<(), RdfStoreError> {
//!     let store = RdfEventsStore::open(PathBuf::from("store")).expect("Cannot open store");
//!     let result_set = store
//!         .run_query(&nrq_get("user_metadata")?, [], None)?;
//!
//!     for row in &result_set.rows {
//!         if let Some(cell) = row.get("metadata_name") {
//!             println!("name: {}", cell.to_string());
//!         }
//!     }
//!
//!     Ok(())
//! }
//! ```
//!
//! - [paz (nostr client written with nostralink)](https://codeberg.org/nostralink/paz)
//! - [Book](https://nostralink.codeberg.page)

batbox_i18n::gen!(mod i18n: "i18n/translations.toml");

pub mod err;
pub mod ldbuilder;
#[warn(non_upper_case_globals)]
pub mod ldevents;
pub mod loaders;
pub mod niri;
pub mod oxistore;
pub mod parser;
pub mod prelude;
pub mod querydb;
pub mod rdfify;
pub mod rdfify_sophia;
pub mod util;

#[cfg(test)]
mod tests;