Makes xsd:dateTime work with STR function

pull/10/head
Tpt 6 years ago
parent c67ab460d0
commit 52463b59db
  1. 13
      lib/src/sparql/eval.rs

@ -371,7 +371,7 @@ impl<S: EncodedQuadsStore> SimpleEvaluator<S> {
self.eval_expression(b, tuple)?, self.eval_expression(b, tuple)?,
)? { )? {
Ordering::Greater | Ordering::Equal => true, Ordering::Greater | Ordering::Equal => true,
_ => false, Ordering::Less => false,
}.into(), }.into(),
), ),
PlanExpression::Lower(a, b) => Some( PlanExpression::Lower(a, b) => Some(
@ -387,7 +387,7 @@ impl<S: EncodedQuadsStore> SimpleEvaluator<S> {
self.eval_expression(b, tuple)?, self.eval_expression(b, tuple)?,
)? { )? {
Ordering::Less | Ordering::Equal => true, Ordering::Less | Ordering::Equal => true,
_ => false, Ordering::Greater => false,
}.into(), }.into(),
), ),
PlanExpression::Add(a, b) => Some(match self.parse_numeric_operands(a, b, tuple)? { PlanExpression::Add(a, b) => Some(match self.parse_numeric_operands(a, b, tuple)? {
@ -617,7 +617,9 @@ impl<S: EncodedQuadsStore> SimpleEvaluator<S> {
fn to_string_id(&self, term: EncodedTerm) -> Option<u64> { fn to_string_id(&self, term: EncodedTerm) -> Option<u64> {
match term { match term {
EncodedTerm::DefaultGraph {} => None,
EncodedTerm::NamedNode { iri_id } => Some(iri_id), EncodedTerm::NamedNode { iri_id } => Some(iri_id),
EncodedTerm::BlankNode(_) => None,
EncodedTerm::SimpleLiteral { value_id } EncodedTerm::SimpleLiteral { value_id }
| EncodedTerm::StringLiteral { value_id } | EncodedTerm::StringLiteral { value_id }
| EncodedTerm::LangStringLiteral { value_id, .. } | EncodedTerm::LangStringLiteral { value_id, .. }
@ -638,7 +640,12 @@ impl<S: EncodedQuadsStore> SimpleEvaluator<S> {
EncodedTerm::DecimalLiteral(value) => { EncodedTerm::DecimalLiteral(value) => {
self.store.insert_bytes(value.to_string().as_bytes()).ok() self.store.insert_bytes(value.to_string().as_bytes()).ok()
} }
_ => None, EncodedTerm::DateTime(value) => {
self.store.insert_bytes(value.to_string().as_bytes()).ok()
}
EncodedTerm::NaiveDateTime(value) => {
self.store.insert_bytes(value.to_string().as_bytes()).ok()
}
} }
} }

Loading…
Cancel
Save