pub enum Term {
BlankId(BlankIdBuf),
Ground(GroundTerm),
}Expand description
Term.
Lexical representation of an RDF resource.
Variants§
Implementations§
Source§impl Term
impl Term
Sourcepub fn is_id(&self) -> bool
pub fn is_id(&self) -> bool
Checks if this term is an identifier, i.e. a blank node identifier or an IRI (as opposed to a literal).
Sourcepub fn as_id(&self) -> Option<IdRef<'_>>
pub fn as_id(&self) -> Option<IdRef<'_>>
Returns this term as an identifier, unless it is a literal.
Sourcepub fn is_blank_id(&self) -> bool
pub fn is_blank_id(&self) -> bool
Checks if this is a blank node identifier.
Sourcepub fn is_ground(&self) -> bool
pub fn is_ground(&self) -> bool
Checks if this is a ground term (an IRI or a literal, but not a blank node identifier).
Sourcepub fn as_blank_id(&self) -> Option<&BlankId>
pub fn as_blank_id(&self) -> Option<&BlankId>
Returns this term as a blank node identifier, if it is one.
Sourcepub fn as_ground(&self) -> Option<&GroundTerm>
pub fn as_ground(&self) -> Option<&GroundTerm>
Returns this term as a ground term, if it is one.
Sourcepub fn into_ground(self) -> Result<GroundTerm, BlankIdBuf>
pub fn into_ground(self) -> Result<GroundTerm, BlankIdBuf>
Turns this term into a ground term, or returns the blank node identifier if it isn’t one.
Sourcepub fn into_iri(self) -> Result<IriBuf, Self>
pub fn into_iri(self) -> Result<IriBuf, Self>
Turns this term into an IRI, or returns it unchanged if it isn’t one.
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Checks if this is a literal.
Sourcepub fn as_literal(&self) -> Option<LiteralRef<'_>>
pub fn as_literal(&self) -> Option<LiteralRef<'_>>
Returns this term as a literal, if it is one.
Trait Implementations§
Source§impl AsPattern for Term
Blank node identifiers act as the variable side of the Pattern
ground/variable abstraction, and ground terms act as the ground side.
impl AsPattern for Term
Blank node identifiers act as the variable side of the Pattern
ground/variable abstraction, and ground terms act as the ground side.
This lets lexical RDF data be used directly with rdf-types’ pattern
matching and isomorphism-checking facilities (e.g.
are_isomorphic and
find_bijection), since blank node
identifiers, like pattern variables, are existentially quantified and can
be renamed without changing the meaning of the data.
Source§type Ground = GroundTerm
type Ground = GroundTerm
Source§fn as_pattern(&self) -> Pattern<&GroundTerm, &BlankId>
fn as_pattern(&self) -> Pattern<&GroundTerm, &BlankId>
Pattern.Source§fn is_ground(&self) -> bool
fn is_ground(&self) -> bool
Source§fn is_ground_and(&self, f: impl FnOnce(&Self::Ground) -> bool) -> bool
fn is_ground_and(&self, f: impl FnOnce(&Self::Ground) -> bool) -> bool
true if this value is a ground value satisfying the given
predicate, and false if it is a variable.Source§fn is_var_and(&self, f: impl FnOnce(&Self::Var) -> bool) -> bool
fn is_var_and(&self, f: impl FnOnce(&Self::Var) -> bool) -> bool
true if this value is a variable satisfying the given
predicate, and false if it is a ground value.Source§impl Comparable<Term> for CowTerm<'_>
impl Comparable<Term> for CowTerm<'_>
Source§impl Comparable<Term> for TermRef<'_>
impl Comparable<Term> for TermRef<'_>
impl Eq for Term
Source§impl Equivalent<Term> for CowTerm<'_>
impl Equivalent<Term> for CowTerm<'_>
Source§fn equivalent(&self, key: &Term) -> bool
fn equivalent(&self, key: &Term) -> bool
key and return true if they are equal.Source§impl Equivalent<Term> for TermRef<'_>
impl Equivalent<Term> for TermRef<'_>
Source§fn equivalent(&self, key: &Term) -> bool
fn equivalent(&self, key: &Term) -> bool
key and return true if they are equal.Source§impl From<BlankIdBuf> for Term
impl From<BlankIdBuf> for Term
Source§fn from(value: BlankIdBuf) -> Self
fn from(value: BlankIdBuf) -> Self
Source§impl From<GroundTerm> for Term
impl From<GroundTerm> for Term
Source§fn from(value: GroundTerm) -> Self
fn from(value: GroundTerm) -> Self
Source§impl Ord for Term
impl Ord for Term
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq<CowTerm<'_>> for Term
impl PartialEq<CowTerm<'_>> for Term
Source§impl<'a> PartialEq<TermRef<'a>> for Term
impl<'a> PartialEq<TermRef<'a>> for Term
Source§impl PartialOrd for Term
impl PartialOrd for Term
Source§impl PartialOrd<CowTerm<'_>> for Term
impl PartialOrd<CowTerm<'_>> for Term
Source§impl PartialOrd<Term> for CowTerm<'_>
impl PartialOrd<Term> for CowTerm<'_>
Source§impl PartialOrd<Term> for TermRef<'_>
impl PartialOrd<Term> for TermRef<'_>
Source§impl<'a> PartialOrd<TermRef<'a>> for Term
impl<'a> PartialOrd<TermRef<'a>> for Term
Source§impl RdfDisplay for Term
impl RdfDisplay for Term
Source§fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
fn rdf_fmt(&self, f: &mut Formatter<'_>) -> Result
Source§fn rdf_display(&self) -> RdfDisplayed<&Self>
fn rdf_display(&self) -> RdfDisplayed<&Self>
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Freeze for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnsafeUnpin for Term
impl UnwindSafe for Term
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.