pub trait AsyncRDF {
type Subject: Display + Sync + Send;
type IRI: Display + Hash + Eq + Sync + Send;
type BNode: Display + Sync + Send;
type Literal: Display + Sync + Send;
type Term: Display + Sync + Send;
type Err: Display + Sync + Send;
// Required methods
fn get_predicates_subject<'life0, 'life1, 'async_trait>(
&'life0 self,
subject: &'life1 Self::Subject,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::IRI>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_objects_for_subject_predicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 Self::Subject,
pred: &'life2 Self::IRI,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Term>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_subjects_for_object_predicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
object: &'life1 Self::Term,
pred: &'life2 Self::IRI,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Subject>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
An asynchronous trait for querying RDF graphs.
This trait provides a common interface for performing asynchronous queries on RDF graphs. It abstracts over the specific representation of RDF components, allowing implementations to use different backend storage systems or data structures.
§Associated Types
The trait defines several associated types that must be specified by implementors:
Subject: Represents an RDF subject (typically an IRI or blank node)IRI: Represents an Internationalized Resource IdentifierBNode: Represents a blank nodeLiteral: Represents a literal value (string, number, etc.)Term: Represents any RDF term (IRI, blank node, or literal)Err: The error type returned by operations
§Thread Safety
All associated types must implement Sync + Send to enable safe concurrent access
across thread boundaries, which is essential for asynchronous operations.
Required Associated Types§
Required Methods§
Sourcefn get_predicates_subject<'life0, 'life1, 'async_trait>(
&'life0 self,
subject: &'life1 Self::Subject,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::IRI>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_predicates_subject<'life0, 'life1, 'async_trait>(
&'life0 self,
subject: &'life1 Self::Subject,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::IRI>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves all predicates associated with a given subject.
§Arguments
subject- A reference to the subject whose predicates should be retrieved
Sourcefn get_objects_for_subject_predicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 Self::Subject,
pred: &'life2 Self::IRI,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Term>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_objects_for_subject_predicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
subject: &'life1 Self::Subject,
pred: &'life2 Self::IRI,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Term>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves all objects for a given subject-predicate pair.
§Arguments
subject- A reference to the subject of the triplespred- A reference to the predicate (property) of the triples
Sourcefn get_subjects_for_object_predicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
object: &'life1 Self::Term,
pred: &'life2 Self::IRI,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Subject>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_subjects_for_object_predicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
object: &'life1 Self::Term,
pred: &'life2 Self::IRI,
) -> Pin<Box<dyn Future<Output = Result<HashSet<Self::Subject>, Self::Err>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieves all subjects that have a specific object-predicate pair.
§Arguments
object- A reference to the object (term) to search forpred- A reference to the predicate (property) to match