pub trait PropertyFunction:
Send
+ Sync
+ Debug {
// Required methods
fn metadata(&self) -> PropertyFunctionMetadata;
fn evaluate(
&self,
subject: &PropertyFunctionArg,
object: &PropertyFunctionArg,
) -> Result<PropertyFunctionResult, OxirsError>;
// Provided methods
fn validate(
&self,
subject: &PropertyFunctionArg,
object: &PropertyFunctionArg,
) -> Result<(), OxirsError> { ... }
fn estimated_cardinality(
&self,
_subject: &PropertyFunctionArg,
_object: &PropertyFunctionArg,
) -> Option<u64> { ... }
}Expand description
Core trait for property function implementations.
A property function is invoked when the SPARQL engine encounters a triple pattern whose predicate matches a registered IRI.
Required Methods§
Sourcefn metadata(&self) -> PropertyFunctionMetadata
fn metadata(&self) -> PropertyFunctionMetadata
Return metadata describing this property function.
Sourcefn evaluate(
&self,
subject: &PropertyFunctionArg,
object: &PropertyFunctionArg,
) -> Result<PropertyFunctionResult, OxirsError>
fn evaluate( &self, subject: &PropertyFunctionArg, object: &PropertyFunctionArg, ) -> Result<PropertyFunctionResult, OxirsError>
Provided Methods§
Sourcefn validate(
&self,
subject: &PropertyFunctionArg,
object: &PropertyFunctionArg,
) -> Result<(), OxirsError>
fn validate( &self, subject: &PropertyFunctionArg, object: &PropertyFunctionArg, ) -> Result<(), OxirsError>
Validate arguments before evaluation (optional override).
Sourcefn estimated_cardinality(
&self,
_subject: &PropertyFunctionArg,
_object: &PropertyFunctionArg,
) -> Option<u64>
fn estimated_cardinality( &self, _subject: &PropertyFunctionArg, _object: &PropertyFunctionArg, ) -> Option<u64>
Estimated cardinality of results (for query planning). Returns None if unknown. Default is None.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".