feat(read): read IDS 1.0 documents into a typed model - #5
Merged
Merged
Conversation
Adds `read::from_str`/`from_slice` and the `model` types. A lenient first pass collects version signals and the `xsi:schemaLocation` declaration and refuses drafts and contradictions with their evidence; a strict second pass follows ids.xsd 1.0.0, applying schema defaults explicitly (absent cardinality is required, absent minOccurs/maxOccurs is 1) and keeping requirement facets in document order. All 334 buildingSMART test cases read as declared 1.0, and a differential dump against IfcOpenShell ifctester 0.8.5 shows no differences. The corpus (CC BY-ND 4.0) is read from IDS_TEST_CASES, not vendored. Closes #1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MNzJbWbSLjhFXQKs3LhUm
A base in the XML Schema namespace was accepted whatever its name, so base="xs:invalid" read as a restriction. Only the XML Schema 1.0 built-in simple types, the revision ids.xsd imports, are now accepted. Found by reading the invalid fixtures of an independent IDS implementation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019MNzJbWbSLjhFXQKs3LhUm
This was referenced Sep 26, 2026
GeneralPawz
marked this pull request as ready for review
September 27, 2026 19:00
GeneralPawz
added a commit
to axioval/engine
that referenced
this pull request
Sep 28, 2026
The importer wrote its rule definitions' parameters by hand, so the new rule and folder gates, ruleset classifications and property-requirements columns left it uncompilable and its definitions refused by the compiler. It now reads each definition's parameters and table columns from the trusted capability it selects, so a new optional parameter or column no longer leaves it behind. The openbim-ids reader merged (openbimrs/ids#5) and its branch is gone; the dependency is pinned to the merge commit on main until a release carries it. Refs #116 Claude-Session: https://claude.ai/code/session_01J42ceJFik9GZt6cjZSWzuR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements
IDS-PARSE(#1).read::from_str/read::from_slice→model::Ids, or aReadErrorwith line and column.xsi:schemaLocation→detect_version. Drafts and header/shape contradictions are refused withErrorKind::UnsupportedVersion(Detected<_>). A document that declares nothing and shows no revision-specific shape is read as 1.0 only if it fully satisfies the 1.0 schema, and reportsDetected::Inferred.ids.xsd1.0.0 strictly. Schema defaults are explicit (absent@cardinality→ required, absentminOccurs/maxOccurs→ 1). Requirement facets keep document order.@ifcVersionis split as anxs:list.IFCRELVOIDSELEMENT IFCRELFILLSELEMENTstays one token.base(prefix resolved) and every facet in lexical form.xs:whiteSpace, inlinexs:simpleTypeandxs:assertionare refused as unsupported rather than dropped.Evidence
IDS_TEST_CASES=… cargo test --test corpus -- --ignored). The corpus is CC BY-ND 4.0, so it is not vendored.PLAN.md).Correction to #1's definition of done
The corpus
invalid-*cases are schema-valid IDS whose content contradicts IFC (e.g.42.0for an integer attribute). Rejecting them needs the IFC schema, so that belongs toIDS-AUDIT. The reader must read them, and does.