-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facets review #240
Facets review #240
Conversation
- The schema is changed to be more expressive with capitalization - The documentation better expresses the capitalization of datatypes - Improved units page
- [x] improved documentation - [x] change the schema to move MinMaxOccurs to applicability - [x] update audit tool - [ ] correct test cases appropriately
Changed to an expressive enum, where alreadu applicable. Type does not allow for prohibitions, as we prefer to use enumeration to restrain the allowed values. Cardinality of attributes is to be discussed in a separate issue buildingSMART#144
We have still to discuss Optional cardinality for facets. OMA uses it for classification and property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked through the documentation changes, since the text seems very WIP today.
Spelling fixed. Co-authored-by: Stefan Jaud <59165496+pjanck@users.noreply.github.com>
Indeed that is more of a set of working notes that will need to be distributed in the rest of the documentation. |
1. If a type is defined via the IfcRelDefinesByType relation | ||
the PredefinedType of the type overrides the entity's PredefinedType (which should be empty according to IFC documentation) | ||
1.1 if Type's PredefinedType is .USERDEFINED. | ||
-> IfcElementType.ElementType | ||
-> .USERDEFINED. | ||
1.2 else Type's PredefinedType (if not null) | ||
-> Type's - PredefinedType | ||
2. the value of the direct attribute PredefinedType | ||
2.1 if the attribute PredefinedType == .USERDEFINED. then the value of the attribute IfcElement/ObjectType is used | ||
2.2 else entity's PredefinedType (if not null) | ||
3. TODO document the same for ElementType and ProcessType | ||
|
||
TODO: check if the validation service of IFC prevents entity level types to be defined when type's type is specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rationale for this change to the way entity facet's PredefinedType behaviour makes total sense. However it may be worth considering the implications for implementors (both during spec creation and model validation). Particularly for 'early-bound' IFC implementations I can see challenges when traversing from an Element (generally of a known type) to any defining ElementType's PredefinedType enum attribute. The issue being you don't know what Type you'll get at runtime, which provides the enum Type.
Take as an example: an IDS specifier can presumably define an entity facet as:
Name: IFCFLOWTERMINAL
SubType: BATH (the enum from IfcSanitaryTerminalTypeEnum)
(Obviously in IFC4 onward you might be able to use Name = IfcSanitaryTerminal, but not in 2x3)
So two issues:
- The design interface (and IDS validator) would need to prompt/allow all appropriate enum values for a FlowTerminal - from all potential DefiningTypes
- In order to query that PredefinedType value on the ElementType at runtime you've some casting and coercion to do, and a runtime performance hit.
All doable, but it would be a lot more efficient and easier to implement if there were some means to specify the Type as part of the entity. It would also be more expressive: you could select all sanitary equipment in IFC2x3.
I guess the question is: are we considering these kinds of complex uses of PredefinedType/SubType for IDS 1.0? Entity Facets seem most often used on applicability rather than requirements so it's important these kinds of query predicates can be employed consistently across implementations or we'll be testing different sets of applicable items.
I need to require that an IfcElement MUST have an IfcElementType.
* Is requiring an attribute ‘PredefinedType’ with pattern restriction ‘.*’ the way to do this? (preferred)
* Is requiring an entity ‘subType’ with pattern restriction ‘.*’ the way to do this?
Regards
|
Nick, I'm not sure either would work reliably - any validator would presumably only flag up issues where there was a PredefinedType attribute value on the ElementType but not on the Element. So as a requirement it might work for my IfcFlowTerminal=>IsTypedBy=>IfcSanitaryTerminalType example above (any value must come from the Type). And it would work for say IfcBeam and IfcBeamType in IFC2x3 but not in later schemas since IfcBeam.PredefinedType got introduced in Ifc4. And wouldn't work in any schema for IfcPile since PredefinedType existed on both Element and Type since IFC2x3. Probably needs a separate issue if there's not one already... Andy |
May check this issue (related to IFC2x3 types): #116 |
Hi Claudio, |
Improved documentation in the XSD file with documentation and minor consistency changes. Updated all testcases to latest schema. Ids testcases are generated from the documentation/testcases/scripts.md via the SchemaProject folder. The next step is to integrate this feature in the automated targets
The entity name in the restriction test case "fail-an_enumeration_matches_case_sensitively_1_3.ids" is in pascal case format
|
Classification test cases:
The related ifc files contain two IfcWalls but only one classified: the ids files fail due to the presence of an unclassified wall |
- completed information on Development files - documentation: dataType adjusted to valid scenarios - testcases adjusted for audit: - attribute/pass-an_optional_facet_always_passes_regardless_of_outcome removed - improved empty classification systems (requiring at least a letter). - improved entity constraints - improved material tests - improved partof tests
Hi @gverduci, thanks. I think I spotted that too while revising the schema. It should be solved now. |
A new class of tests (invalid) has been added, to mark tests that should fail IFC verification and and are also invalid for the audit tool.
Hi Claudio, This file contains an optional requirement with system and value, and the related ifc file contains an IFCWALL without classifications. For the optional case with system and value, the facet-configuration.md file says: Is it correct that this test fails? |
the file "material/fail-an_optional_material_fails_if_no_value_matches.ids" contains a title and a specification name with a different meaning than the file name |
- propertyType.name renamed to baseName - EntityType.subType renamed to predefinedType - Improved documentation
Hi @gverduci, with regards to your comments:
I think the origina IFC had a problem, it attached the classification to the project rather than the wall, it should now be ok.
I've changed the code so that we are notified of the title mismatches on testcase regeneration, see 9d37660. Thanks for spotting these. |
Hi @CBenghi, when regenerating the testcases (which I assume closes out #192 ?) were you able to fix the invalid IFC for There's a whole bunch of open issues for this one bad test as every implementor seems to hit it: e.g. #108, #194, #225 There's a dead simple fix: change the type of one of the entities so it doesn't get affected by prior test data. |
<ids:specification ifcVersion="IFC4" name="Beglazing" description="Glazing in a window" minOccurs="0" maxOccurs="unbounded"> | ||
<ids:applicability> | ||
<ids:specification ifcVersion="IFC4" name="Beglazing" description="Glazing in a window" > | ||
<ids:applicability minOccurs="0" maxOccurs="unbounded"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have never understood what minOccurs
and maxOccurs
mean in an applicability
statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a long debate about the meaning of min/maxOccurs settings in specification
. The decision from an engineering point of view was to ask for a specific number of instances that can be selected by applicability
where ALL instances must fulfill specified requirements. This is the reason to move from specification
to applicability
, because this cardinality restriction is purely for number of instances that fulfill the applicability
statement.
In contrast to that, we did not see a use case asking for a specific number of instances that are selected by applicability AND fulfill specified requirements.
Anyhow, most generic EIRs will use min=0 and max=unbounded, meaning that ALL instances fulfilling the applicability settings should fulfill our requirements. There are only few examples where other settings make sense and most of them seem to be addressed either in the IFC schema (1 instance of IfcProject) or implementer agreements (1 instance of IfcSite/IfcBuilding). Other examples like "I need 10 office rooms in my building" are more project specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect minOccurs=1
to be common too? i.e. "There must be at least one space in my building [and they should all satify requirement ...]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that minOccurs=1
can be a useful requirement. It basically defines that some types of objects are expected to be in the model. So, it is an easy way to check if something is missing. However, it comes with the limitation that you do not check that all rooms are really modelled by an IfcSpace object.
Instead of doing such limited minOccurs=1
checks I would prefer something like checking through relationships, e.g. inner walls must be a boundary of 2 spaces, outer walls must be a boundary of 1 space, etc.
Documentation/units.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and seems to be the complete list!
If we want to focus on measurements that should be converted, I think we can reduce the list (essentially all measurements without a link to SI units).
No need for conversion or unclear conversion process:
- IFCCONTEXTDEPENDENTMEASURE
- IFCCOUNTMEASURE
- IFCDESCRIPTIVEMEASURE
- IFCNUMERICMEASURE
- IFCPHMEASURE
Other questionable measurements are:
- IFCNORMALISEDRATIOMEASURE
- IFCPOSITIVERATIOMEASURE
- IFCRATIOMEASURE
- IFCMONETARYMEASURE (no fixed conversion rate)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I've forgot that I left the full list.
I'll improve the file document.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Why do you think there's unclear conversion for ph?
I don't think it's going to need any conversion, and be in the range {0.0 <= SELF <= 14.0}
But there are other such cases in the documentation for completeness.
I think we will have to add a testcases suite for the entire set of measures.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you think there's unclear conversion for ph? I don't think it's going to need any conversion, and be in the range {0.0 <= SELF <= 14.0} But there are other such cases in the documentation for completeness.
I think we will have to add a testcases suite for the entire set of measures.
That was my point, everything what does not need a conversion does not have to be included in the list. If always between 0 and 14, we can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering if we should differentiate between three categories:
- values that may need a conversion before comparison (everything that is defined by SI-units)
- values that do not need a conversion as there is only one way to represent the data (ph, count, numeric and ratio)
- values that shall not be used for comparison as there is no standardised way for representing them (monetary, context dependent, descriptive)
To be safe, we can exclude category 3 from value checks (except for existance/not existance).
- removed units that never require conversion - corrected unit capitalization according to SI - consistent spacing in Unit symbols
Hi @andyward, |
Sure, I'll see if we can integrate the tests from this PR. Last I checked we pass all the current testcases except 1-2 or esoteric edge cases (ie6 tolerance and Predefined Properties are the only 2 I'm aware of) - so suggest we get it all (regression) tested on 0.9.7, and then can look at additional tests. Is there an XIDS update with the latest IDS schema? Should be able to help with the IFC generation. That said I think Dion's testcases cover most of the material cases already. Multi-schema would be good to test. I also think Applicability needs some test cases (Currently the tests focus on Requirement). There's a whole bunch of scenarios with restrictions on applicability where it would be good to have a standard set of test cases for. |
* Preparing development branch the next version of the schema is prepared, upon which every schema change will be developed. Only schema versions merged int the main branch will stay unchanged. Schemas in development can be modified until merged into main. * Prepared change to allow multiple material facets See #211 * Fix: maxOccurs of restriction within idsValue The value has been limited to 1, this was a mistake in the schema definition, it was alsways interpreted as 1 by the implementers. * Facets review (#240) * Improving clarify of datatype and Property facet - The schema is changed to be more expressive with capitalization - The documentation better expresses the capitalization of datatypes - Improved units page * Working on #203 - [x] improved documentation - [x] change the schema to move MinMaxOccurs to applicability - [x] update audit tool - [ ] correct test cases appropriately * Added OMA back with fixes. * Updated tooling * Updated tooling * Improved specification documentation * Changed the cardinality of requirement facets Changed to an expressive enum, where alreadu applicable. Type does not allow for prohibitions, as we prefer to use enumeration to restrain the allowed values. Cardinality of attributes is to be discussed in a separate issue #144 * Modified development files per call agreement We have still to discuss Optional cardinality for facets. OMA uses it for classification and property. * Further work on the specification document page. * Documentation proposal for all facet configuratitions. * All schema changes previously discussed. * Further fixes discussed in the call today. * Revised Development files. * Update Development/IDS_random_example.ids Spelling fixed. Co-authored-by: Stefan Jaud <59165496+pjanck@users.noreply.github.com> * Schema change, cardinality made CamelCase. * doc changes. * Added testcases generation and improved schema Improved documentation in the XSD file with documentation and minor consistency changes. Updated all testcases to latest schema. Ids testcases are generated from the documentation/testcases/scripts.md via the SchemaProject folder. The next step is to integrate this feature in the automated targets * Fixed IDS files - completed information on Development files - documentation: dataType adjusted to valid scenarios - testcases adjusted for audit: - attribute/pass-an_optional_facet_always_passes_regardless_of_outcome removed - improved empty classification systems (requiring at least a letter). - improved entity constraints - improved material tests - improved partof tests * All testcases pass IDS auditing deliberately A new class of tests (invalid) has been added, to mark tests that should fail IFC verification and and are also invalid for the audit tool. * Completed the unit documentation. * Schema changes from SCTE consultation - propertyType.name renamed to baseName - EntityType.subType renamed to predefinedType - Improved documentation * Corrected some test cases. * Improved units.md - removed units that never require conversion - corrected unit capitalization according to SI - consistent spacing in Unit symbols --------- Co-authored-by: Stefan Jaud <59165496+pjanck@users.noreply.github.com> --------- Co-authored-by: Claudio Benghi <claudio.benghi@gmail.com> Co-authored-by: pasi-paasiala <pasi.paasiala@solibri.com> Co-authored-by: Stefan Jaud <59165496+pjanck@users.noreply.github.com>
…defined Type on Target r... Implemented final PartOf tests where filtering on predefined Type on Target relation Made possible by extension to Essentials. Based on latest thinking of PDT inheritance at buildingSMART/IDS#240 (comment)
Working progress revision of the schema and documentation.