pub enum Query {
Select {
dataset: Option<QueryDataset>,
pattern: GraphPattern,
base_iri: Option<String>,
},
Construct {
template: Vec<TriplePattern>,
dataset: Option<QueryDataset>,
pattern: GraphPattern,
base_iri: Option<String>,
},
Describe {
dataset: Option<QueryDataset>,
pattern: GraphPattern,
base_iri: Option<String>,
},
Ask {
dataset: Option<QueryDataset>,
pattern: GraphPattern,
base_iri: Option<String>,
},
}
Expand description
A parsed SPARQL query.
Variants§
Select
Construct
Fields
§
template: Vec<TriplePattern>
The query construction template.
§
dataset: Option<QueryDataset>
§
pattern: GraphPattern
The query selection graph pattern.
Describe
Ask
ASK.
Implementations§
Source§impl Query
impl Query
Sourcepub fn select(pattern: GraphPattern) -> Self
pub fn select(pattern: GraphPattern) -> Self
Creates a new SELECT query
Sourcepub fn construct(template: Vec<TriplePattern>, pattern: GraphPattern) -> Self
pub fn construct(template: Vec<TriplePattern>, pattern: GraphPattern) -> Self
Creates a new CONSTRUCT query
Sourcepub fn ask(pattern: GraphPattern) -> Self
pub fn ask(pattern: GraphPattern) -> Self
Creates a new ASK query
Sourcepub fn describe(pattern: GraphPattern) -> Self
pub fn describe(pattern: GraphPattern) -> Self
Creates a new DESCRIBE query
Sourcepub fn dataset(&self) -> Option<&QueryDataset>
pub fn dataset(&self) -> Option<&QueryDataset>
Returns the dataset specification for this query
Sourcepub fn dataset_mut(&mut self) -> Option<&mut QueryDataset>
pub fn dataset_mut(&mut self) -> Option<&mut QueryDataset>
Returns a mutable reference to the dataset specification for this query
Sourcepub fn pattern(&self) -> &GraphPattern
pub fn pattern(&self) -> &GraphPattern
Returns the graph pattern for this query
Sourcepub fn with_base_iri(self, base_iri: impl Into<String>) -> Self
pub fn with_base_iri(self, base_iri: impl Into<String>) -> Self
Sets the base IRI for this query
Sourcepub fn with_dataset(self, dataset: QueryDataset) -> Self
pub fn with_dataset(self, dataset: QueryDataset) -> Self
Sets the dataset for this query
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Query
impl<'de> Deserialize<'de> for Query
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Query
impl StructuralPartialEq for Query
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnwindSafe for Query
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.