An implementation of some XSD datatypes for SPARQL implementations

2 releases

0.1.1 Feb 23, 2023
0.1.0 Jan 18, 2023

#370 in Database interfaces

Download history 101/week @ 2023-01-17 39/week @ 2023-01-24 43/week @ 2023-01-31 43/week @ 2023-02-07 65/week @ 2023-02-14 138/week @ 2023-02-21 79/week @ 2023-02-28 89/week @ 2023-03-07 84/week @ 2023-03-14 41/week @ 2023-03-21

339 downloads per month
Used in 5 crates (2 directly)




Latest Version Released API docs Crates.io downloads actions status Gitter

oxsdatatypes is an implementation of some XML Schema Definition Language Datatypes. Its main aim is to ease the implementation of SPARQL and XPath.

Usage example:

use std::str::FromStr;
use oxsdatatypes::Decimal;

assert!(Decimal::from_str("22.2").unwrap() > Decimal::from_str("21").unwrap());

Each datatype is represented by a Rust struct.

Each datatype provides:

  • FromStr implementation to parse a datatype string serialization following its lexical mapping.
  • Display implementation to serialize a datatype following its canonical mapping.
  • is_identical_with method following its identity relation.
  • PartialEq, and Eq if possible, implementations following its equality relation.
  • PartialOrd, and Ord if possible, implementations following its order relation.
  • From and TryFrom implementations to implement XPath casting.
  • Various methods implementing XPath functions.
  • from_be_bytes and to_be_bytes methods for serialization.


This project is licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or <http://www.apache.org/licenses/LICENSE-2.0>)
  • MIT license (LICENSE-MIT or <http://opensource.org/licenses/MIT>)

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Oxigraph by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~23K SLoC