pub struct Triple {
pub subject: Subject,
pub predicate: NamedNode,
pub object: Term,
}
Expand description
An owned RDF triple.
The default string formatter is returning an N-Triples, Turtle, and SPARQL compatible representation:
use oxrdf::{Triple, NamedNode};
assert_eq!(
"<http://example.com/s> <http://example.com/p> <http://example.com/o>",
Triple {
subject: NamedNode::new("http://example.com/s")?.into(),
predicate: NamedNode::new("http://example.com/p")?,
object: NamedNode::new("http://example.com/o")?.into(),
}.to_string()
);
Fields§
§subject: Subject
The subject of this triple.
predicate: NamedNode
The predicate of this triple.
object: Term
The object of this triple.
Implementations§
Trait Implementations§
source§impl Extend<Triple> for Graph
impl Extend<Triple> for Graph
source§fn extend<I: IntoIterator<Item = Triple>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Triple>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<'a> Extend<Triple> for GraphViewMut<'a>
impl<'a> Extend<Triple> for GraphViewMut<'a>
source§fn extend<I: IntoIterator<Item = Triple>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = Triple>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<'a> From<&'a Triple> for SubjectRef<'a>
impl<'a> From<&'a Triple> for SubjectRef<'a>
source§impl FromIterator<Triple> for Graph
impl FromIterator<Triple> for Graph
source§impl PartialEq<Triple> for Triple
impl PartialEq<Triple> for Triple
impl Eq for Triple
impl StructuralEq for Triple
impl StructuralPartialEq for Triple
Auto Trait Implementations§
impl RefUnwindSafe for Triple
impl Send for Triple
impl Sync for Triple
impl Unpin for Triple
impl UnwindSafe for Triple
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