IDS 1.0 writer and producer constructors (0.1.4) - #12
Merged
Merged
Conversation
`to_string`/`to_writer` write the typed model as IDS 1.0 with the IDS, xs and xsi namespaces and the 1.0 schemaLocation, in the element order ids.xsd requires. Anything the schema rejects, plus an applicability or xs:restriction without facets, is refused with a typed WriteError naming the model path; nothing reaches the output of a refused model. Constructors (`Ids::new` declaring 1.0, `Specification::new`, facet `new`s, `From` conversions) build a document without faking Detected evidence. All 334 buildingSMART test cases satisfy read(write(read(x))) == read(x), writing is a fixed point, and the output validates against the official ids.xsd (scripts/validate-ids.py, with a negative control). Release 0.1.4. Closes #10 Claude-Session: https://claude.ai/code/session_01DiS9fZk8w57TKopxGHYYaK
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.
Closes #10.
What
to_string/to_writerwrite the typed model as IDS 1.0: IDS/xs/xsinamespaces and the 1.0xsi:schemaLocation, XSD element order,simpleValuevsxs:restrictionas theValueholds them,@cardinalityon every requirement facet, optional elements omitted whenNone.WriteError+ model path (e.g.specifications[0]/requirements/facets[2]/@dataType): non-1.0/conflicting version, no specifications, no IFC release, empty or out-of-order applicability,xs:restrictionwithout facets or with unknown base, non-requiredentityrequirement, optionalpartOf,@uriwhere not allowed, invaliddataType/author/date, characters XML 1.0 cannot carry.to_writerwrites nothing for a refused model.Ids::new(declares 1.0, no fakeDetectedevidence),Info::new,Specification::new(optional applicability) +require,Applicability::set_occurrence,Requirement::new/with_occurrence, facetnews,Restriction::enumeration/pattern,FromintoValue/Facet/Requirement.Evidence
The XSD is not vendored;
scripts/validate-ids.pyreads it from the local buildingSMART checkout. Mutations (unescaped\n/\r, dropped optional cardinality, droppedminOccurs) are each caught — see PLAN.md.https://claude.ai/code/session_01DiS9fZk8w57TKopxGHYYaK