pub struct Triple<'a> {
pub subject: Subject<'a>,
pub predicate: NamedNode<'a>,
pub object: Term<'a>,
}
Expand description
A RDF triple.
The default string formatter is returning a N-Triples, Turtle and SPARQL compatible representation.
use rio_api::model::NamedNode;
use rio_api::model::Triple;
assert_eq!(
"<http://example.com/foo> <http://schema.org/sameAs> <http://example.com/foo>",
Triple {
subject: NamedNode { iri: "http://example.com/foo" }.into(),
predicate: NamedNode { iri: "http://schema.org/sameAs" },
object: NamedNode { iri: "http://example.com/foo" }.into(),
}.to_string()
)
Fields§
§subject: Subject<'a>
§predicate: NamedNode<'a>
§object: Term<'a>
Trait Implementations§
impl<'a> Copy for Triple<'a>
impl<'a> Eq for Triple<'a>
impl<'a> StructuralPartialEq for Triple<'a>
Auto Trait Implementations§
impl<'a> Freeze for Triple<'a>
impl<'a> RefUnwindSafe for Triple<'a>
impl<'a> Send for Triple<'a>
impl<'a> Sync for Triple<'a>
impl<'a> Unpin for Triple<'a>
impl<'a> UnwindSafe for Triple<'a>
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