pub struct AccelRepository { /* private fields */ }Expand description
Derives, maintains, and queries the accelerator indexes for the Postgres backend.
Implementations§
Source§impl AccelRepository
impl AccelRepository
pub fn new(pool: PgPool, triples: TripleRepository) -> Self
Sourcepub async fn run(
&self,
query: &AcceleratedQuery,
) -> Result<AccelSolutions, DomainError>
pub async fn run( &self, query: &AcceleratedQuery, ) -> Result<AccelSolutions, DomainError>
Answer a recognized query from the graph’s accelerator indexes, which the
write path keeps in sync with the committed triples (see
Self::refresh_graph).
Sourcepub async fn resource_occurrences(
&self,
iri: &str,
) -> Result<Vec<ResourceOccurrence>, DomainError>
pub async fn resource_occurrences( &self, iri: &str, ) -> Result<Vec<ResourceOccurrence>, DomainError>
Every occurrence of one resource, ordered by graph IRI. The graph-local accelerator metadata is the universal RDF-derived resource catalog.
pub async fn resource( &self, iri: &str, ) -> Result<Option<ResourceRecord>, DomainError>
Sourcepub async fn resources(
&self,
query: &ResourceQuery,
) -> Result<CursorPage<ResourceRecord>, DomainError>
pub async fn resources( &self, query: &ResourceQuery, ) -> Result<CursorPage<ResourceRecord>, DomainError>
Globally keyset-page unique resource IRIs, applying filters before the limit. Only the returned page is expanded to occurrence metadata.
Sourcepub async fn resources_for_iris(
&self,
iris: &[String],
) -> Result<Vec<ResourceRecord>, DomainError>
pub async fn resources_for_iris( &self, iris: &[String], ) -> Result<Vec<ResourceRecord>, DomainError>
Expand a page of resource identities in one query. Keeping this separate from the keyset query avoids one database round trip per list item.
pub async fn sequence( &self, iri: &str, ) -> Result<Option<CatalogSequenceRecord>, DomainError>
pub async fn sequences( &self, query: &SequenceQuery, ) -> Result<CursorPage<CatalogSequenceRecord>, DomainError>
Sourcepub async fn refresh_graph(
&self,
conn: &mut PgConnection,
graph: &str,
) -> Result<(), DomainError>
pub async fn refresh_graph( &self, conn: &mut PgConnection, graph: &str, ) -> Result<(), DomainError>
Rebuild a graph’s accelerator indexes from its triples, inside the
caller’s write transaction (atomic with the triple write). The triple
scan runs through conn, so it sees the triples the same transaction
just wrote; the rebuilt indexes are deleted and reinserted on conn and
commit together with the triples. Callers invoke this after every write
that changes a graph’s triples.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AccelRepository
impl !UnwindSafe for AccelRepository
impl Freeze for AccelRepository
impl Send for AccelRepository
impl Sync for AccelRepository
impl Unpin for AccelRepository
impl UnsafeUnpin for AccelRepository
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