| Crates.io | sdc4-validator |
| lib.rs | sdc4-validator |
| version | 0.1.0 |
| created_at | 2025-11-04 13:29:26.392018+00 |
| updated_at | 2025-11-04 13:29:26.392018+00 |
| description | High-performance XML Schema validator with Semantic Data Charter (SDC4) support |
| homepage | https://github.com/SemanticDataCharter/sdcvalidatorRust |
| repository | https://github.com/SemanticDataCharter/sdcvalidatorRust |
| max_upload_size | |
| id | 1916260 |
| size | 68,001 |
A high-performance XML Schema validator with Semantic Data Charter (SDC4) support, implemented in Rust.
Developed and maintained by Axius SDC, Inc. in support of the Semantic Data Charter community.
sdc4-validator is a Rust implementation of the SDC4 validation framework, providing fast and memory-efficient validation of XML documents against XML Schema definitions with specialized support for healthcare data quality management through the Semantic Data Charter specification.
Unlike traditional validators that reject invalid data, sdc4-validator implements a "quarantine-and-tag" pattern that preserves problematic data while injecting ISO 21090-based ExceptionalValue elements. This approach enables comprehensive data quality assessment without data loss.
⚠️ PLACEHOLDER RELEASE (v0.1.0) - NOT FUNCTIONAL
This package has been published to crates.io to reserve the name. The full implementation is scheduled for Q2 2026 and will be released as v4.0.0.
This repository serves as a placeholder and design specification for the future Rust implementation. For production use today, please see:
The package is published on crates.io as a placeholder. Do not use v0.1.x in production.
Once the full implementation is released (v4.0.0), installation will be:
cargo install sdc4-validator
Or add to your Cargo.toml:
[dependencies]
sdc4-validator = "4.0"
# Validate an XML file against a schema
sdc4-validate --schema schema.xsd --input data.xml
# Enable recovery mode (inject ExceptionalValues)
sdc4-validate --schema schema.xsd --input data.xml --recovery
# Output validation report
sdc4-validate --schema schema.xsd --input data.xml --output report.json
use sdc4_validator::{Validator, ValidationOptions};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create validator with schema
let validator = Validator::from_file("schema.xsd")?;
// Validate XML document
let xml = std::fs::read_to_string("data.xml")?;
let result = validator.validate(&xml)?;
if result.is_valid() {
println!("Document is valid!");
} else {
println!("Validation errors: {:?}", result.errors());
}
Ok(())
}
use sdc4_validator::{Validator, RecoveryOptions};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let validator = Validator::from_file("schema.xsd")?;
let xml = std::fs::read_to_string("data.xml")?;
// Enable recovery mode to inject ExceptionalValues
let options = RecoveryOptions::default();
let result = validator.validate_with_recovery(&xml, options)?;
// Get modified XML with ExceptionalValues injected
let recovered_xml = result.recovered_xml();
std::fs::write("data_recovered.xml", recovered_xml)?;
Ok(())
}
The validator will be built on these core components:
The validator will support all ISO 21090 exceptional value types:
| Type | Code | Description |
|---|---|---|
| No Information | NI |
No information available |
| Masked | MSK |
Information present but masked for privacy |
| Not Applicable | NA |
Not applicable in this context |
| Unknown | UNK |
Information was sought but not found |
| Asked But Unknown | ASKU |
Information was asked but is unknown |
| Temporarily Unavailable | NAV |
Temporarily unavailable |
| Not Asked | NASK |
Not asked or assessed |
| Sufficient Quantity | QS |
Sufficient quantity recorded |
| Trace | TRC |
Trace amounts detected |
| Negative Infinity | NINF |
Negative infinity |
| Positive Infinity | PINF |
Positive infinity |
| Other | OTH |
Other reason |
We welcome contributions! Please see CONTRIBUTING.md for guidelines on how to participate in this project.
For security concerns or vulnerability reports, please see our Security Policy.
This validator is part of the Semantic Data Charter ecosystem:
This project is licensed under the MIT License - see the LICENSE file for details.
"Semantic Data Charter" and "SDC4" are trademarks of Axius SDC, Inc.
This project is developed and maintained by Axius SDC, Inc. in support of the Semantic Data Charter community.
"Semantic Data Charter" and "SDC4" are trademarks of Axius SDC, Inc.
Built upon 15+ years of research and development in healthcare data standards and semantic validation. Implements concepts from international standards including W3C XML Schema, ISO 21090, HL7, and ODM.