IDS icon indicating copy to clipboard operation
IDS copied to clipboard

Shortcoming for validation of PredefinedType setting in entity facet

Open MatthiasWeise opened this issue 2 years ago • 5 comments

I was wondering if correct use of the predefinedType is checked by http://www.xbim.it/ids. Obviously not, because current agreement with USERDEFINED does enable to check misspelling of predefinedType.

MatthiasWeise avatar Oct 26 '23 13:10 MatthiasWeise

Hi @MatthiasWeise, Constraining the PredefinedType is something I originally added, but have since relaxed. Indeed the code infrastructure to enforce the closed list is still in the tool, but the agreement in the group is that we must allow for the selection of user defined values. What I can easily do is to add a warning to the log, that notifies of non-standard strings, if that helps. Would that be useful?

CBenghi avatar Oct 26 '23 13:10 CBenghi

Yes, a warning would be good to avoid misspelling of predefinedType. Actually, I wanted to check if USERDEFINED is allowed or not. I would argue that we should allow USERDEFINED, and then to check that predefinedType = USERDEFINED and objectType can have any value.

MatthiasWeise avatar Oct 26 '23 13:10 MatthiasWeise

However that would prevent us from selecting specific parts of the models that have a custom predefinedType, which does not sound right. We do need a test case that deals with some predefined type configuration, if we don't have one yet. I'll have to check.

CBenghi avatar Oct 26 '23 14:10 CBenghi

I was more thinking that we need both, USERDEFINED to be unspecific about what user defined type should be selected and to use any other value not being in the list of predefinedTypeEnums for a specific used defined type.

MatthiasWeise avatar Oct 26 '23 14:10 MatthiasWeise

Agreed, checking for any custom/USERDEFINED predefined type feels useful. This shouldn't preclude implicitly checking the ObjectType.

  1. Standard case: All Doors defined as TrapDoor (PredefinedType = TRAPDOOR)

Entity Facet:

  • IfcType: IFCDOOR
  • PredefinedType: TRAPDOOR
  1. User defined scenario All Doors defined as 'SecurityDoor' (ObjectType = 'SecurityDoor' [and PredefinedType = USERDEFINED])

Entity Facet:

  • IfcType: IFCDOOR
  • PredefinedType: SecurityDoor
  1. Edge case All Doors with any User-defined type (PredefinedType = USERDEFINED)

Entity Facet:

  • IfcType: IFCDOOR
  • PredefinedType: USERDEFINED

In particular, a use case might be: "All elements must NOT have a PredefinedType of USERDEFINED". That kind of test might help with #116, as presumably you could select applicable items with IfcFlowTerminal of Predefined Type 'DIFFUSER,GRILL' etc if you can exclude USERDEFINED and NOTDEFINED . This assumes implementations fall back to the Type to check the PDT - i.e [IfcAirTerminal]Type's PDT to filter the Ifc2x3 FlowTerminals.

It would also let IDS police the (mis)usage we sometimes see of IfcObject.ObjectType being defined when PredefinedType is NOTDEFINED - by combining an Entity requirement and an Attribute requirement.

andyward avatar Oct 27 '23 11:10 andyward