pub struct EntityLink {
pub uri: String,
pub entity_type: EntityType,
pub label: Option<String>,
pub confidence: Option<f64>,
pub source: Option<KnowledgeBase>,
}Expand description
A link to an external entity in a knowledge base.
Fields§
§uri: StringURI of the entity.
entity_type: EntityTypeType of entity.
label: Option<String>Display label.
confidence: Option<f64>Confidence score (0.0 to 1.0).
source: Option<KnowledgeBase>Source knowledge base.
Implementations§
Source§impl EntityLink
impl EntityLink
Sourcepub fn new(uri: impl Into<String>, entity_type: EntityType) -> Self
pub fn new(uri: impl Into<String>, entity_type: EntityType) -> Self
Create a new entity link.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Set the display label.
Sourcepub fn with_confidence(self, confidence: f64) -> Self
pub fn with_confidence(self, confidence: f64) -> Self
Set confidence score.
Sourcepub fn with_source(self, source: KnowledgeBase) -> Self
pub fn with_source(self, source: KnowledgeBase) -> Self
Set source knowledge base.
Sourcepub fn wikipedia(title: impl Into<String>, entity_type: EntityType) -> Self
pub fn wikipedia(title: impl Into<String>, entity_type: EntityType) -> Self
Create a Wikipedia entity link.
Sourcepub fn wikidata(qid: impl Into<String>, entity_type: EntityType) -> Self
pub fn wikidata(qid: impl Into<String>, entity_type: EntityType) -> Self
Create a Wikidata entity link.
Trait Implementations§
Source§impl Clone for EntityLink
impl Clone for EntityLink
Source§fn clone(&self) -> EntityLink
fn clone(&self) -> EntityLink
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EntityLink
impl Debug for EntityLink
Source§impl<'de> Deserialize<'de> for EntityLink
impl<'de> Deserialize<'de> for EntityLink
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EntityLink
impl PartialEq for EntityLink
Source§impl Serialize for EntityLink
impl Serialize for EntityLink
impl StructuralPartialEq for EntityLink
Auto Trait Implementations§
impl Freeze for EntityLink
impl RefUnwindSafe for EntityLink
impl Send for EntityLink
impl Sync for EntityLink
impl Unpin for EntityLink
impl UnsafeUnpin for EntityLink
impl UnwindSafe for EntityLink
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