pub enum Term {
NamedNode(NamedNode),
BlankNode(BlankNode),
Literal(Literal),
}
Expand description
An owned RDF term
It is the union of IRIs, blank nodes, literals and triples (if the rdf-12
feature is enabled).
Variants§
Implementations§
Source§impl Term
impl Term
pub fn is_named_node(&self) -> bool
pub fn is_blank_node(&self) -> bool
pub fn is_literal(&self) -> bool
pub fn as_ref(&self) -> TermRef<'_>
Trait Implementations§
Source§impl From<BlankNodeRef<'_>> for Term
impl From<BlankNodeRef<'_>> for Term
Source§fn from(node: BlankNodeRef<'_>) -> Term
fn from(node: BlankNodeRef<'_>) -> Term
Converts to this type from the input type.
Source§impl From<GroundTerm> for Term
impl From<GroundTerm> for Term
Source§fn from(term: GroundTerm) -> Term
fn from(term: GroundTerm) -> Term
Converts to this type from the input type.
Source§impl From<LiteralRef<'_>> for Term
impl From<LiteralRef<'_>> for Term
Source§fn from(literal: LiteralRef<'_>) -> Term
fn from(literal: LiteralRef<'_>) -> Term
Converts to this type from the input type.
Source§impl From<NamedNodeRef<'_>> for Term
impl From<NamedNodeRef<'_>> for Term
Source§fn from(node: NamedNodeRef<'_>) -> Term
fn from(node: NamedNodeRef<'_>) -> Term
Converts to this type from the input type.
Source§impl From<NamedOrBlankNode> for Term
impl From<NamedOrBlankNode> for Term
Source§fn from(node: NamedOrBlankNode) -> Term
fn from(node: NamedOrBlankNode) -> Term
Converts to this type from the input type.
Source§impl From<NamedOrBlankNodeRef<'_>> for Term
impl From<NamedOrBlankNodeRef<'_>> for Term
Source§fn from(node: NamedOrBlankNodeRef<'_>) -> Term
fn from(node: NamedOrBlankNodeRef<'_>) -> Term
Converts to this type from the input type.
Source§impl From<Term> for PlainTermScalar
impl From<Term> for PlainTermScalar
Source§fn from(term: Term) -> PlainTermScalar
fn from(term: Term) -> PlainTermScalar
Converts to this type from the input type.
Source§impl From<Term> for TermPattern
impl From<Term> for TermPattern
Source§fn from(term: Term) -> TermPattern
fn from(term: Term) -> TermPattern
Converts to this type from the input type.
Source§impl From<TypedValueRef<'_>> for Term
impl From<TypedValueRef<'_>> for Term
Source§fn from(value: TypedValueRef<'_>) -> Term
fn from(value: TypedValueRef<'_>) -> Term
Converts to this type from the input type.
Source§impl FromStr for Term
impl FromStr for Term
Source§fn from_str(s: &str) -> Result<Term, <Term as FromStr>::Err>
fn from_str(s: &str) -> Result<Term, <Term as FromStr>::Err>
Parses a term from its NTriples serialization
use oxrdf::*;
use std::str::FromStr;
assert_eq!(
Term::from_str("\"ex\"")?,
Literal::new_simple_literal("ex").into()
);
Source§type Err = TermParseError
type Err = TermParseError
The associated error which can be returned from parsing.
Source§impl TryFrom<Term> for GroundTerm
impl TryFrom<Term> for GroundTerm
Source§impl TryFrom<Term> for NamedOrBlankNode
impl TryFrom<Term> for NamedOrBlankNode
Source§type Error = TryFromTermError
type Error = TryFromTermError
The type returned in the event of a conversion error.
Source§fn try_from(
term: Term,
) -> Result<NamedOrBlankNode, <NamedOrBlankNode as TryFrom<Term>>::Error>
fn try_from( term: Term, ) -> Result<NamedOrBlankNode, <NamedOrBlankNode as TryFrom<Term>>::Error>
Performs the conversion.
Source§impl TryFrom<TermPattern> for Term
impl TryFrom<TermPattern> for Term
impl Eq for Term
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 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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