From f9d97a229629fefd6b4446971698a864dc12ad7b Mon Sep 17 00:00:00 2001 From: Tpt Date: Fri, 7 Aug 2020 21:16:30 +0200 Subject: [PATCH] Adds native support for all time related XSD literals --- lib/src/model/literal.rs | 58 +++- lib/src/model/xsd/date_time.rs | 550 ++++++++++++++++++++++++++++++- lib/src/model/xsd/mod.rs | 2 +- lib/src/model/xsd/parser.rs | 55 +++- lib/src/sparql/eval.rs | 172 +++++++--- lib/src/store/binary_encoder.rs | 91 ++++- lib/src/store/numeric_encoder.rs | 117 +++++-- 7 files changed, 943 insertions(+), 102 deletions(-) diff --git a/lib/src/model/literal.rs b/lib/src/model/literal.rs index 5d340a27..ab5bcdb3 100644 --- a/lib/src/model/literal.rs +++ b/lib/src/model/literal.rs @@ -268,11 +268,11 @@ impl From for Literal { } } -impl From for Literal { - fn from(value: Date) -> Self { +impl From for Literal { + fn from(value: DateTime) -> Self { Literal(LiteralContent::TypedLiteral { value: value.to_string(), - datatype: xsd::DATE.into(), + datatype: xsd::DATE_TIME.into(), }) } } @@ -286,11 +286,56 @@ impl From