pub enum Term {
Iri(Literal),
Literal(Literal),
BlankNode(Literal),
}
Expand description
An RDF Term is either an IRI, a literal or a blank node.
Variants§
Implementations§
Source§impl Term
impl Term
pub fn from_static(iri_str: &'static str) -> Result<Self, Error>
pub fn new_iri(iri: &Uri<&str>) -> Result<Self, Error>
pub fn new_iri_from_str(iri_str: &str) -> Result<Self, Error>
pub fn new_str(str: &str) -> Result<Self, Error>
pub fn new_blank_node(str: &str) -> Result<Self, Error>
Sourcepub fn display_turtle<'a, 'b>(&'a self) -> impl Display + 'a + 'bwhere
'a: 'b,
pub fn display_turtle<'a, 'b>(&'a self) -> impl Display + 'a + 'bwhere
'a: 'b,
Display a Term
in human-readable format.
use ekg_namespace::Term;
let term = Term::new_iri(&fluent_uri::Uri::parse("https://whatever.url").unwrap()).unwrap();
let turtle = format!("{}", term.display_turtle());
assert_eq!(turtle, "<https://whatever.url>");
Trait Implementations§
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