om2 0.1.9

A set of classes generated from the OM2 RDF schema (mainly Unit)
Documentation

OM2

This crate is a loose attempt at creating a Unit struct based off of the units available in the OM2 ontology. It also exports Measure and NumericUnion classes.

All structs/enums exported are (de)serializable via Serde.

use om2::{Unit, Measure, NumericUnion};
let measure = Measure::builder()
    .has_unit(Unit::Hour)
    .has_numerical_value(NumericUnion::Integer(7))
    .build().unwrap();
assert_eq!(measure.has_unit(), &Unit::Hour);
assert_eq!(measure.has_numerical_value(), &NumericUnion::Integer(7));