Skip to content

Repository files navigation

OpenBIM.rs LOIN

CI openbim-loin loin docs.rs MSRV

Pure-Rust infrastructure for ISO 7817-3 / EN 17412-3 Level of Information Need (LOIN): machine-readable requirements for geometric information, alphanumeric information, and documentation at a given purpose and milestone.

This repository is the canonical home of the LOIN family in OpenBIM.rs. The integration repository pins it under packages/loin.

Status

The current unreleased line extends the 0.2.0 ISO 23387-backed domain boundary with a strict LOIN XML document codec, explicit namespace migration, and XSD-derived ISO 7817-3 clause-level validation. Validation is intentionally not described as complete W3C XML Schema validation.

Capability Status
2024 and 2022 draft namespace contracts Implemented and tested
Purpose identity/text/imported-reference fields Uses openbim-dt::{Guid, MultiLanguageText, Language, Reference} directly
Per-object specification ConceptType base and ObjectTypeType field Uses openbim-dt::{Concept, ObjectType} directly
Alphanumerical property, quantity-kind, group, reference-document, unit, and dimension content Uses the corresponding owned openbim-dt type contracts directly
Actor, milestone, format, required-document, threshold, detail, datum-registry, and georeferencing fields Typed to the current XSD shape; imported values use canonical DT contracts directly
Compile-time DT ownership and mutation gates Implemented
LOIN XML decoding/encoding Strict bounded XML 1.0 codec implemented
Namespace migration Explicit 2022 ↔ 2024 migration with collision detection and reports
ISO 7817-3 validation XSD-derived LOIN structural, cardinality, enumeration, and scalar checks; not complete XSD validation of imported DT complex types
Lossless LOIN document round trips Lossless-semantic syntax tree; not byte-for-byte

Crates

Package Purpose
openbim-loin Canonical implementation; owns every LOIN item and behavior
loin Pure re-export alias pinned to the exact canonical version

Cargo has dependency renaming but no crates.io package aliases. The loin package defines nothing and re-exports openbim-loin, preserving one canonical API and type identity.

Example

use openbim_loin::{LoinDocument, OutputNamespace, Purpose, dt};

let guid: dt::Guid = "11111111-1111-1111-1111-111111111111".parse()?;
let name = dt::MultiLanguageText::new("en", "Coordination")?;
let purpose = Purpose::new(guid, name);
assert_eq!(purpose.name().unwrap().text(), "Coordination");

let xml = r#"<l:LevelOfInformationNeed xmlns:l="https://iso.org/2024/LOIN" />"#;
let document = LoinDocument::parse(xml)?;
let encoded = document.to_xml_string(OutputNamespace::Preserve)?;
assert_eq!(LoinDocument::parse(&encoded)?.root(), document.root());
# Ok::<(), Box<dyn std::error::Error>>(())

openbim-loin::dt re-exports the exact openbim-dt contract version consumed by this release. Do not create lookalike GUID, text, reference, or property types in LOIN clients.

Install

Use either package name:

cargo add openbim-loin@0.3
# or
cargo add loin@0.3

Do not depend on both names directly. The alias already brings in the canonical package at an exact version.

Architecture

Drafts use both https://iso.org/2022/LOIN and https://iso.org/2024/LOIN. The codec preserves the observed namespace and every write requires an explicit preserve-or-target policy. Migration rewrites only LOIN bindings and fails closed on expanded-attribute collisions.

Standards material

No ISO, DIN, CEN, or other restricted standards artifact is tracked or packaged. Locally available references belong under ignored references/. A fixture may enter version control only when its redistribution terms are known and compatible with this repository.

Development

Requires Rust 1.88 or newer and Python 3.10 or newer.

git clone https://github.com/openbimrs/loin.git
cd loin
./scripts/gate.sh

The gate checks formatting, build, tests, Clippy, rustdoc, DT contract ownership, semantic alias purity, isolated mutations, and canonical crates.io package verification using command exit codes. The alias package is verified after its exact canonical version is registry-visible.

Contributing

See CONTRIBUTING.md. Capability work must add executable evidence and update the status table without overstating coverage.

License

AGPL-3.0-or-later — see LICENSE.

About

Pure-Rust ISO 7817-3 / EN 17412-3 Level of Information Need contracts for OpenBIM.rs.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages