pub struct OntologyRepository { /* private fields */ }Implementations§
Source§impl OntologyRepository
impl OntologyRepository
pub fn new(pool: PgPool) -> Self
Sourcepub async fn load_from_url(
&self,
prefix: &str,
name: &str,
source_url: &str,
) -> Result<OntologyLoadReport, DomainError>
pub async fn load_from_url( &self, prefix: &str, name: &str, source_url: &str, ) -> Result<OntologyLoadReport, DomainError>
Fetch an OBO file from source_url, parse it, and persist the
ontology + terms + closure in a single transaction. prefix (e.g.
“SO”, “SBO”) drives IRI generation and is the row key in
sbol_ontologies.
Sourcepub async fn load_from_text(
&self,
prefix: &str,
name: &str,
source_url: Option<&str>,
text: &str,
) -> Result<OntologyLoadReport, DomainError>
pub async fn load_from_text( &self, prefix: &str, name: &str, source_url: Option<&str>, text: &str, ) -> Result<OntologyLoadReport, DomainError>
Same as [load_from_url] but takes already-fetched OBO text. The OBO
parse, canonical-IRI/alias generation, and closure are derived by the
shared build_ontology_plan; this method only persists the plan.
pub async fn list_ontologies(&self) -> Result<Vec<OntologyRecord>, DomainError>
Sourcepub async fn canonicalize(
&self,
iri: &str,
) -> Result<Option<String>, DomainError>
pub async fn canonicalize( &self, iri: &str, ) -> Result<Option<String>, DomainError>
Resolve any input IRI (canonical or alias) to a canonical term IRI.
Sourcepub async fn descendants(
&self,
iri: &str,
) -> Result<Vec<(String, i16)>, DomainError>
pub async fn descendants( &self, iri: &str, ) -> Result<Vec<(String, i16)>, DomainError>
Return the term plus every descendant IRI under it (transitively). The root itself is included with depth 0.
Sourcepub async fn list_terms(
&self,
prefix: &str,
limit: i64,
offset: i64,
search: Option<&str>,
) -> Result<(Vec<OntologyTermRecord>, i64), DomainError>
pub async fn list_terms( &self, prefix: &str, limit: i64, offset: i64, search: Option<&str>, ) -> Result<(Vec<OntologyTermRecord>, i64), DomainError>
Page through every term that belongs to prefix, sorted by
curie. search (when non-empty) restricts by case-insensitive
substring match on either the curie or the name. Returns the
page rows plus the total matching count so that callers can render
a paginated UI without a second round-trip.
pub async fn get_term( &self, iri: &str, ) -> Result<Option<OntologyTermRecord>, DomainError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OntologyRepository
impl !UnwindSafe for OntologyRepository
impl Freeze for OntologyRepository
impl Send for OntologyRepository
impl Sync for OntologyRepository
impl Unpin for OntologyRepository
impl UnsafeUnpin for OntologyRepository
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