(*
Copyright by:
buildingSMART International Limited, 1996-2019

Any technical documentation made available by buildingSMART International Limited
is the copyrighted work of buildingSMART International Limited and is owned by the 
buildingSMART International Limited. It may be photocopied, used in software development, 
or translated into another computer language without prior written consent from 
buildingSMART International Limited provided that full attribution is given. 
Prior written consent is required if changes are made to the technical specification.

This material is delivered to you as is and buildingSMART International Limited makes 
no warranty of any kind with regard to it, including, but not limited to, the implied 
warranties as to its accuracy or fitness for a particular purpose. Any use of the 
technical documentation or the information contained therein is at the risk of the user. 
Documentation may include technical or other inaccuracies or typographical errors. 
buildingSMART International Limited shall not be liable for errors contained therein or 
for incidental consequential damages in connection with the furnishing, performance or use 
of the material. The information contained in this document is subject to change without notice.

Issue date:
Friday, July 26, 2019

*)

SCHEMA IFCSHAREDBLDGELEMENTS;

REFERENCE FROM IFCMEASURERESOURCE
(
  IfcPositiveLengthMeasure,
  IfcAreaMeasure,
  IfcUnit,
  IfcDerivedUnit,
  IfcNamedUnit,
  IfcContextDependentUnit,
  IfcConversionBasedUnit,
  IfcSiUnit,
  IfcLabel,
  IfcBoolean,
  IfcInteger,
  IfcReal
);

REFERENCE FROM IFCGEOMETRYRESOURCE
(
  IfcAxis2Placement,
  IfcAxis2Placement2D,
  IfcAxis2Placement3D
);

REFERENCE FROM IFCMATERIALRESOURCE
(
  IfcMaterial,
  IfcMaterialList,
  IfcMaterialLayerSet,
  IfcMaterialSelect
);

REFERENCE FROM IFCDATETIMERESOURCE
(
);

REFERENCE FROM IFCACTORRESOURCE
(
  IfcActorSelect,
  IfcPerson,
  IfcOrganization,
  IfcPersonAndOrganization
);

REFERENCE FROM IFCPROPERTYRESOURCE
(
  IfcSimpleProperty,
  IfcPropertySingleValue
);

REFERENCE FROM IFCKERNEL
(
  IfcObject,
  IfcProject,
  IfcProduct,
  IfcGroup,
  IfcRelAssignsToGroup,
  IfcRelConnects
);

REFERENCE FROM IFCPRODUCTEXTENSION
(
  IfcElement,
  IfcOpeningElement,
  IfcSite,
  IfcBuilding,
  IfcBuildingStorey,
  IfcSpace,
  IfcRelConnectsElements,
  IfcRelVoidsElement,
  IfcRelFillsElement,
  IfcBuildingElement,
  IfcRelSpaceBoundary,
  IfcRelAssociatesMaterial,
  IfcBuildingElementType,
  IfcSystem
);

REFERENCE FROM IFCREPRESENTATIONRESOURCE
(
);

REFERENCE FROM IFCEXTERNALREFERENCERESOURCE
(
  IfcClassificationReference
);

REFERENCE FROM IFCPRESENTATIONAPPEARANCERESOURCE
(
  IfcNullStyle
);

REFERENCE FROM IFCGEOMETRICMODELRESOURCE
(
  IfcGeometricSet
);

