Skip to main content

PropertyFunction

Trait PropertyFunction 

Source
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§

Source

fn metadata(&self) -> PropertyFunctionMetadata

Return metadata describing this property function.

Source

fn evaluate( &self, subject: &PropertyFunctionArg, object: &PropertyFunctionArg, ) -> Result<PropertyFunctionResult, OxirsError>

Evaluate the property function given the subject and object arguments.

§Arguments
  • subject - The subject side of the triple pattern
  • object - The object side of the triple pattern
§Returns

A set of bindings produced by the evaluation.

Provided Methods§

Source

fn validate( &self, subject: &PropertyFunctionArg, object: &PropertyFunctionArg, ) -> Result<(), OxirsError>

Validate arguments before evaluation (optional override).

Source

fn estimated_cardinality( &self, _subject: &PropertyFunctionArg, _object: &PropertyFunctionArg, ) -> Option<u64>

Estimated cardinality of results (for query planning). Returns None if unknown. Default is None.

Implementors§