pub trait ScalarSparqlOp:
Debug
+ Hash
+ Eq
+ Send
+ Sync {
// Required methods
fn name(&self) -> &FunctionName;
fn signature(&self) -> ScalarSparqlOpSignature;
// Provided methods
fn typed_value_encoding_op(
&self,
) -> Option<Box<dyn ScalarSparqlOpImpl<TypedValueEncoding>>> { ... }
fn plain_term_encoding_op(
&self,
) -> Option<Box<dyn ScalarSparqlOpImpl<PlainTermEncoding>>> { ... }
fn object_id_encoding_op(
&self,
_object_id_encoding: &ObjectIdEncoding,
) -> Option<Box<dyn ScalarSparqlOpImpl<ObjectIdEncoding>>> { ... }
}
Expand description
A ScalarSparqlOp is a function that operates on RDF terms. The function may return a different type of value. For example, a function that takes two RDF terms and outputs an integer can be implemented using this trait.
The goal is to make it easier for users to implement custom SPARQL functions. The different encodings of RDF Fusion are handled by providing a ScalarSparqlOpImpl for any given encoding.
To install a ScalarSparqlOp in DataFusion, use the ScalarSparqlOpAdapter. The adapter will mediate between DataFusion’s API and the given ScalarSparqlOpImpl.
Required Methods§
Sourcefn name(&self) -> &FunctionName
fn name(&self) -> &FunctionName
Returns the name of the operation.
Sourcefn signature(&self) -> ScalarSparqlOpSignature
fn signature(&self) -> ScalarSparqlOpSignature
Returns the signature of this operation.
Provided Methods§
Sourcefn typed_value_encoding_op(
&self,
) -> Option<Box<dyn ScalarSparqlOpImpl<TypedValueEncoding>>>
fn typed_value_encoding_op( &self, ) -> Option<Box<dyn ScalarSparqlOpImpl<TypedValueEncoding>>>
Returns the ScalarSparqlOpImpl for the TypedValueEncoding.
If None is returned, the operation does not support the TypedValueEncoding.
Sourcefn plain_term_encoding_op(
&self,
) -> Option<Box<dyn ScalarSparqlOpImpl<PlainTermEncoding>>>
fn plain_term_encoding_op( &self, ) -> Option<Box<dyn ScalarSparqlOpImpl<PlainTermEncoding>>>
Returns the ScalarSparqlOpImpl for the PlainTermEncoding.
If None is returned, the operation does not support the PlainTermEncoding.
Sourcefn object_id_encoding_op(
&self,
_object_id_encoding: &ObjectIdEncoding,
) -> Option<Box<dyn ScalarSparqlOpImpl<ObjectIdEncoding>>>
fn object_id_encoding_op( &self, _object_id_encoding: &ObjectIdEncoding, ) -> Option<Box<dyn ScalarSparqlOpImpl<ObjectIdEncoding>>>
Returns the ScalarSparqlOpImpl for the ObjectIdEncoding.
If None is returned, the operation does not support the ObjectIdEncoding.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.