pub struct RdfFusionContext { /* private fields */ }
Expand description
Represents a connection to an instance of an RDF Fusion engine.
An RDF Fusion instance consists of:
- A SessionContext. This is the primary interaction point with DataFusion.
- An RdfFusionFunctionRegistry that holds the currently registered RDF Fusion built-ins.
- A reference to a quad storage.
Implementations§
Source§impl RdfFusionContext
impl RdfFusionContext
Sourcepub fn new(
config: SessionConfig,
runtime_env: Arc<RuntimeEnv>,
storage: Arc<dyn QuadStorage>,
) -> RdfFusionContext
pub fn new( config: SessionConfig, runtime_env: Arc<RuntimeEnv>, storage: Arc<dyn QuadStorage>, ) -> RdfFusionContext
Creates a new RdfFusionContext with the default configuration and the given storage
.
Sourcepub fn create_view(&self) -> RdfFusionContextView
pub fn create_view(&self) -> RdfFusionContextView
Creates a new RdfFusionContextView on this context. The resulting view should be passed around in the RDF Fusion ecosystem to access the current configuration without directly depending on the RdfFusionContext.
Sourcepub fn session_context(&self) -> &SessionContext
pub fn session_context(&self) -> &SessionContext
Provides a reference to the SessionContext.
Sourcepub fn functions(&self) -> &Arc<dyn RdfFusionFunctionRegistry>
pub fn functions(&self) -> &Arc<dyn RdfFusionFunctionRegistry>
Returns a reference to the used RdfFusionFunctionRegistry.
Sourcepub fn encodings(&self) -> &RdfFusionEncodings
pub fn encodings(&self) -> &RdfFusionEncodings
Returns a reference to the used RdfFusionEncodings.
Sourcepub fn storage(&self) -> &Arc<dyn QuadStorage>
pub fn storage(&self) -> &Arc<dyn QuadStorage>
Provides access to the QuadStorage of this instance for writing operations.
Sourcepub async fn contains(
&self,
quad: &QuadRef<'_>,
) -> Result<bool, DataFusionError>
pub async fn contains( &self, quad: &QuadRef<'_>, ) -> Result<bool, DataFusionError>
Checks whether quad
is contained in the instance.
Sourcepub async fn len(&self) -> Result<usize, DataFusionError>
pub async fn len(&self) -> Result<usize, DataFusionError>
Returns the number of quads in the instance.
Sourcepub async fn quads_for_pattern(
&self,
graph_name: Option<GraphNameRef<'_>>,
subject: Option<NamedOrBlankNodeRef<'_>>,
predicate: Option<NamedNodeRef<'_>>,
object: Option<TermRef<'_>>,
) -> Result<Pin<Box<dyn RecordBatchStream<Item = Result<RecordBatch, DataFusionError>> + Send>>, DataFusionError>
pub async fn quads_for_pattern( &self, graph_name: Option<GraphNameRef<'_>>, subject: Option<NamedOrBlankNodeRef<'_>>, predicate: Option<NamedNodeRef<'_>>, object: Option<TermRef<'_>>, ) -> Result<Pin<Box<dyn RecordBatchStream<Item = Result<RecordBatch, DataFusionError>> + Send>>, DataFusionError>
Returns a stream of all quads that match the given pattern.
Sourcepub async fn execute_query(
&self,
query: &Query,
options: QueryOptions,
) -> Result<(QueryResults, QueryExplanation), QueryEvaluationError>
pub async fn execute_query( &self, query: &Query, options: QueryOptions, ) -> Result<(QueryResults, QueryExplanation), QueryEvaluationError>
Evaluates a SPARQL Query over the instance.
Trait Implementations§
Source§impl Clone for RdfFusionContext
impl Clone for RdfFusionContext
Source§fn clone(&self) -> RdfFusionContext
fn clone(&self) -> RdfFusionContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for RdfFusionContext
impl !RefUnwindSafe for RdfFusionContext
impl Send for RdfFusionContext
impl Sync for RdfFusionContext
impl Unpin for RdfFusionContext
impl !UnwindSafe for RdfFusionContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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