TYPE IfcBeamTypeEnum = ENUMERATION OF
	(BEAM
	,JOIST
	,HOLLOWCORE
	,LINTEL
	,SPANDREL
	,T_BEAM
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcBuildingElementProxyTypeEnum = ENUMERATION OF
	(COMPLEX
	,ELEMENT
	,PARTIAL
	,PROVISIONFORVOID
	,PROVISIONFORSPACE
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcBuildingSystemTypeEnum = ENUMERATION OF
	(FENESTRATION
	,FOUNDATION
	,LOADBEARING
	,OUTERSHELL
	,SHADING
	,TRANSPORT
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcChimneyTypeEnum = ENUMERATION OF
	(USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcColumnTypeEnum = ENUMERATION OF
	(COLUMN
	,PILASTER
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcConnectionTypeEnum = ENUMERATION OF
	(ATPATH
	,ATSTART
	,ATEND
	,NOTDEFINED);
END_TYPE;

TYPE IfcCoveringTypeEnum = ENUMERATION OF
	(CEILING
	,FLOORING
	,CLADDING
	,ROOFING
	,MOLDING
	,SKIRTINGBOARD
	,INSULATION
	,MEMBRANE
	,SLEEVING
	,WRAPPING
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcCurtainWallTypeEnum = ENUMERATION OF
	(USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcDoorTypeEnum = ENUMERATION OF
	(DOOR
	,GATE
	,TRAPDOOR
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcDoorTypeOperationEnum = ENUMERATION OF
	(SINGLE_SWING_LEFT
	,SINGLE_SWING_RIGHT
	,DOUBLE_DOOR_SINGLE_SWING
	,DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_LEFT
	,DOUBLE_DOOR_SINGLE_SWING_OPPOSITE_RIGHT
	,DOUBLE_SWING_LEFT
	,DOUBLE_SWING_RIGHT
	,DOUBLE_DOOR_DOUBLE_SWING
	,SLIDING_TO_LEFT
	,SLIDING_TO_RIGHT
	,DOUBLE_DOOR_SLIDING
	,FOLDING_TO_LEFT
	,FOLDING_TO_RIGHT
	,DOUBLE_DOOR_FOLDING
	,REVOLVING
	,ROLLINGUP
	,SWING_FIXED_LEFT
	,SWING_FIXED_RIGHT
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcMemberTypeEnum = ENUMERATION OF
	(BRACE
	,CHORD
	,COLLAR
	,MEMBER
	,MULLION
	,PLATE
	,POST
	,PURLIN
	,RAFTER
	,STRINGER
	,STRUT
	,STUD
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcPlateTypeEnum = ENUMERATION OF
	(CURTAIN_PANEL
	,SHEET
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcRailingTypeEnum = ENUMERATION OF
	(HANDRAIL
	,GUARDRAIL
	,BALUSTRADE
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcRampFlightTypeEnum = ENUMERATION OF
	(STRAIGHT
	,SPIRAL
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcRampTypeEnum = ENUMERATION OF
	(STRAIGHT_RUN_RAMP
	,TWO_STRAIGHT_RUN_RAMP
	,QUARTER_TURN_RAMP
	,TWO_QUARTER_TURN_RAMP
	,HALF_TURN_RAMP
	,SPIRAL_RAMP
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcRoofTypeEnum = ENUMERATION OF
	(FLAT_ROOF
	,SHED_ROOF
	,GABLE_ROOF
	,HIP_ROOF
	,HIPPED_GABLE_ROOF
	,GAMBREL_ROOF
	,MANSARD_ROOF
	,BARREL_ROOF
	,RAINBOW_ROOF
	,BUTTERFLY_ROOF
	,PAVILION_ROOF
	,DOME_ROOF
	,FREEFORM
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcShadingDeviceTypeEnum = ENUMERATION OF
	(JALOUSIE
	,SHUTTER
	,AWNING
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcSlabTypeEnum = ENUMERATION OF
	(FLOOR
	,ROOF
	,LANDING
	,BASESLAB
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcStairFlightTypeEnum = ENUMERATION OF
	(STRAIGHT
	,WINDER
	,SPIRAL
	,CURVED
	,FREEFORM
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcStairTypeEnum = ENUMERATION OF
	(STRAIGHT_RUN_STAIR
	,TWO_STRAIGHT_RUN_STAIR
	,QUARTER_WINDING_STAIR
	,QUARTER_TURN_STAIR
	,HALF_WINDING_STAIR
	,HALF_TURN_STAIR
	,TWO_QUARTER_WINDING_STAIR
	,TWO_QUARTER_TURN_STAIR
	,THREE_QUARTER_WINDING_STAIR
	,THREE_QUARTER_TURN_STAIR
	,SPIRAL_STAIR
	,DOUBLE_RETURN_STAIR
	,CURVED_RUN_STAIR
	,TWO_CURVED_RUN_STAIR
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcWallTypeEnum = ENUMERATION OF
	(MOVABLE
	,PARAPET
	,PARTITIONING
	,PLUMBINGWALL
	,SHEAR
	,SOLIDWALL
	,STANDARD
	,POLYGONAL
	,ELEMENTEDWALL
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcWindowTypeEnum = ENUMERATION OF
	(WINDOW
	,SKYLIGHT
	,LIGHTDOME
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcWindowTypePartitioningEnum = ENUMERATION OF
	(SINGLE_PANEL
	,DOUBLE_PANEL_VERTICAL
	,DOUBLE_PANEL_HORIZONTAL
	,TRIPLE_PANEL_VERTICAL
	,TRIPLE_PANEL_BOTTOM
	,TRIPLE_PANEL_TOP
	,TRIPLE_PANEL_LEFT
	,TRIPLE_PANEL_RIGHT
	,TRIPLE_PANEL_HORIZONTAL
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

ENTITY IfcBeam
 SUPERTYPE OF (ONEOF
    (IfcBeamStandardCase))
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcBeamTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcBeamTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcBeamTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCBEAMTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcBeamStandardCase
 SUBTYPE OF (IfcBeam);
 WHERE
	HasMaterialProfileSetUsage : SIZEOF (QUERY(temp <* USEDIN(SELF, 'IFCKERNEL.IFCRELASSOCIATES.RELATEDOBJECTS') |
              ('IFCPRODUCTEXTENSION.IFCRELASSOCIATESMATERIAL' IN TYPEOF(temp)) AND
              ('IFCMATERIALRESOURCE.IFCMATERIALPROFILESETUSAGE' IN TYPEOF(temp.RelatingMaterial))
              )) = 1;
END_ENTITY;

ENTITY IfcBeamType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcBeamTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcBeamTypeEnum.USERDEFINED) OR
((PredefinedType = IfcBeamTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcBuildingElementProxy
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcBuildingElementProxyTypeEnum;
 WHERE
	HasObjectName : EXISTS(SELF\IfcRoot.Name);
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcBuildingElementProxyTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcBuildingElementProxyTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCBUILDINGELEMENTPROXYTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcBuildingElementProxyType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcBuildingElementProxyTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcBuildingElementProxyTypeEnum.USERDEFINED) OR
((PredefinedType = IfcBuildingElementProxyTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcBuildingSystem
 SUBTYPE OF (IfcSystem);
	PredefinedType : OPTIONAL IfcBuildingSystemTypeEnum;
	LongName : OPTIONAL IfcLabel;
END_ENTITY;

ENTITY IfcChimney
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcChimneyTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcChimneyTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcChimneyTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCCHIMNEYTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcChimneyType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcChimneyTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcChimneyTypeEnum.USERDEFINED) OR
((PredefinedType = IfcChimneyTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcColumn
 SUPERTYPE OF (ONEOF
    (IfcColumnStandardCase))
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcColumnTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcColumnTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcColumnTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCCOLUMNTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcColumnStandardCase
 SUBTYPE OF (IfcColumn);
 WHERE
	HasMaterialProfileSetUsage : SIZEOF (QUERY(temp <* USEDIN(SELF, 'IFCKERNEL.IFCRELASSOCIATES.RELATEDOBJECTS') |
              ('IFCPRODUCTEXTENSION.IFCRELASSOCIATESMATERIAL' IN TYPEOF(temp)) AND
              ('IFCMATERIALRESOURCE.IFCMATERIALPROFILESETUSAGE' IN TYPEOF(temp.RelatingMaterial))
              )) = 1;
END_ENTITY;

ENTITY IfcColumnType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcColumnTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcColumnTypeEnum.USERDEFINED) OR
((PredefinedType = IfcColumnTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcCovering
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcCoveringTypeEnum;
 INVERSE
	CoversSpaces : SET [0:1] OF IfcRelCoversSpaces FOR RelatedCoverings;
	CoversElements : SET [0:1] OF IfcRelCoversBldgElements FOR RelatedCoverings;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR 
 (PredefinedType <> IfcCoveringTypeEnum.USERDEFINED) OR 
 ((PredefinedType = IfcCoveringTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCCOVERINGTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcCoveringType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcCoveringTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcCoveringTypeEnum.USERDEFINED) OR
((PredefinedType = IfcCoveringTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcCurtainWall
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcCurtainWallTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcCurtainWallTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcCurtainWallTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCCURTAINWALLTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcCurtainWallType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcCurtainWallTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcCurtainWallTypeEnum.USERDEFINED) OR
((PredefinedType = IfcCurtainWallTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcDoor
 SUPERTYPE OF (ONEOF
    (IfcDoorStandardCase))
 SUBTYPE OF (IfcBuildingElement);
	OverallHeight : OPTIONAL IfcPositiveLengthMeasure;
	OverallWidth : OPTIONAL IfcPositiveLengthMeasure;
	PredefinedType : OPTIONAL IfcDoorTypeEnum;
	OperationType : OPTIONAL IfcDoorTypeOperationEnum;
	UserDefinedOperationType : OPTIONAL IfcLabel;
 WHERE
	CorrectStyleAssigned : (SIZEOF(IsTypedBy) = 0) 
OR ('IFCSHAREDBLDGELEMENTS.IFCDOORTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcDoorStandardCase
 SUBTYPE OF (IfcDoor);
END_ENTITY;

ENTITY IfcDoorType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcDoorTypeEnum;
	OperationType : IfcDoorTypeOperationEnum;
	ParameterTakesPrecedence : OPTIONAL IfcBoolean;
	UserDefinedOperationType : OPTIONAL IfcLabel;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcDoorTypeEnum.USERDEFINED) OR
((PredefinedType = IfcDoorTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcMember
 SUPERTYPE OF (ONEOF
    (IfcMemberStandardCase))
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcMemberTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcMemberTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcMemberTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCMEMBERTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcMemberStandardCase
 SUBTYPE OF (IfcMember);
 WHERE
	HasMaterialProfileSetUsage : SIZEOF (QUERY(temp <* USEDIN(SELF, 'IFCKERNEL.IFCRELASSOCIATES.RELATEDOBJECTS') |
              ('IFCPRODUCTEXTENSION.IFCRELASSOCIATESMATERIAL' IN TYPEOF(temp)) AND
              ('IFCMATERIALRESOURCE.IFCMATERIALPROFILESETUSAGE' IN TYPEOF(temp.RelatingMaterial))
              )) = 1;
END_ENTITY;

ENTITY IfcMemberType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcMemberTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcMemberTypeEnum.USERDEFINED) OR
((PredefinedType = IfcMemberTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcPlate
 SUPERTYPE OF (ONEOF
    (IfcPlateStandardCase))
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcPlateTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcPlateTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcPlateTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCPLATETYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcPlateStandardCase
 SUBTYPE OF (IfcPlate);
 WHERE
	HasMaterialLayerSetUsage : SIZEOF (QUERY(temp <* USEDIN(SELF, 'IFCKERNEL.IFCRELASSOCIATES.RELATEDOBJECTS') |
              ('IFCPRODUCTEXTENSION.IFCRELASSOCIATESMATERIAL' IN TYPEOF(temp)) AND
              ('IFCMATERIALRESOURCE.IFCMATERIALLAYERSETUSAGE' IN TYPEOF(temp.RelatingMaterial))
              )) = 1;
END_ENTITY;

ENTITY IfcPlateType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcPlateTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcPlateTypeEnum.USERDEFINED) OR
((PredefinedType = IfcPlateTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcRailing
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcRailingTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcRailingTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcRailingTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCRAILINGTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcRailingType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcRailingTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcRailingTypeEnum.USERDEFINED) OR
((PredefinedType = IfcRailingTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcRamp
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcRampTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcRampTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcRampTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCRAMPTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcRampFlight
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcRampFlightTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcRampFlightTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcRampFlightTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCRAMPFLIGHTTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcRampFlightType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcRampFlightTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcRampFlightTypeEnum.USERDEFINED) OR
((PredefinedType = IfcRampFlightTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcRampType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcRampTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcRampTypeEnum.USERDEFINED) OR
((PredefinedType = IfcRampTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcRelConnectsPathElements
 SUBTYPE OF (IfcRelConnectsElements);
	RelatingPriorities : LIST [0:?] OF IfcInteger;
	RelatedPriorities : LIST [0:?] OF IfcInteger;
	RelatedConnectionType : IfcConnectionTypeEnum;
	RelatingConnectionType : IfcConnectionTypeEnum;
 WHERE
	NormalizedRelatingPriorities : (SIZEOF(RelatingPriorities) = 0)
OR
(SIZEOF (QUERY (temp <* RelatingPriorities
  | {0 <= temp <= 100}
  )) = SIZEOF(RelatingPriorities));
	NormalizedRelatedPriorities : (SIZEOF(RelatedPriorities) = 0)
OR
(SIZEOF (QUERY (temp <* RelatedPriorities
  | {0 <= temp <= 100}
  )) = SIZEOF(RelatedPriorities));
END_ENTITY;

ENTITY IfcRelCoversBldgElements
 SUBTYPE OF (IfcRelConnects);
	RelatingBuildingElement : IfcElement;
	RelatedCoverings : SET [1:?] OF IfcCovering;
END_ENTITY;

ENTITY IfcRelCoversSpaces
 SUBTYPE OF (IfcRelConnects);
	RelatingSpace : IfcSpace;
	RelatedCoverings : SET [1:?] OF IfcCovering;
END_ENTITY;

ENTITY IfcRoof
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcRoofTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcRoofTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcRoofTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCROOFTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcRoofType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcRoofTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcRoofTypeEnum.USERDEFINED) OR
((PredefinedType = IfcRoofTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcShadingDevice
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcShadingDeviceTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcShadingDeviceTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcShadingDeviceTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCSHADINGDEVICETYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcShadingDeviceType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcShadingDeviceTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcShadingDeviceTypeEnum.USERDEFINED) OR
((PredefinedType = IfcShadingDeviceTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcSlab
 SUPERTYPE OF (ONEOF
    (IfcSlabElementedCase
    ,IfcSlabStandardCase))
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcSlabTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcSlabTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcSlabTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCSLABTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcSlabElementedCase
 SUBTYPE OF (IfcSlab);
 WHERE
	HasDecomposition : HIINDEX(SELF\IfcObjectDefinition.IsDecomposedBy) > 0;
END_ENTITY;

ENTITY IfcSlabStandardCase
 SUBTYPE OF (IfcSlab);
 WHERE
	HasMaterialLayerSetusage : SIZEOF (QUERY(temp <* USEDIN(SELF, 'IFCKERNEL.IFCRELASSOCIATES.RELATEDOBJECTS') |
              ('IFCPRODUCTEXTENSION.IFCRELASSOCIATESMATERIAL' IN TYPEOF(temp)) AND
              ('IFCMATERIALRESOURCE.IFCMATERIALLAYERSETUSAGE' IN TYPEOF(temp.RelatingMaterial))
              )) = 1;
END_ENTITY;

ENTITY IfcSlabType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcSlabTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcSlabTypeEnum.USERDEFINED) OR
((PredefinedType = IfcSlabTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcStair
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcStairTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcStairTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcStairTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCSTAIRTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcStairFlight
 SUBTYPE OF (IfcBuildingElement);
	NumberOfRisers : OPTIONAL IfcInteger;
	NumberOfTreads : OPTIONAL IfcInteger;
	RiserHeight : OPTIONAL IfcPositiveLengthMeasure;
	TreadLength : OPTIONAL IfcPositiveLengthMeasure;
	PredefinedType : OPTIONAL IfcStairFlightTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcStairFlightTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcStairFlightTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCSTAIRFLIGHTTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcStairFlightType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcStairFlightTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcStairFlightTypeEnum.USERDEFINED) OR
((PredefinedType = IfcStairFlightTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcStairType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcStairTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcStairTypeEnum.USERDEFINED) OR
((PredefinedType = IfcStairTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcWall
 SUPERTYPE OF (ONEOF
    (IfcWallElementedCase
    ,IfcWallStandardCase))
 SUBTYPE OF (IfcBuildingElement);
	PredefinedType : OPTIONAL IfcWallTypeEnum;
 WHERE
	CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR
 (PredefinedType <> IfcWallTypeEnum.USERDEFINED) OR
 ((PredefinedType = IfcWallTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
	CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR
  ('IFCSHAREDBLDGELEMENTS.IFCWALLTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcWallElementedCase
 SUBTYPE OF (IfcWall);
 WHERE
	HasDecomposition : HIINDEX(SELF\IfcObjectDefinition.IsDecomposedBy) > 0;
END_ENTITY;

ENTITY IfcWallStandardCase
 SUBTYPE OF (IfcWall);
 WHERE
	HasMaterialLayerSetUsage : SIZEOF (QUERY(temp <* USEDIN(SELF, 'IFCKERNEL.IFCRELASSOCIATES.RELATEDOBJECTS') |
              ('IFCPRODUCTEXTENSION.IFCRELASSOCIATESMATERIAL' IN TYPEOF(temp)) AND
              ('IFCMATERIALRESOURCE.IFCMATERIALLAYERSETUSAGE' IN TYPEOF(temp.RelatingMaterial))
              )) = 1;
END_ENTITY;

ENTITY IfcWallType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcWallTypeEnum;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcWallTypeEnum.USERDEFINED) OR
((PredefinedType = IfcWallTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

ENTITY IfcWindow
 SUPERTYPE OF (ONEOF
    (IfcWindowStandardCase))
 SUBTYPE OF (IfcBuildingElement);
	OverallHeight : OPTIONAL IfcPositiveLengthMeasure;
	OverallWidth : OPTIONAL IfcPositiveLengthMeasure;
	PredefinedType : OPTIONAL IfcWindowTypeEnum;
	PartitioningType : OPTIONAL IfcWindowTypePartitioningEnum;
	UserDefinedPartitioningType : OPTIONAL IfcLabel;
 WHERE
	CorrectStyleAssigned : (SIZEOF(IsTypedBy) = 0) 
OR ('IFCSHAREDBLDGELEMENTS.IFCWINDOWTYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcWindowStandardCase
 SUBTYPE OF (IfcWindow);
END_ENTITY;

ENTITY IfcWindowType
 SUBTYPE OF (IfcBuildingElementType);
	PredefinedType : IfcWindowTypeEnum;
	PartitioningType : IfcWindowTypePartitioningEnum;
	ParameterTakesPrecedence : OPTIONAL IfcBoolean;
	UserDefinedPartitioningType : OPTIONAL IfcLabel;
 WHERE
	CorrectPredefinedType : (PredefinedType <> IfcWindowTypeEnum.USERDEFINED) OR
((PredefinedType = IfcWindowTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcElementType.ElementType));
END_ENTITY;

END_SCHEMA;
