pub struct GeneralizedQuad<'a> {
    pub subject: GeneralizedTerm<'a>,
    pub predicate: GeneralizedTerm<'a>,
    pub object: GeneralizedTerm<'a>,
    pub graph_name: Option<GeneralizedTerm<'a>>,
}
Expand description

A generalized RDF triple in a RDF dataset.

The default string formatter is returning a SPARQL representation.

use rio_api::model::{GeneralizedQuad, Variable};

assert_eq!(
    "?s ?p ?o .",
    GeneralizedQuad {
        subject: Variable { name: "s" }.into(),
        predicate: Variable { name: "p" }.into(),
        object: Variable { name: "o" }.into(),
        graph_name: None,
    }.to_string()
);

assert_eq!(
    "GRAPH ?g { ?s ?p ?o .}",
    GeneralizedQuad {
        subject: Variable { name: "s" }.into(),
        predicate: Variable { name: "p" }.into(),
        object: Variable { name: "o" }.into(),
        graph_name: Some(Variable { name: "g" }.into()),
    }.to_string()
);

Using it requires to enable the generalized feature.

Fields

subject: GeneralizedTerm<'a>predicate: GeneralizedTerm<'a>object: GeneralizedTerm<'a>graph_name: Option<GeneralizedTerm<'a>>

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The subject of this quad.

The predicate of this quad.

The object of this quad.

The (optional) graph name

Triple adapter owning this quad.

👎 Deprecated since 0.6.3:

Has been renamed to wrap_as_triple

Iterator over the components of this triple

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.