pub struct ViewDefinition {
pub name: String,
pub sparql_query: String,
pub is_materialized: bool,
pub dependencies: Vec<String>,
}Expand description
Metadata that describes a named, materialized SPARQL view.
The dependencies field lists the predicate IRIs that the SPARQL query
accesses. It is used for selective delta propagation: only views that
mention a changed predicate in their dependencies (or have an empty list,
meaning “depends on everything”) are invalidated when a triple changes.
Fields§
§name: StringHuman-readable name that serves as the unique key in a maintainer.
sparql_query: StringThe SPARQL SELECT query that defines the view’s result set.
is_materialized: boolWhether the view caches its result rows (materialized) or is virtual.
dependencies: Vec<String>Predicate IRIs this view’s query accesses.
An empty list means the view depends on all predicates (universal dependency), so it is invalidated by any triple change.
Implementations§
Source§impl ViewDefinition
impl ViewDefinition
Sourcepub fn new(
name: impl Into<String>,
sparql_query: impl Into<String>,
is_materialized: bool,
dependencies: Vec<String>,
) -> Self
pub fn new( name: impl Into<String>, sparql_query: impl Into<String>, is_materialized: bool, dependencies: Vec<String>, ) -> Self
Create a new view definition.
Sourcepub fn depends_on(&self, predicate: &str) -> bool
pub fn depends_on(&self, predicate: &str) -> bool
Return true if the given predicate IRI is listed in the
dependencies, or if dependencies is empty (universal dependency).
Trait Implementations§
Source§impl Clone for ViewDefinition
impl Clone for ViewDefinition
Source§fn clone(&self) -> ViewDefinition
fn clone(&self) -> ViewDefinition
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 ViewDefinition
impl RefUnwindSafe for ViewDefinition
impl Send for ViewDefinition
impl Sync for ViewDefinition
impl Unpin for ViewDefinition
impl UnsafeUnpin for ViewDefinition
impl UnwindSafe for ViewDefinition
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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