pub struct WikidataClient { /* private fields */ }Expand description
Client for Wikidata API and SPARQL endpoint
Implementations§
Source§impl WikidataClient
impl WikidataClient
Sourcepub async fn search_entities(&self, query: &str) -> Result<Vec<WikidataEntity>>
pub async fn search_entities(&self, query: &str) -> Result<Vec<WikidataEntity>>
Sourcepub async fn get_entity(&self, qid: &str) -> Result<WikidataEntity>
pub async fn get_entity(&self, qid: &str) -> Result<WikidataEntity>
Sourcepub async fn query_climate_entities(&self) -> Result<Vec<DataRecord>>
pub async fn query_climate_entities(&self) -> Result<Vec<DataRecord>>
Query climate change related entities
Sourcepub async fn query_pharmaceutical_companies(&self) -> Result<Vec<DataRecord>>
pub async fn query_pharmaceutical_companies(&self) -> Result<Vec<DataRecord>>
Query pharmaceutical companies
Sourcepub async fn query_disease_outbreaks(&self) -> Result<Vec<DataRecord>>
pub async fn query_disease_outbreaks(&self) -> Result<Vec<DataRecord>>
Query disease outbreaks
Trait Implementations§
Source§impl DataSource for WikidataClient
impl DataSource for WikidataClient
Source§fn fetch_batch<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
_batch_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DataRecord>, Option<String>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn fetch_batch<'life0, 'async_trait>(
&'life0 self,
cursor: Option<String>,
_batch_size: usize,
) -> Pin<Box<dyn Future<Output = Result<(Vec<DataRecord>, Option<String>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch a batch of records starting from cursor
Auto Trait Implementations§
impl Freeze for WikidataClient
impl !RefUnwindSafe for WikidataClient
impl Send for WikidataClient
impl Sync for WikidataClient
impl Unpin for WikidataClient
impl !UnwindSafe for WikidataClient
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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