GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - openbimrs/dt: Pure-Rust ISO 23387 data-template contracts for OpenBIM.rs

BranchesTags
Open more actions menu

Latest commit

 

History

33 Commits
33 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
LICENSES
LICENSES
 
 
docs
docs
 
 
openbim-dt
openbim-dt
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
HERMES.md
HERMES.md
 
 
LICENSE
LICENSE
 
 
LICENSING.md
LICENSING.md
 
 
NOTICE
NOTICE
 
 
PLAN-owned-codec.md
PLAN-owned-codec.md
 
 
README.md
README.md
 
 
ROADMAP.md
ROADMAP.md
 
 
mkdocs.yml
mkdocs.yml
 
 
rust-toolchain.toml
rust-toolchain.toml
 
 

Repository files navigation

OpenBIM.rs Data Templates

CI Documentation crates.io docs.rs MSRV

Pure-Rust ISO 23387 edition 2 data-template contracts and a bounded, namespace-aware XML codec. The crate models identifiers, multilingual text, references, data-type lexemes, concept cores, and the standard's global element families while retaining XML content it does not yet understand.

This repository is the canonical DT family repository in OpenBIM.rs. The superproject records an exact child revision at packages/dt.

Documentation

  • Documentation home
  • Rust API reference
  • Architecture
  • Roadmap
  • Changelog

Capability status

The 0.3 source line is an implemented codec and contract layer, not a claim of complete ISO conformance.

Capability Status
ISO 23387 edition 2 and known draft namespace identities Implemented and unit-tested
GUID, date-time, language/decimal, any-URI/reference, multilingual text, rational, unit-scale/base, data-type/value-list, and reusable concept contracts Implemented
Owned complex-type contracts Subject, object type, property, group, quantity kind, reference document, dimension, unit, and data template, holding every attribute and child the schema declares
Owned-type XML codec Implemented; to_element/from_element per owned type, schema-ordered output, fail-closed decoding with CodecError
Bounded namespace-aware XML 1.0 parser Implemented; strict well-formedness and namespace checks precede event indexing
XML writer Implemented; semantic round trips retain element/attribute order, namespaces, comments, PI, CDATA, and unknown content
Typed global-root views Implemented for Library, DataTemplate, ObjectType, GroupOfProperties, and Property
Typed local Library-child views Implemented for Unit, Dimension, QuantityKind, and ReferenceDocument; these are not accepted as document roots
Structured built-in diagnostics Implemented subset; parsing remains separate from validation
XML Schema validation of the ISO 23387 element grammar Implemented; Document::validate_schema checks global roots, sequence order, cardinality, choices, attribute presence, and datatype facets
Full clause-level ISO conformance Not implemented; cross-document reference resolution and prose clauses are out of scope
Byte-identical XML round trips Implemented; Document::to_xml_string_exact reproduces the parsed bytes exactly and fails closed without retained source
Semantic XML round trips Implemented; Document::to_xml_string preserves content but may normalize equivalent syntax
ISO 23386 governance workflow Not implemented
ISO 12006-3 mapping Not implemented
bSDD adapter Not implemented

The parser has explicit byte, depth, node, and per-element attribute budgets. roxmltree first rejects malformed XML 1.0, duplicate expanded attributes, illegal namespace bindings, DTD declarations, invalid characters, undeclared entities and prefixes, and malformed qualified names. quick-xml then builds the retention tree. Unknown but well-formed XML is retained rather than silently discarded. Validation reports stable categories and paths but does not load or redistribute the ISO XSD.

Why DT is separate from LOIN

ISO 7817-3 LOIN imports ISO 23387 types, but LOIN does not own them. Data-template authoring, dictionary tooling, and other consumers need the same lower-level contracts without depending on LOIN.

roxmltree + quick-xml  <-  openbim-dt  <-  openbim-loin / dictionary clients

The dependency never points from DT back to LOIN.

Install

cargo add openbim-dt

Parse, inspect, and validate

use openbim_dt::{Document, ElementKind, Severity};

let xml = r#"<dt:Library
  xmlns:dt="https://standards.iso.org/iso/23387/ed-2/en/"
  dt:GUID="11111111-1111-1111-1111-111111111111"/>"#;
let document = Document::parse(xml)?;
assert_eq!(document.root_kind(), Some(ElementKind::Library));
assert!(document
    .validate()
    .iter()
    .all(|diagnostic| diagnostic.severity != Severity::Error));
let rewritten = document.to_xml_string()?;
# Ok::<(), Box<dyn std::error::Error>>(())

CLI

openbim-dt inspect data-template.xml
openbim-dt validate data-template.xml
openbim-dt validate-schema data-template.xml
openbim-dt rewrite input.xml output.xml
openbim-dt rewrite-exact input.xml output.xml

validate returns exit code 2 when semantic errors are reported, and validate-schema does the same for schema violations. Parsing and I/O failures return exit code 1. rewrite emits the semantic serialization; rewrite-exact reproduces the input bytes exactly. Both use an OS-random, exclusively created same-directory temporary file followed by an atomic rename.

Standards and fixtures

No ISO, DIN, or CEN document, XSD, or annex example is distributed by this repository, its crate, or its documentation site. Legally accessed references belong under the ignored local references/ directory.

Public tests use an original synthetic fixture whose provenance and MIT redistribution terms are recorded beside it. Restricted Annex examples are never copied into tests/fixtures/.

Development

Requires Rust 1.99 or newer.

git clone https://github.com/openbimrs/dt.git
cd dt
./scripts/gate.sh
python -m pip install -r docs/requirements.txt
./scripts/build-docs.sh

The gate builds every target, runs tests and Clippy, generates rustdoc, executes mutation probes, packages the crate, and fails closed on restricted-material leakage.

Contributing

See CONTRIBUTING.md. Capability claims require executable evidence and must distinguish structural checks from full schema or standard conformance.

License

MIT — see LICENSE.

About

Pure-Rust ISO 23387 data-template contracts for OpenBIM.rs

openbimrs.github.io/dt/

Topics

aecbimdata-templatesiso-23387openbimrust

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.