Struct rio_api::model::Triple[][src]

pub struct Triple<'a> {
    pub subject: NamedOrBlankNode<'a>,
    pub predicate: NamedNode<'a>,
    pub object: Term<'a>,
}

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: NamedOrBlankNode<'a>predicate: NamedNode<'a>object: Term<'a>

Trait Implementations

impl<'a> Clone for Triple<'a>[src]

impl<'a> Debug for Triple<'a>[src]

impl<'a> Display for Triple<'a>[src]

impl<'a> Eq for Triple<'a>[src]

impl<'a> Hash for Triple<'a>[src]

impl<'a> PartialEq<Triple<'a>> for Triple<'a>[src]

impl<'a> StructuralEq for Triple<'a>[src]

impl<'a> StructuralPartialEq for Triple<'a>[src]

impl<'a> TryFrom<GeneralizedQuad<'a>> for Triple<'a>[src]

type Error = StrictRdfError

The type returned in the event of a conversion error.

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.