sensorml 0.1.5

SensorML parser and serializer supporting XML and JSON formats
Documentation
# SensorML ๐Ÿ›ฐ๏ธ

[![Crates.io](https://img.shields.io/crates/v/sensorml.svg)](https://crates.io/crates/sensorml)
[![Docs.rs](https://img.shields.io/docsrs/sensorml)](https://docs.rs/sensorml)
![Coverage](https://img.shields.io/badge/coverage-91.67%25-green)
![Mutants](https://img.shields.io/badge/mutants-6%2F6%20caught-success)

A minimalist, testable Rust crate for parsing and serializing SensorML documents in XML and JSON. Designed for integration with mapping layers, adapters, and future transformation pipelines.

## โœจ Features

- Parse SensorML from XML and JSON  
- Serialize SensorML to XML and JSON  
- Validate sensor references and ISO 8601 timestamps  
- High test coverage and mutation resistance  
- Depends only on `serde`, `quick-xml`, and `chrono`

## ๐Ÿ“ฆ Installation

Add to your `Cargo.toml`:

```toml
sensorml = "0.1"
```

## ๐Ÿ“š Example

```rust
use sensorml::model::{SensorMLDocument, Sensor, Observation};
use sensorml::format::json;

let doc = SensorMLDocument {
    sensors: vec![Sensor {
        id: "sensor-1".into(),
        sensor_type: "temperature".into(),
        unit: "Celsius".into(),
        description: Some("Outdoor sensor".into()),
    }],
    observations: vec![Observation {
        sensor_id: "sensor-1".into(),
        timestamp: "2025-10-11T10:00:00Z".into(),
        value: "18.5".into(),
    }],
};

let json = json::serialize_to_json(&doc)?;
let parsed = json::parse_from_json(&json)?;
parsed.validate()?; // checks sensor references and timestamp format
```

## ๐Ÿงช Testing

```bash
cargo test
cargo tarpaulin
cargo mutants
```

## ๐Ÿ“„ License

MIT ยฉ 2025 Egon Kastelijn