[][src]Enum wikibase::Entity

pub enum Entity {
    Item(ItemEntity),
    Property(PropertyEntity),
}

Entiry is an enum wrapper around items, properties, and potentially others (lexemes?)

Variants

Item(ItemEntity)Property(PropertyEntity)

Methods

impl Entity[src]

pub fn new_empty_item() -> Self[src]

pub fn new_empty_property() -> Self[src]

pub fn new_item(
    id: String,
    labels: Vec<LocaleString>,
    descriptions: Vec<LocaleString>,
    aliases: Vec<LocaleString>,
    claims: Vec<Statement>,
    sitelinks: Option<Vec<SiteLink>>,
    missing: bool
) -> Self
[src]

pub fn new_property(
    id: String,
    labels: Vec<LocaleString>,
    descriptions: Vec<LocaleString>,
    aliases: Vec<LocaleString>,
    claims: Vec<Statement>,
    sitelinks: Option<Vec<SiteLink>>,
    missing: bool
) -> Self
[src]

pub fn new_from_id<S: Into<String>>(
    id: S,
    configuration: &Configuration
) -> Result<Entity, WikibaseError>
[src]

Takes a single Q-Id or P-Id and returns an item result.

Example

let configuration = wikibase::Configuration::new("Automatic-Testing/1.0").unwrap();
let item = wikibase::Entity::new_from_id("Q47532594", &configuration);

pub fn new_from_ids(
    ids: Vec<String>,
    configuration: &Configuration
) -> Result<Entity, WikibaseError>
[src]

Takes a vector of Q-Ids or P-Ids and returns an item result.

pub fn new_from_query(
    query: &EntityQuery,
    configuration: &Configuration
) -> Result<Entity, WikibaseError>
[src]

Takes a entity query and returns an item.

pub fn aliases(&self) -> &Vec<LocaleString>[src]

pub fn descriptions(&self) -> &Vec<LocaleString>[src]

pub fn labels(&self) -> &Vec<LocaleString>[src]

pub fn label_in_locale(&self, locale: &str) -> Option<&str>[src]

pub fn description_in_locale(&self, locale: &str) -> Option<&str>[src]

pub fn set_aliases(&mut self, aliases: Vec<LocaleString>)[src]

pub fn set_claims(&mut self, claims: Vec<Statement>)[src]

pub fn add_claim(&mut self, claim: Statement)[src]

pub fn set_descriptions(&mut self, descriptions: Vec<LocaleString>)[src]

pub fn set_id(&mut self, id: String)[src]

pub fn set_labels(&mut self, labels: Vec<LocaleString>)[src]

pub fn set_missing(&mut self, missing: bool)[src]

pub fn set_label(&mut self, new_label: LocaleString)[src]

pub fn remove_label<S: Into<String>>(&mut self, language: S)[src]

pub fn remove_description<S: Into<String>>(&mut self, language: S)[src]

pub fn set_description(&mut self, new_description: LocaleString)[src]

pub fn add_alias(&mut self, new_alias: LocaleString)[src]

pub fn remove_alias(&mut self, alias: LocaleString)[src]

pub fn claims(&self) -> &Vec<Statement>[src]

pub fn claims_mut(&mut self) -> &mut Vec<Statement>[src]

pub fn id(&self) -> &str[src]

pub fn missing(&self) -> bool[src]

pub fn claims_with_property<S: Into<String>>(
    &self,
    property_id: S
) -> Vec<&Statement>
[src]

pub fn values_for_property<S: Into<String>>(&self, property_id: S) -> Vec<Value>[src]

pub fn has_target_entity<S: Into<String>>(
    &self,
    property_id: S,
    target_entity_id: S
) -> bool
[src]

pub fn claim_with_id<S: Into<String>>(&self, id: S) -> Option<&Statement>[src]

pub fn has_claims_with_property<S: Into<String>>(&self, property_id: S) -> bool[src]

pub fn entity_type(&self) -> &EntityType[src]

Trait Implementations

impl Clone for Entity[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Entity[src]

impl Serialize for Entity[src]

Auto Trait Implementations

impl Send for Entity

impl Sync for Entity

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err