Skip to content

IDS import: dataType and value checks; IFC value types; quantity-absence fix - #16

Merged
GeneralPawz merged 7 commits into
mainfrom
feat/ids-data-type
Sep 26, 2026
Merged

GeneralPawz merged 7 commits into
mainfrom
feat/ids-data-type

Conversation

@GeneralPawz

@GeneralPawz GeneralPawz commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #14. Carries the IDS work rebased onto main, plus these commits:

Engine

  • Property::data_type (breaking: new public field): the value's type as the source declares it. The IFC session fills it, upper case.
  • axioval:capability.property-data-type: a required, non-empty property with that declared type.
  • axioval:capability.property-value: values, XML Schema patterns, numeric bounds and lengths, all written as lexical strings and cast to the resolved value's kind.
    • Decimals compare with the IDS tolerance (boundaries inclusive, as the buildingSMART cases require); bounds compare exactly.
    • optional lets absent and null properties pass.
    • Anything that doesn't fit the value is not evaluated, never passed or failed.
    • XSD patterns are translated exactly or refused.
  • IFC adapter: carries every value whose defined type's base is STRING/INTEGER/NUMBER/BOOLEAN (IfcDate, IfcDuration, IfcTimeStamp, IfcCountMeasure, …) with its type. Unit-bearing real measures stay refused (ifc-properties: exact effective-unit resolution (current unit API gives wrong SI scales) openbimrs/ifc#53).

Translator (staging/ids)

  • Property facets with dataType and/or values become property-data-type / property-value rules. Optional facets use optional.
  • Applicability classes are checked against each listed release's schema. The corpus showed that a spec over IFCWALLTYPE silently passed, because sessions only contain IfcObject occurrences. Such classes are now gaps.

Evidence

  • The corpus harness (334 buildingSMART cases): 0 contradictions; caught failures went from 6 to 30.
  • Mutation checks:
    • property-data-type: 4/4 caught.
    • property-value and patterns: 8/8 caught.
  • ./scripts/check.sh passes, including on a local rebase onto current main.

Coverage on the 12 buildingSMART examples

Merge note

main gained a CLI commit after this branch was cut. The only conflict is CHANGELOG.md, where both sides add entries under Unreleased/Added; keep both.

@GeneralPawz GeneralPawz changed the title IDS import with dataType checks; quantity-absence fix IDS import: dataType and value checks; IFC value types; quantity-absence fix Sep 26, 2026
GeneralPawz and others added 7 commits September 26, 2026 14:29
ifc-properties resolves IfcPropertySet members only and skips every other
IfcPropertySetDefinition, but the property service turned its "absent"
into complete absence evidence. A rule requiring quantity `Foo` in
IfcElementQuantity `Foo_Bar` reported a wall as missing it.

A per-session index now records the names of skipped definitions and of
their members (quantities, nested quantities, predefined-set attributes).
An absence one of them could hold is refused as incomplete. The index is
model-wide, so it only ever turns an absence into not evaluated.

Found by running translated buildingSMART IDS test cases through the
adapter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MNzJbWbSLjhFXQKs3LhUm
axioval-ids reads IDS 1.0 through the openbim-ids reader and writes a
definition package and a ruleset. A facet becomes a rule only when an
existing capability decides it as IDS does; everything else is a Gap
naming the part and the reason. An untranslatable applicability facet
leaves its specification without rules, since dropping it would widen the
checked population; untranslatable requirements are dropped one by one.

Today that is entity applicability (literal or enumeration, subclasses
excluded) with value-less, untyped property presence. On the buildingSMART
examples 0 of 38 specifications translate completely; the ranked gaps are
dataType checks, attribute facets, IFC4X3 and existence.

The corpus harness runs the translation through the IFC adapter against
the 334 buildingSMART cases: no translated rule fails a pass case, and
every unflagged fail case is explained by a gap. A probe without dataType
checks found the quantity-absence defect fixed in the previous commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MNzJbWbSLjhFXQKs3LhUm
`Property::data_type` carries the value's type as the source declares it.
The IFC session reports it from `ExactProperty::value_type`, upper case
whatever case the file used. Unreported stays `None` and serializes as
before.

`axioval:capability.property-data-type` requires a non-empty property whose
declared type equals `data_type`. Another type is a finding; a type the
source does not report is not evaluated, never taken to match. It is what
an IDS property facet with a dataType and no value needs.

BREAKING CHANGE: `Property` has a new public field, so struct literals must
set it.

Claude-Session: https://claude.ai/code/session_019MNzJbWbSLjhFXQKs3LhUm
A required, value-less property facet with a dataType now becomes a
property-data-type rule. A dataType on an optional facet stays a gap: it
binds only when the property is present, which no capability checks.

On the buildingSMART examples the translation now writes 11 rules instead
of 3. Most dataType facets also require a value, so value comparison is
now the largest gap (75 facets). The corpus harness still finds no
contradiction with dataType checks live, so the relaxed probe that dropped
them is removed.

Claude-Session: https://claude.ai/code/session_019MNzJbWbSLjhFXQKs3LhUm
`axioval:capability.property-value` checks a resolved value against
lexical constraints cast to its kind: `values`, XML Schema `patterns`
(whole-value, translated exactly or refused), numeric bounds and lengths,
optionally a declared `data_type`, and an `optional` mode in which absent
and null properties pass. Decimals are equal within the IDS tolerance,
boundaries included as the buildingSMART cases require, plus a few ulps
for decimal boundaries that are not binary doubles. Bounds compare
exactly. A literal or constraint that does not fit the value is not
evaluated, never a pass or a violation; quantities wait for units.

The IFC session now carries every value whose defined type's base maps
without loss (STRING, INTEGER, NUMBER, BOOLEAN; IfcReal), so IfcDate,
IfcDuration, IfcTimeStamp and IfcCountMeasure resolve with their declared
type instead of being refused. Unit-bearing real measures stay refused.

Claude-Session: https://claude.ai/code/session_019MNzJbWbSLjhFXQKs3LhUm
A property facet with a value becomes a property-value rule: a simple
value is a one-element `values`, and a restriction's enumeration, patterns,
bounds and lengths map to their parameters. An optional facet sets
`optional`, which also covers an optional dataType. totalDigits,
fractionDigits and empty restrictions are gaps.

The corpus exposed a silent pass: a specification over IFCWALLTYPE
translated completely, but an IFC session makes objects only of IfcObject
occurrences, so its rules selected nothing. Applicability classes are now
checked against each listed release's schema (ifc-schema); a class that is
not an IfcObject there, such as a type object or IFC4's IfcProject, or
that the release does not define, is a gap that skips the specification.

Corpus: 0 contradictions, 30 fail cases caught (was 6). Examples: 28 rules
(was 11); remaining gaps are attributes, existence, IFC4X3 and names given
as restrictions.

Claude-Session: https://claude.ai/code/session_019MNzJbWbSLjhFXQKs3LhUm
@GeneralPawz
GeneralPawz marked this pull request as ready for review September 26, 2026 14:30
@GeneralPawz
GeneralPawz merged commit 6470c25 into main Sep 26, 2026
1 check passed
@GeneralPawz
GeneralPawz deleted the feat/ids-data-type branch September 26, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant