pub struct RdfRegistry { /* private fields */ }Expand description
High-performance RDF-backed registry
Uses oxigraph (semantic data store) as the single source of truth. All packages are stored as RDF triples enabling:
- SPARQL queries for intelligent search
- Semantic relationships between packages
- Version history tracking
- Full dependency graph representation
Implementations§
Source§impl RdfRegistry
impl RdfRegistry
Sourcepub fn new() -> RdfRegistry
pub fn new() -> RdfRegistry
Create a new RDF-backed registry
Sourcepub fn from_store(store: Store) -> RdfRegistry
pub fn from_store(store: Store) -> RdfRegistry
Create a new RDF-backed registry from an existing store
Sourcepub fn insert_package_rdf(&self, package: &Package) -> Result<(), Error>
pub fn insert_package_rdf(&self, package: &Package) -> Result<(), Error>
Insert a package as RDF triples using the mapper (public wrapper with locking)
§Errors
Error::RdfStoreError- When inserting triples into the RDF store failsError::SerializationError- When serializing package data to RDF fails
Sourcepub fn batch_insert_packages(
&self,
packages: Vec<Package>,
) -> Result<usize, Error>
pub fn batch_insert_packages( &self, packages: Vec<Package>, ) -> Result<usize, Error>
Batch insert multiple packages for efficient loading
§Errors
Error::RdfStoreError- When inserting triples into the RDF store failsError::SerializationError- When serializing package data to RDF fails
Sourcepub fn query_sparql(&self, query: &str) -> Result<Vec<String>, Error>
pub fn query_sparql(&self, query: &str) -> Result<Vec<String>, Error>
Query packages by SPARQL
§Errors
Error::SparqlError- When the SPARQL query syntax is invalidError::RdfStoreError- When querying the RDF store fails
Sourcepub fn stats(&self) -> RdfRegistryStats
pub fn stats(&self) -> RdfRegistryStats
Get statistics about the RDF store
Source§impl RdfRegistry
impl RdfRegistry
Sourcepub async fn create_package(&self, package: Package) -> Result<Package, Error>
pub async fn create_package(&self, package: Package) -> Result<Package, Error>
Create a new package in the RDF store
§Errors
Error::PackageAlreadyExists- When a package with the same ID already existsError::RdfStoreError- When inserting into the RDF store failsError::SerializationError- When serializing package data fails
Sourcepub async fn update_package(
&self,
id: &PackageId,
package: Package,
) -> Result<Package, Error>
pub async fn update_package( &self, id: &PackageId, package: Package, ) -> Result<Package, Error>
Update an existing package in the RDF store
§Errors
Error::PackageNotFound- When the package does not existError::RdfStoreError- When updating the RDF store failsError::SerializationError- When serializing updated package data fails
Sourcepub async fn delete_package(&self, id: &PackageId) -> Result<(), Error>
pub async fn delete_package(&self, id: &PackageId) -> Result<(), Error>
Delete a package from the RDF store
§Errors
Error::PackageNotFound- When the package does not existError::RdfStoreError- When deleting from the RDF store fails
Sourcepub async fn search_packages(
&self,
keyword: &str,
limit: usize,
) -> Result<Vec<SearchResult>, Error>
pub async fn search_packages( &self, keyword: &str, limit: usize, ) -> Result<Vec<SearchResult>, Error>
Search for packages by keyword
This performs full-text-like search over package names and descriptions by matching the keyword against RDF literals.
§Errors
Error::SearchError- When the search query fails
Trait Implementations§
Source§impl AsyncRepository for RdfRegistry
impl AsyncRepository for RdfRegistry
Source§type PackageIterator = IntoIter<Package>
type PackageIterator = IntoIter<Package>
Type for the iterator over packages
Source§fn get_package<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PackageId,
) -> Pin<Box<dyn Future<Output = Result<Package, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RdfRegistry: 'async_trait,
fn get_package<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PackageId,
) -> Pin<Box<dyn Future<Output = Result<Package, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RdfRegistry: 'async_trait,
Get a package by ID Read more
Source§fn get_package_version<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 PackageId,
version: &'life2 PackageVersion,
) -> Pin<Box<dyn Future<Output = Result<Package, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
RdfRegistry: 'async_trait,
fn get_package_version<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 PackageId,
version: &'life2 PackageVersion,
) -> Pin<Box<dyn Future<Output = Result<Package, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
RdfRegistry: 'async_trait,
Get a specific version of a package Read more
Source§fn all_packages<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Package>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
RdfRegistry: 'async_trait,
fn all_packages<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Package>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
RdfRegistry: 'async_trait,
Get all packages in the repository Read more
Source§fn list_versions<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PackageId,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageVersion>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RdfRegistry: 'async_trait,
fn list_versions<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 PackageId,
) -> Pin<Box<dyn Future<Output = Result<Vec<PackageVersion>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RdfRegistry: 'async_trait,
List all versions of a package Read more
Source§impl Default for RdfRegistry
impl Default for RdfRegistry
Source§fn default() -> RdfRegistry
fn default() -> RdfRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for RdfRegistry
impl !RefUnwindSafe for RdfRegistry
impl !UnwindSafe for RdfRegistry
impl Send for RdfRegistry
impl Sync for RdfRegistry
impl Unpin for RdfRegistry
impl UnsafeUnpin for RdfRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> EvidenceKind for T
impl<T> EvidenceKind for T
default fn kind_label(&self) -> &'static str
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more