Expand description
ODCS Native Data Structures
This module provides native Rust types that model the ODCS (Open Data Contract Standard) v3.1.0 specification accurately. These types preserve the three-level hierarchy:
- Contract Level (
ODCSContract) - Root document with metadata - Schema Level (
SchemaObject) - Tables/views/topics within a contract - Property Level (
Property) - Columns/fields within a schema
§Design Goals
- Zero data loss: Full round-trip import/export without losing metadata
- Multi-table support: Native support for contracts with multiple schema objects
- Nested properties: Proper hierarchical representation for OBJECT and ARRAY types
- Format mapping: Clean mapping from Avro, Protobuf, JSON Schema, OpenAPI via custom properties
- Backwards compatibility: Converters to/from existing
Table/Columntypes
§Example
use data_modelling_core::models::odcs::{ODCSContract, SchemaObject, Property};
// Create a contract with two tables
let contract = ODCSContract::new("ecommerce", "1.0.0")
.with_domain("retail")
.with_status("active")
.with_schema(
SchemaObject::new("orders")
.with_physical_type("table")
.with_properties(vec![
Property::new("id", "integer").with_primary_key(true),
Property::new("customer_id", "integer").with_required(true),
Property::new("total", "number"),
])
)
.with_schema(
SchemaObject::new("order_items")
.with_physical_type("table")
.with_properties(vec![
Property::new("id", "integer").with_primary_key(true),
Property::new("order_id", "integer").with_required(true),
Property::new("product_name", "string"),
])
);
assert_eq!(contract.schema_count(), 2);Modules§
- contract
- ODCSContract type for ODCS native data structures
- converters
- Converters between ODCS native types and legacy Table/Column types
- property
- Property type for ODCS native data structures
- schema
- SchemaObject type for ODCS native data structures
- supporting
- Supporting types for ODCS native data structures
Structs§
- Authoritative
Definition - Authoritative definition reference (ODCS v3.1.0)
- Custom
Property - Custom property for format-specific metadata (ODCS v3.1.0)
- Link
- Link to external resource (ODCS v3.1.0)
- Logical
Type Options - Logical type options for additional type metadata (ODCS v3.1.0)
- ODCS
Contract - ODCSContract - the root data contract document (ODCS v3.1.0)
- Price
- Price information (ODCS v3.1.0)
- Property
- Property - one column in a schema object (ODCS v3.1.0)
- Property
Relationship - Property-level relationship (ODCS v3.1.0)
- Quality
Rule - Quality rule for data validation (ODCS v3.1.0)
- Role
- Role definition (ODCS v3.1.0)
- Schema
Object - SchemaObject - one table/view/topic in a contract (ODCS v3.1.0)
- Schema
Relationship - Schema-level relationship (ODCS v3.1.0)
- Server
- Server configuration (ODCS v3.1.0)
- Service
Level - Service level definition (ODCS v3.1.0)
- Structured
Description - Structured description with multiple fields
- Support
- Support information (ODCS v3.1.0)
- Team
- Team information (ODCS v3.1.0)
- Team
Member - Team member information
- Terms
- Terms and conditions (ODCS v3.1.0)
Enums§
- Description
- Description that can be string or structured object (ODCS v3.1.0)