SCHEMA IFC4;

TYPE IfcAreaMeasure = REAL;
END_TYPE;

TYPE IfcDate = STRING;
END_TYPE;

TYPE IfcDateTime = STRING;
END_TYPE;

TYPE IfcDayInMonthNumber = INTEGER;
WHERE
ValidRange : {1 <= SELF <= 31}
END_TYPE;

TYPE IfcDayInWeekNumber = INTEGER;
WHERE
ValidRange : {1 <= SELF <= 7}
END_TYPE;

TYPE IfcDuration = STRING;
END_TYPE;

TYPE IfcGloballyUniqueId = STRING (22) FIXED;
END_TYPE;

TYPE IfcIdentifier = STRING (255);
END_TYPE;

TYPE IfcInteger = INTEGER;
END_TYPE;

TYPE IfcLabel = STRING (255);
END_TYPE;

TYPE IfcLengthMeasure = REAL;
END_TYPE;

TYPE IfcMonetaryMeasure = REAL;
END_TYPE;

TYPE IfcMonthInYearNumber = INTEGER;
WHERE
ValidRange : {1 <= SELF <= 12}
END_TYPE;

TYPE IfcPositiveLengthMeasure = IfcLengthMeasure;
WHERE
WR1 : SELF > 0.
END_TYPE;

TYPE IfcReal = REAL;
END_TYPE;

TYPE IfcText = STRING;
END_TYPE;

TYPE IfcTime = STRING;
END_TYPE;

TYPE IfcTimeStamp = INTEGER;
END_TYPE;

TYPE IfcBenchmarkEnum = ENUMERATION OF (
GREATERTHAN,
GREATERTHANOREQUALTO,
LESSTHAN,
LESSTHANOREQUALTO,
EQUALTO,
NOTEQUALTO,
INCLUDES,
NOTINCLUDES,
INCLUDEDIN,
NOTINCLUDEDIN);
END_TYPE;

TYPE IfcChangeActionEnum = ENUMERATION OF (
NOCHANGE,
MODIFIED,
ADDED,
DELETED,
NOTDEFINED);
END_TYPE;

TYPE IfcConstraintEnum = ENUMERATION OF (
HARD,
SOFT,
ADVISORY,
USERDEFINED,
NOTDEFINED);
END_TYPE;

TYPE IfcConstructionProductResourceTypeEnum = ENUMERATION OF (
ASSEMBLY,
FORMWORK,
USERDEFINED,
NOTDEFINED);
END_TYPE;

TYPE IfcObjectiveEnum = ENUMERATION OF (
CODECOMPLIANCE,
CODEWAIVER,
DESIGNINTENT,
EXTERNAL,
HEALTHANDSAFETY,
MERGECONFLICT,
MODELVIEW,
PARAMETER,
REQUIREMENT,
SPECIFICATION,
TRIGGERCONDITION,
USERDEFINED,
NOTDEFINED);
END_TYPE;

TYPE IfcRecurrenceTypeEnum = ENUMERATION OF (
DAILY,
WEEKLY,
MONTHLY_BY_DAY_OF_MONTH,
MONTHLY_BY_POSITION,
BY_DAY_COUNT,
BY_WEEKDAY_COUNT,
YEARLY_BY_DAY_OF_MONTH,
YEARLY_BY_POSITION);
END_TYPE;

TYPE IfcSIPrefix = ENUMERATION OF (
EXA,
PETA,
TERA,
GIGA,
MEGA,
KILO,
HECTO,
DECA,
DECI,
CENTI,
MILLI,
MICRO,
NANO,
PICO,
FEMTO,
ATTO);
END_TYPE;

TYPE IfcSIUnitName = ENUMERATION OF (
AMPERE,
BECQUEREL,
CANDELA,
COULOMB,
CUBIC_METRE,
DEGREE_CELSIUS,
FARAD,
GRAM,
GRAY,
HENRY,
HERTZ,
JOULE,
KELVIN,
LUMEN,
LUX,
METRE,
MOLE,
NEWTON,
OHM,
PASCAL,
RADIAN,
SECOND,
SIEMENS,
SIEVERT,
SQUARE_METRE,
STERADIAN,
TESLA,
VOLT,
WATT,
WEBER);
END_TYPE;

TYPE IfcStateEnum = ENUMERATION OF (
READWRITE,
READONLY,
LOCKED,
READWRITELOCKED,
READONLYLOCKED);
END_TYPE;

TYPE IfcUnitEnum = ENUMERATION OF (
ABSORBEDDOSEUNIT,
AMOUNTOFSUBSTANCEUNIT,
AREAUNIT,
DOSEEQUIVALENTUNIT,
ELECTRICCAPACITANCEUNIT,
ELECTRICCHARGEUNIT,
ELECTRICCONDUCTANCEUNIT,
ELECTRICCURRENTUNIT,
ELECTRICRESISTANCEUNIT,
ELECTRICVOLTAGEUNIT,
ENERGYUNIT,
FORCEUNIT,
FREQUENCYUNIT,
ILLUMINANCEUNIT,
INDUCTANCEUNIT,
LENGTHUNIT,
LUMINOUSFLUXUNIT,
LUMINOUSINTENSITYUNIT,
MAGNETICFLUXDENSITYUNIT,
MAGNETICFLUXUNIT,
MASSUNIT,
PLANEANGLEUNIT,
POWERUNIT,
PRESSUREUNIT,
RADIOACTIVITYUNIT,
SOLIDANGLEUNIT,
THERMODYNAMICTEMPERATUREUNIT,
TIMEUNIT,
VOLUMEUNIT,
USERDEFINED);
END_TYPE;

TYPE IfcActorSelect = SELECT (
IfcOrganization,
IfcPerson,
IfcPersonAndOrganization);
END_TYPE;

TYPE IfcClassificationReferenceSelect = SELECT (
IfcClassificationReference,
IfcClassification);
END_TYPE;

TYPE IfcClassificationSelect = SELECT (
IfcClassification,
IfcClassificationReference);
END_TYPE;

TYPE IfcDefinitionSelect = SELECT (
IfcObjectDefinition,
IfcPropertyDefinition);
END_TYPE;

TYPE IfcDocumentSelect = SELECT (
END_TYPE;

TYPE IfcMetricValueSelect = SELECT (
IfcMeasureWithUnit,
IfcTable,
IfcValue,
IfcReference);
END_TYPE;

TYPE IfcPropertySetDefinitionSelect = SELECT (
IfcPropertySetDefinition);
END_TYPE;

TYPE IfcUnit = SELECT (
IfcNamedUnit);
END_TYPE;

TYPE IfcValue = SELECT (
END_TYPE;

ENTITY IfcActionRequest
SUBTYPE OF (IfcControl);
PredefinedType : OPTIONAL IfcStrippedOptional;
Status : OPTIONAL IfcStrippedOptional;
LongDescription : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcActor
SUBTYPE OF (IfcObject);
TheActor : IfcActorSelect;
INVERSE
END_ENTITY;

ENTITY IfcAddress
ABSTRACT SUPERTYPE OF(ONEOF(IfcPostalAddress, IfcTelecomAddress));
Purpose : OPTIONAL IfcStrippedOptional;
Description : OPTIONAL IfcStrippedOptional;
UserDefinedPurpose : OPTIONAL IfcStrippedOptional;
INVERSE
OfPerson : SET OF IfcPerson FOR Addresses;
OfOrganization : SET OF IfcOrganization FOR Addresses;
WHERE
WR1 : (NOT(EXISTS(Purpose))) OR ((Purpose <> IfcAddressTypeEnum.USERDEFINED) OR ((Purpose = IfcAddressTypeEnum.USERDEFINED) AND EXISTS(SELF.UserDefinedPurpose)));
END_ENTITY;

ENTITY IfcAnnotation
SUBTYPE OF (IfcProduct);
INVERSE
ContainedInStructure : SET [0:1] OF IfcRelContainedInSpatialStructure FOR RelatedElements;
END_ENTITY;

ENTITY IfcApplication;
ApplicationDeveloper : IfcOrganization;
Version : IfcLabel;
ApplicationFullName : IfcLabel;
ApplicationIdentifier : IfcIdentifier;
UNIQUE
UR1 : ApplicationIdentifier;
UR2 : ApplicationFullName, Version;
END_ENTITY;

ENTITY IfcBuilding
SUBTYPE OF (IfcSpatialStructureElement);
ElevationOfRefHeight : OPTIONAL IfcStrippedOptional;
ElevationOfTerrain : OPTIONAL IfcStrippedOptional;
BuildingAddress : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcBuildingStorey
SUBTYPE OF (IfcSpatialStructureElement);
Elevation : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcClassification
SUBTYPE OF (IfcExternalInformation);
Source : OPTIONAL IfcLabel;
Edition : OPTIONAL IfcStrippedOptional;
EditionDate : OPTIONAL IfcStrippedOptional;
Name : IfcLabel;
Description : OPTIONAL IfcStrippedOptional;
Location : OPTIONAL IfcStrippedOptional;
ReferenceTokens : OPTIONAL LIST [1:?] OF IfcIdentifier;
INVERSE
ClassificationForObjects : SET OF IfcRelAssociatesClassification FOR RelatingClassification;
HasReferences : SET OF IfcClassificationReference FOR ReferencedSource;
END_ENTITY;

ENTITY IfcClassificationReference
SUBTYPE OF (IfcExternalReference);
ReferencedSource : OPTIONAL IfcClassificationReferenceSelect;
Description : OPTIONAL IfcStrippedOptional;
Sort : OPTIONAL IfcStrippedOptional;
INVERSE
ClassificationRefForObjects : SET [0:?] OF IfcRelAssociatesClassification FOR RelatingClassification;
HasReferences : SET [0:?] OF IfcClassificationReference FOR ReferencedSource;
END_ENTITY;

ENTITY IfcConstraint
ABSTRACT SUPERTYPE OF(ONEOF(IfcMetric, IfcObjective));
Name : IfcLabel;
Description : OPTIONAL IfcStrippedOptional;
ConstraintGrade : IfcConstraintEnum;
ConstraintSource : OPTIONAL IfcStrippedOptional;
CreatingActor : OPTIONAL IfcStrippedOptional;
CreationTime : OPTIONAL IfcStrippedOptional;
UserDefinedGrade : OPTIONAL IfcStrippedOptional;
INVERSE
WHERE
WR11 : (ConstraintGrade <> IfcConstraintEnum.USERDEFINED) OR ((ConstraintGrade = IfcConstraintEnum.USERDEFINED) AND EXISTS(SELF\IfcConstraint.UserDefinedGrade));
END_ENTITY;

ENTITY IfcConstructionProductResource
SUBTYPE OF (IfcConstructionResource);
PredefinedType : OPTIONAL IfcStrippedOptional;
WHERE
CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR (PredefinedType <> IfcConstructionProductResourceTypeEnum.USERDEFINED) OR ((PredefinedType = IfcConstructionProductResourceTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
END_ENTITY;

ENTITY IfcConstructionProductResourceType
SUBTYPE OF (IfcConstructionResourceType);
PredefinedType : IfcConstructionProductResourceTypeEnum;
WHERE
CorrectPredefinedType : (PredefinedType <> IfcConstructionProductResourceTypeEnum.USERDEFINED) OR ((PredefinedType = IfcConstructionProductResourceTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcTypeResource.ResourceType));
END_ENTITY;

ENTITY IfcConstructionResource
ABSTRACT SUPERTYPE OF(IfcConstructionProductResource)
SUBTYPE OF (IfcResource);
Usage : OPTIONAL IfcStrippedOptional;
BaseCosts : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
BaseQuantity : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcConstructionResourceType
ABSTRACT SUPERTYPE OF(IfcConstructionProductResourceType)
SUBTYPE OF (IfcTypeResource);
BaseCosts : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
BaseQuantity : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcContext
ABSTRACT SUPERTYPE OF(IfcProject)
SUBTYPE OF (IfcObjectDefinition);
ObjectType : OPTIONAL IfcStrippedOptional;
LongName : OPTIONAL IfcStrippedOptional;
Phase : OPTIONAL IfcStrippedOptional;
RepresentationContexts : OPTIONAL SET [1:?] OF IfcStrippedOptional;
UnitsInContext : OPTIONAL IfcUnitAssignment;
INVERSE
IsDefinedBy : SET [0:?] OF IfcRelDefinesByProperties FOR RelatedObjects;
Declares : SET OF IfcRelDeclares FOR RelatingContext;
END_ENTITY;

ENTITY IfcContextDependentUnit
SUBTYPE OF (IfcNamedUnit);
Name : IfcLabel;
INVERSE
END_ENTITY;

ENTITY IfcControl
ABSTRACT SUPERTYPE OF(ONEOF(IfcActionRequest, IfcWorkControl))
SUBTYPE OF (IfcObject);
Identification : OPTIONAL IfcStrippedOptional;
INVERSE
Controls : SET OF IfcRelAssignsToControl FOR RelatingControl;
END_ENTITY;

ENTITY IfcConversionBasedUnit
SUPERTYPE OF(IfcConversionBasedUnitWithOffset)
SUBTYPE OF (IfcNamedUnit);
Name : IfcLabel;
ConversionFactor : IfcMeasureWithUnit;
INVERSE
END_ENTITY;

ENTITY IfcConversionBasedUnitWithOffset
SUBTYPE OF (IfcConversionBasedUnit);
ConversionOffset : IfcReal;
END_ENTITY;

ENTITY IfcDimensionalExponents;
LengthExponent : IfcStrippedOptional;
MassExponent : IfcStrippedOptional;
TimeExponent : IfcStrippedOptional;
ElectricCurrentExponent : IfcStrippedOptional;
ThermodynamicTemperatureExponent : IfcStrippedOptional;
AmountOfSubstanceExponent : IfcStrippedOptional;
LuminousIntensityExponent : IfcStrippedOptional;
END_ENTITY;

ENTITY IfcElement
SUBTYPE OF (IfcProduct);
Tag : OPTIONAL IfcStrippedOptional;
INVERSE
ConnectedTo : SET OF IfcRelConnectsElements FOR RelatingElement;
IsConnectionRealization : SET OF IfcRelConnectsWithRealizingElements FOR RealizingElements;
ConnectedFrom : SET OF IfcRelConnectsElements FOR RelatedElement;
ContainedInStructure : SET [0:1] OF IfcRelContainedInSpatialStructure FOR RelatedElements;
END_ENTITY;

ENTITY IfcElementQuantity
SUBTYPE OF (IfcQuantitySet);
MethodOfMeasurement : OPTIONAL IfcStrippedOptional;
Quantities : SET [1:?] OF IfcPhysicalQuantity;
WHERE
UniqueQuantityNames : IfcUniqueQuantityNames(Quantities);
END_ENTITY;

ENTITY IfcElementType
SUBTYPE OF (IfcTypeProduct);
ElementType : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcExternalInformation
ABSTRACT SUPERTYPE OF(IfcClassification);
END_ENTITY;

ENTITY IfcExternalReference
ABSTRACT SUPERTYPE OF(IfcClassificationReference);
Location : OPTIONAL IfcStrippedOptional;
Identification : OPTIONAL IfcIdentifier;
Name : OPTIONAL IfcStrippedOptional;
INVERSE
WHERE
WR1 : EXISTS(Identification) OR EXISTS(Location) OR EXISTS(Name);
END_ENTITY;

ENTITY IfcGroup
SUPERTYPE OF(IfcSystem)
SUBTYPE OF (IfcObject);
INVERSE
IsGroupedBy : SET OF IfcRelAssignsToGroup FOR RelatingGroup;
END_ENTITY;

ENTITY IfcMeasureWithUnit;
ValueComponent : IfcValue;
UnitComponent : IfcUnit;
END_ENTITY;

ENTITY IfcMetric
SUBTYPE OF (IfcConstraint);
Benchmark : IfcBenchmarkEnum;
ValueSource : OPTIONAL IfcStrippedOptional;
DataValue : IfcMetricValueSelect;
ReferencePath : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcNamedUnit
ABSTRACT SUPERTYPE OF(ONEOF(IfcContextDependentUnit, IfcConversionBasedUnit, IfcSIUnit));
Dimensions : IfcDimensionalExponents;
UnitType : IfcUnitEnum;
WHERE
WR1 : IfcCorrectDimensions (SELF.UnitType, SELF.Dimensions);
END_ENTITY;

ENTITY IfcObject
ABSTRACT SUPERTYPE OF(ONEOF(IfcActor, IfcControl, IfcGroup, IfcProcess, IfcProduct, IfcResource))
SUBTYPE OF (IfcObjectDefinition);
ObjectType : OPTIONAL IfcStrippedOptional;
INVERSE
IsTypedBy : SET [0:1] OF IfcRelDefinesByType FOR RelatedObjects;
IsDefinedBy : SET OF IfcRelDefinesByProperties FOR RelatedObjects;
END_ENTITY;

ENTITY IfcObjectDefinition
ABSTRACT SUPERTYPE OF(ONEOF(IfcContext, IfcObject, IfcTypeObject))
SUBTYPE OF (IfcRoot);
INVERSE
HasAssignments : SET OF IfcRelAssigns FOR RelatedObjects;
HasContext : SET [0:1] OF IfcRelDeclares FOR RelatedDefinitions;
IsDecomposedBy : SET OF IfcRelAggregates FOR RelatingObject;
Decomposes : SET [0:1] OF IfcRelAggregates FOR RelatedObjects;
HasAssociations : SET OF IfcRelAssociates FOR RelatedObjects;
END_ENTITY;

ENTITY IfcObjective
SUBTYPE OF (IfcConstraint);
BenchmarkValues : OPTIONAL LIST [1:?] OF IfcConstraint;
LogicalAggregator : OPTIONAL IfcStrippedOptional;
ObjectiveQualifier : IfcObjectiveEnum;
UserDefinedQualifier : OPTIONAL IfcStrippedOptional;
WHERE
WR21 : (ObjectiveQualifier <> IfcObjectiveEnum.USERDEFINED) OR ((ObjectiveQualifier = IfcObjectiveEnum.USERDEFINED) AND EXISTS(SELF\IfcObjective.UserDefinedQualifier));
END_ENTITY;

ENTITY IfcOrganization;
Identification : OPTIONAL IfcStrippedOptional;
Name : IfcLabel;
Description : OPTIONAL IfcText;
Roles : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
Addresses : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
INVERSE
Engages : SET OF IfcPersonAndOrganization FOR TheOrganization;
END_ENTITY;

ENTITY IfcOwnerHistory;
OwningUser : IfcPersonAndOrganization;
OwningApplication : IfcApplication;
State : OPTIONAL IfcStateEnum;
ChangeAction : OPTIONAL IfcChangeActionEnum;
LastModifiedDate : OPTIONAL IfcStrippedOptional;
LastModifyingUser : OPTIONAL IfcStrippedOptional;
LastModifyingApplication : OPTIONAL IfcStrippedOptional;
CreationDate : IfcTimeStamp;
WHERE
CorrectChangeAction : (EXISTS(LastModifiedDate)) OR (NOT(EXISTS(LastModifiedDate)) AND NOT(EXISTS(ChangeAction))) OR (NOT(EXISTS(LastModifiedDate)) AND EXISTS(ChangeAction) AND ((ChangeAction = IfcChangeActionEnum.NOTDEFINED) OR (ChangeAction = IfcChangeActionEnum.NOCHANGE)));
END_ENTITY;

ENTITY IfcPerson;
Identification : OPTIONAL IfcStrippedOptional;
FamilyName : OPTIONAL IfcStrippedOptional;
GivenName : OPTIONAL IfcStrippedOptional;
MiddleNames : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
PrefixTitles : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
SuffixTitles : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
Roles : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
Addresses : OPTIONAL LIST [1:?] OF IfcAddress;
INVERSE
EngagedIn : SET OF IfcPersonAndOrganization FOR ThePerson;
WHERE
IdentifiablePerson : EXISTS(Identification) OR EXISTS(FamilyName) OR EXISTS(GivenName);
ValidSetOfNames : NOT EXISTS(MiddleNames) OR EXISTS(FamilyName) OR EXISTS(GivenName);
END_ENTITY;

ENTITY IfcPersonAndOrganization;
ThePerson : IfcPerson;
TheOrganization : IfcOrganization;
Roles : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
END_ENTITY;

ENTITY IfcPhysicalQuantity
ABSTRACT SUPERTYPE OF(IfcPhysicalSimpleQuantity);
Name : IfcLabel;
Description : OPTIONAL IfcStrippedOptional;
INVERSE
END_ENTITY;

ENTITY IfcPhysicalSimpleQuantity
ABSTRACT SUPERTYPE OF(ONEOF(IfcQuantityArea, IfcQuantityLength))
SUBTYPE OF (IfcPhysicalQuantity);
Unit : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcPort
SUBTYPE OF (IfcProduct);
INVERSE
ConnectedFrom : SET [0:1] OF IfcRelConnectsPorts FOR RelatedPort;
ConnectedTo : SET [0:1] OF IfcRelConnectsPorts FOR RelatingPort;
END_ENTITY;

ENTITY IfcPostalAddress
SUBTYPE OF (IfcAddress);
InternalLocation : OPTIONAL IfcStrippedOptional;
AddressLines : OPTIONAL LIST [1:?] OF IfcLabel;
PostalBox : OPTIONAL IfcLabel;
Town : OPTIONAL IfcLabel;
Region : OPTIONAL IfcLabel;
PostalCode : OPTIONAL IfcLabel;
Country : OPTIONAL IfcLabel;
WHERE
WR1 : EXISTS (InternalLocation) OR EXISTS (AddressLines) OR EXISTS (PostalBox) OR EXISTS (PostalCode) OR EXISTS (Town) OR EXISTS (Region) OR EXISTS (Country);
END_ENTITY;

ENTITY IfcProcess
ABSTRACT SUPERTYPE OF(IfcTask)
SUBTYPE OF (IfcObject);
Identification : OPTIONAL IfcStrippedOptional;
LongDescription : OPTIONAL IfcStrippedOptional;
INVERSE
IsPredecessorTo : SET OF IfcRelSequence FOR RelatingProcess;
IsSuccessorFrom : SET OF IfcRelSequence FOR RelatedProcess;
END_ENTITY;

ENTITY IfcProduct
ABSTRACT SUPERTYPE OF(ONEOF(IfcAnnotation, IfcElement, IfcPort, IfcSpatialElement))
SUBTYPE OF (IfcObject);
ObjectPlacement : OPTIONAL IfcStrippedOptional;
Representation : OPTIONAL IfcStrippedOptional;
INVERSE
WHERE
PlacementForShapeRepresentation : (EXISTS(Representation) AND EXISTS(ObjectPlacement)) OR (EXISTS(Representation) AND (SIZEOF(QUERY(temp <* Representation.Representations | 'IFCREPRESENTATIONRESOURCE.IFCSHAPEREPRESENTATION' IN TYPEOF(temp))) = 0)) OR (NOT(EXISTS(Representation)));
END_ENTITY;

ENTITY IfcProject
SUBTYPE OF (IfcContext);
WHERE
HasName : EXISTS(SELF\IfcRoot.Name);
CorrectContext : NOT(EXISTS(SELF\IfcContext.RepresentationContexts)) OR (SIZEOF(QUERY(Temp <* SELF\IfcContext.RepresentationContexts | 'IFCREPRESENTATIONRESOURCE.IFCGEOMETRICREPRESENTATIONSUBCONTEXT' IN TYPEOF(Temp) )) = 0);
NoDecomposition : SIZEOF(SELF\IfcObjectDefinition.Decomposes) = 0;
HasOwnerHistory : EXISTS(SELF\IfcRoot.OwnerHistory);
END_ENTITY;

ENTITY IfcProperty
ABSTRACT SUPERTYPE OF(IfcSimpleProperty)
SUBTYPE OF (IfcPropertyAbstraction);
Name : IfcIdentifier;
Description : OPTIONAL IfcStrippedOptional;
INVERSE
PartOfPset : SET OF IfcPropertySet FOR HasProperties;
END_ENTITY;

ENTITY IfcPropertyAbstraction
ABSTRACT SUPERTYPE OF(IfcProperty);
INVERSE
END_ENTITY;

ENTITY IfcPropertyDefinition
ABSTRACT SUPERTYPE OF(IfcPropertySetDefinition)
SUBTYPE OF (IfcRoot);
INVERSE
HasContext : SET [0:1] OF IfcRelDeclares FOR RelatedDefinitions;
HasAssociations : SET OF IfcRelAssociates FOR RelatedObjects;
END_ENTITY;

ENTITY IfcPropertyEnumeratedValue
SUBTYPE OF (IfcSimpleProperty);
EnumerationValues : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
EnumerationReference : OPTIONAL IfcStrippedOptional;
WHERE
WR21 : NOT(EXISTS(EnumerationReference)) OR NOT(EXISTS(EnumerationValues)) OR (SIZEOF(QUERY(temp <* EnumerationValues | temp IN EnumerationReference.EnumerationValues)) = SIZEOF(EnumerationValues));
END_ENTITY;

ENTITY IfcPropertyReferenceValue
SUBTYPE OF (IfcSimpleProperty);
UsageName : OPTIONAL IfcStrippedOptional;
PropertyReference : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcPropertySet
SUBTYPE OF (IfcPropertySetDefinition);
HasProperties : SET [1:?] OF IfcProperty;
WHERE
ExistsName : EXISTS(SELF\IfcRoot.Name);
UniquePropertyNames : IfcUniquePropertyName(HasProperties);
END_ENTITY;

ENTITY IfcPropertySetDefinition
ABSTRACT SUPERTYPE OF(ONEOF(IfcPropertySet, IfcQuantitySet))
SUBTYPE OF (IfcPropertyDefinition);
INVERSE
DefinesType : SET OF IfcTypeObject FOR HasPropertySets;
DefinesOccurrence : SET [0:1] OF IfcRelDefinesByProperties FOR RelatingPropertyDefinition;
END_ENTITY;

ENTITY IfcPropertySingleValue
SUBTYPE OF (IfcSimpleProperty);
NominalValue : OPTIONAL IfcStrippedOptional;
Unit : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcQuantityArea
SUBTYPE OF (IfcPhysicalSimpleQuantity);
AreaValue : IfcAreaMeasure;
Formula : OPTIONAL IfcStrippedOptional;
WHERE
WR21 : NOT(EXISTS(SELF\IfcPhysicalSimpleQuantity.Unit)) OR (SELF\IfcPhysicalSimpleQuantity.Unit.UnitType = IfcUnitEnum.AREAUNIT);
WR22 : AreaValue >= 0.;
END_ENTITY;

ENTITY IfcQuantityLength
SUBTYPE OF (IfcPhysicalSimpleQuantity);
LengthValue : IfcLengthMeasure;
Formula : OPTIONAL IfcStrippedOptional;
WHERE
WR21 : NOT(EXISTS(SELF\IfcPhysicalSimpleQuantity.Unit)) OR (SELF\IfcPhysicalSimpleQuantity.Unit.UnitType = IfcUnitEnum.LENGTHUNIT);
WR22 : LengthValue >= 0.;
END_ENTITY;

ENTITY IfcQuantitySet
ABSTRACT SUPERTYPE OF(IfcElementQuantity)
SUBTYPE OF (IfcPropertySetDefinition);
END_ENTITY;

ENTITY IfcRecurrencePattern;
RecurrenceType : IfcRecurrenceTypeEnum;
DayComponent : OPTIONAL SET [1:?] OF IfcDayInMonthNumber;
WeekdayComponent : OPTIONAL SET [1:?] OF IfcDayInWeekNumber;
MonthComponent : OPTIONAL SET [1:?] OF IfcMonthInYearNumber;
Position : OPTIONAL IfcInteger;
Interval : OPTIONAL IfcInteger;
Occurrences : OPTIONAL IfcInteger;
TimePeriods : OPTIONAL LIST [1:?] OF IfcTimePeriod;
END_ENTITY;

ENTITY IfcReference;
TypeIdentifier : OPTIONAL IfcStrippedOptional;
AttributeIdentifier : OPTIONAL IfcStrippedOptional;
InstanceName : OPTIONAL IfcStrippedOptional;
ListPositions : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
InnerReference : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcRelAggregates
SUBTYPE OF (IfcRelDecomposes);
RelatingObject : IfcObjectDefinition;
RelatedObjects : SET [1:?] OF IfcObjectDefinition;
WHERE
NoSelfReference : SIZEOF(QUERY(Temp <* RelatedObjects | RelatingObject :=: Temp)) = 0;
END_ENTITY;

ENTITY IfcRelAssigns
ABSTRACT SUPERTYPE OF(ONEOF(IfcRelAssignsToControl, IfcRelAssignsToGroup))
SUBTYPE OF (IfcRelationship);
RelatedObjects : SET [1:?] OF IfcObjectDefinition;
RelatedObjectsType : OPTIONAL IfcStrippedOptional;
WHERE
WR1 : IfcCorrectObjectAssignment(RelatedObjectsType, RelatedObjects);
END_ENTITY;

ENTITY IfcRelAssignsToControl
SUBTYPE OF (IfcRelAssigns);
RelatingControl : IfcControl;
WHERE
NoSelfReference : SIZEOF(QUERY(Temp <* SELF\IfcRelAssigns.RelatedObjects | RelatingControl :=: Temp)) = 0;
END_ENTITY;

ENTITY IfcRelAssignsToGroup
SUBTYPE OF (IfcRelAssigns);
RelatingGroup : IfcGroup;
WHERE
NoSelfReference : SIZEOF(QUERY(Temp <* SELF\IfcRelAssigns.RelatedObjects | RelatingGroup :=: Temp)) = 0;
END_ENTITY;

ENTITY IfcRelAssociates
ABSTRACT SUPERTYPE OF(ONEOF(IfcRelAssociatesClassification, IfcRelAssociatesConstraint, IfcRelAssociatesDocument))
SUBTYPE OF (IfcRelationship);
RelatedObjects : SET [1:?] OF IfcDefinitionSelect;
END_ENTITY;

ENTITY IfcRelAssociatesClassification
SUBTYPE OF (IfcRelAssociates);
RelatingClassification : IfcClassificationSelect;
END_ENTITY;

ENTITY IfcRelAssociatesConstraint
SUBTYPE OF (IfcRelAssociates);
Intent : OPTIONAL IfcStrippedOptional;
RelatingConstraint : IfcConstraint;
END_ENTITY;

ENTITY IfcRelAssociatesDocument
SUBTYPE OF (IfcRelAssociates);
RelatingDocument : IfcDocumentSelect;
END_ENTITY;

ENTITY IfcRelConnects
ABSTRACT SUPERTYPE OF(ONEOF(IfcRelConnectsElements, IfcRelConnectsPorts, IfcRelContainedInSpatialStructure, IfcRelSequence))
SUBTYPE OF (IfcRelationship);
END_ENTITY;

ENTITY IfcRelConnectsElements
SUPERTYPE OF(IfcRelConnectsWithRealizingElements)
SUBTYPE OF (IfcRelConnects);
ConnectionGeometry : OPTIONAL IfcStrippedOptional;
RelatingElement : IfcElement;
RelatedElement : IfcElement;
WHERE
NoSelfReference : RelatingElement :<>: RelatedElement;
END_ENTITY;

ENTITY IfcRelConnectsPorts
SUBTYPE OF (IfcRelConnects);
RelatingPort : IfcPort;
RelatedPort : IfcPort;
RealizingElement : OPTIONAL IfcStrippedOptional;
WHERE
NoSelfReference : RelatingPort :<>: RelatedPort;
END_ENTITY;

ENTITY IfcRelConnectsWithRealizingElements
SUBTYPE OF (IfcRelConnectsElements);
RealizingElements : SET [1:?] OF IfcElement;
ConnectionType : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcRelContainedInSpatialStructure
SUBTYPE OF (IfcRelConnects);
RelatedElements : SET [1:?] OF IfcProduct;
RelatingStructure : IfcSpatialElement;
WHERE
WR31 : SIZEOF(QUERY(temp <* RelatedElements | 'IFCPRODUCTEXTENSION.IFCSPATIALSTRUCTUREELEMENT' IN TYPEOF(temp))) = 0;
END_ENTITY;

ENTITY IfcRelDeclares
SUBTYPE OF (IfcRelationship);
RelatingContext : IfcContext;
RelatedDefinitions : SET [1:?] OF IfcDefinitionSelect;
WHERE
NoSelfReference : SIZEOF(QUERY(Temp <* RelatedDefinitions | RelatingContext :=: Temp)) = 0;
END_ENTITY;

ENTITY IfcRelDecomposes
ABSTRACT SUPERTYPE OF(IfcRelAggregates)
SUBTYPE OF (IfcRelationship);
END_ENTITY;

ENTITY IfcRelDefines
ABSTRACT SUPERTYPE OF(ONEOF(IfcRelDefinesByProperties, IfcRelDefinesByType))
SUBTYPE OF (IfcRelationship);
END_ENTITY;

ENTITY IfcRelDefinesByProperties
SUBTYPE OF (IfcRelDefines);
RelatedObjects : SET [1:1] OF IfcObjectDefinition;
RelatingPropertyDefinition : IfcPropertySetDefinitionSelect;
END_ENTITY;

ENTITY IfcRelDefinesByType
SUBTYPE OF (IfcRelDefines);
RelatedObjects : SET [1:?] OF IfcObject;
RelatingType : IfcTypeObject;
END_ENTITY;

ENTITY IfcRelSequence
SUBTYPE OF (IfcRelConnects);
RelatingProcess : IfcProcess;
RelatedProcess : IfcProcess;
TimeLag : OPTIONAL IfcStrippedOptional;
SequenceType : OPTIONAL IfcStrippedOptional;
UserDefinedSequenceType : OPTIONAL IfcStrippedOptional;
WHERE
AvoidInconsistentSequence : RelatingProcess :<>: RelatedProcess;
CorrectSequenceType : (SequenceType <> IfcSequenceEnum.USERDEFINED) OR ((SequenceType = IfcSequenceEnum.USERDEFINED) AND EXISTS(UserDefinedSequenceType));
END_ENTITY;

ENTITY IfcRelationship
ABSTRACT SUPERTYPE OF(ONEOF(IfcRelAssigns, IfcRelAssociates, IfcRelConnects, IfcRelDeclares, IfcRelDecomposes, IfcRelDefines))
SUBTYPE OF (IfcRoot);
END_ENTITY;

ENTITY IfcResource
ABSTRACT SUPERTYPE OF(IfcConstructionResource)
SUBTYPE OF (IfcObject);
Identification : OPTIONAL IfcStrippedOptional;
LongDescription : OPTIONAL IfcStrippedOptional;
INVERSE
END_ENTITY;

ENTITY IfcRoot
ABSTRACT SUPERTYPE OF(ONEOF(IfcObjectDefinition, IfcPropertyDefinition, IfcRelationship));
GlobalId : IfcGloballyUniqueId;
OwnerHistory : OPTIONAL IfcOwnerHistory;
Name : OPTIONAL IfcLabel;
Description : OPTIONAL IfcText;
UNIQUE
UR1 : GlobalId;
END_ENTITY;

ENTITY IfcSIUnit
SUBTYPE OF (IfcNamedUnit);
Prefix : OPTIONAL IfcSIPrefix;
Name : IfcSIUnitName;
DERIVE
SELF\IfcNamedUnit.Dimensions : IfcDimensionalExponents := IfcDimensionsForSiUnit (SELF.Name);
END_ENTITY;

ENTITY IfcSchedulingTime
ABSTRACT SUPERTYPE OF(IfcTaskTime);
Name : OPTIONAL IfcStrippedOptional;
DataOrigin : OPTIONAL IfcStrippedOptional;
UserDefinedDataOrigin : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcSimpleProperty
ABSTRACT SUPERTYPE OF(ONEOF(IfcPropertyEnumeratedValue, IfcPropertyReferenceValue, IfcPropertySingleValue))
SUBTYPE OF (IfcProperty);
END_ENTITY;

ENTITY IfcSite
SUBTYPE OF (IfcSpatialStructureElement);
RefLatitude : OPTIONAL IfcStrippedOptional;
RefLongitude : OPTIONAL IfcStrippedOptional;
RefElevation : OPTIONAL IfcStrippedOptional;
LandTitleNumber : OPTIONAL IfcStrippedOptional;
SiteAddress : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcSpace
SUBTYPE OF (IfcSpatialStructureElement);
PredefinedType : OPTIONAL IfcStrippedOptional;
ElevationWithFlooring : OPTIONAL IfcStrippedOptional;
INVERSE
WHERE
CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR (PredefinedType <> IfcSpaceTypeEnum.USERDEFINED) OR ((PredefinedType = IfcSpaceTypeEnum.USERDEFINED) AND EXISTS (SELF\IfcObject.ObjectType));
CorrectTypeAssigned : (SIZEOF(IsTypedBy) = 0) OR ('IFCPRODUCTEXTENSION.IFCSPACETYPE' IN TYPEOF(SELF\IfcObject.IsTypedBy[1].RelatingType));
END_ENTITY;

ENTITY IfcSpatialElement
ABSTRACT SUPERTYPE OF(IfcSpatialStructureElement)
SUBTYPE OF (IfcProduct);
LongName : OPTIONAL IfcStrippedOptional;
INVERSE
ContainsElements : SET OF IfcRelContainedInSpatialStructure FOR RelatingStructure;
END_ENTITY;

ENTITY IfcSpatialStructureElement
ABSTRACT SUPERTYPE OF(ONEOF(IfcBuilding, IfcBuildingStorey, IfcSite, IfcSpace))
SUBTYPE OF (IfcSpatialElement);
CompositionType : OPTIONAL IfcStrippedOptional;
WHERE
WR41 : (HIINDEX(SELF\IfcObjectDefinition.Decomposes) = 1) AND ('IFCKERNEL.IFCRELAGGREGATES' IN TYPEOF(SELF\IfcObjectDefinition.Decomposes[1])) AND (('IFCKERNEL.IFCPROJECT' IN TYPEOF (SELF\IfcObjectDefinition.Decomposes[1].RelatingObject)) OR ('IFCPRODUCTEXTENSION.IFCSPATIALSTRUCTUREELEMENT' IN TYPEOF (SELF\IfcObjectDefinition.Decomposes[1].RelatingObject)) );
END_ENTITY;

ENTITY IfcSystem
SUPERTYPE OF(IfcZone)
SUBTYPE OF (IfcGroup);
INVERSE
END_ENTITY;

ENTITY IfcTable;
Name : OPTIONAL IfcLabel;
Rows : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
Columns : OPTIONAL LIST [1:?] OF IfcTableColumn;
DERIVE
NumberOfCellsInRow : INTEGER := HIINDEX(Rows[1].RowCells);
NumberOfHeadings : INTEGER := SIZEOF(QUERY( Temp <* Rows | Temp.IsHeading));
NumberOfDataRows : INTEGER := SIZEOF(QUERY( Temp <* Rows | NOT(Temp.IsHeading)));
WHERE
WR1 : SIZEOF(QUERY( Temp <* Rows | HIINDEX(Temp.RowCells) <> HIINDEX(Rows[1].RowCells))) = 0;
WR2 : { 0 <= NumberOfHeadings <= 1 };
END_ENTITY;

ENTITY IfcTableColumn;
Identifier : OPTIONAL IfcStrippedOptional;
Name : OPTIONAL IfcLabel;
Description : OPTIONAL IfcText;
Unit : OPTIONAL IfcUnit;
ReferencePath : OPTIONAL IfcReference;
END_ENTITY;

ENTITY IfcTask
SUBTYPE OF (IfcProcess);
Status : OPTIONAL IfcStrippedOptional;
WorkMethod : OPTIONAL IfcStrippedOptional;
IsMilestone : IfcStrippedOptional;
Priority : OPTIONAL IfcStrippedOptional;
TaskTime : OPTIONAL IfcTaskTime;
PredefinedType : OPTIONAL IfcStrippedOptional;
WHERE
HasName : EXISTS(SELF\IfcRoot.Name);
CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR (PredefinedType <> IfcTaskTypeEnum.USERDEFINED) OR ((PredefinedType = IfcTaskTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcObject.ObjectType));
END_ENTITY;

ENTITY IfcTaskTime
SUPERTYPE OF(IfcTaskTimeRecurring)
SUBTYPE OF (IfcSchedulingTime);
DurationType : OPTIONAL IfcStrippedOptional;
ScheduleDuration : OPTIONAL IfcDuration;
ScheduleStart : OPTIONAL IfcDateTime;
ScheduleFinish : OPTIONAL IfcDateTime;
EarlyStart : OPTIONAL IfcStrippedOptional;
EarlyFinish : OPTIONAL IfcStrippedOptional;
LateStart : OPTIONAL IfcStrippedOptional;
LateFinish : OPTIONAL IfcStrippedOptional;
FreeFloat : OPTIONAL IfcStrippedOptional;
TotalFloat : OPTIONAL IfcStrippedOptional;
IsCritical : OPTIONAL IfcStrippedOptional;
StatusTime : OPTIONAL IfcStrippedOptional;
ActualDuration : OPTIONAL IfcStrippedOptional;
ActualStart : OPTIONAL IfcStrippedOptional;
ActualFinish : OPTIONAL IfcStrippedOptional;
RemainingTime : OPTIONAL IfcStrippedOptional;
Completion : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcTaskTimeRecurring
SUBTYPE OF (IfcTaskTime);
Recurrance : IfcRecurrencePattern;
END_ENTITY;

ENTITY IfcTelecomAddress
SUBTYPE OF (IfcAddress);
TelephoneNumbers : OPTIONAL LIST [1:?] OF IfcLabel;
FacsimileNumbers : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
PagerNumber : OPTIONAL IfcStrippedOptional;
ElectronicMailAddresses : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
WWWHomePageURL : OPTIONAL IfcStrippedOptional;
MessagingIDs : OPTIONAL LIST [1:?] OF IfcStrippedOptional;
WHERE
MinimumDataProvided : EXISTS (TelephoneNumbers) OR EXISTS (FacsimileNumbers) OR EXISTS (PagerNumber) OR EXISTS (ElectronicMailAddresses) OR EXISTS (WWWHomePageURL) OR EXISTS (MessagingIDs);
END_ENTITY;

ENTITY IfcTimePeriod;
StartTime : IfcTime;
EndTime : IfcTime;
END_ENTITY;

ENTITY IfcTypeObject
SUPERTYPE OF(ONEOF(IfcTypeProduct, IfcTypeResource))
SUBTYPE OF (IfcObjectDefinition);
ApplicableOccurrence : OPTIONAL IfcStrippedOptional;
HasPropertySets : OPTIONAL SET [1:?] OF IfcPropertySetDefinition;
INVERSE
Types : SET [0:1] OF IfcRelDefinesByType FOR RelatingType;
WHERE
WR1 : EXISTS(SELF\IfcRoot.Name);
END_ENTITY;

ENTITY IfcTypeProduct
SUPERTYPE OF(IfcElementType)
SUBTYPE OF (IfcTypeObject);
RepresentationMaps : OPTIONAL LIST [1:?] OF UNIQUE IfcStrippedOptional;
Tag : OPTIONAL IfcStrippedOptional;
INVERSE
WHERE
ApplicableOccurrence : NOT(EXISTS(SELF\IfcTypeObject.Types[1])) OR (SIZEOF(QUERY(temp <* SELF\IfcTypeObject.Types[1].RelatedObjects | NOT('IFCKERNEL.IFCPRODUCT' IN TYPEOF(temp))) ) = 0);
END_ENTITY;

ENTITY IfcTypeResource
ABSTRACT SUPERTYPE OF(IfcConstructionResourceType)
SUBTYPE OF (IfcTypeObject);
Identification : OPTIONAL IfcStrippedOptional;
LongDescription : OPTIONAL IfcStrippedOptional;
ResourceType : OPTIONAL IfcStrippedOptional;
INVERSE
END_ENTITY;

ENTITY IfcUnitAssignment;
Units : SET [1:?] OF IfcUnit;
WHERE
WR01 : IfcCorrectUnitAssignment(Units);
END_ENTITY;

ENTITY IfcWorkControl
ABSTRACT SUPERTYPE OF(IfcWorkSchedule)
SUBTYPE OF (IfcControl);
CreationDate : IfcDateTime;
Creators : OPTIONAL SET [1:?] OF IfcStrippedOptional;
Purpose : OPTIONAL IfcStrippedOptional;
Duration : OPTIONAL IfcStrippedOptional;
TotalFloat : OPTIONAL IfcStrippedOptional;
StartTime : IfcDateTime;
FinishTime : OPTIONAL IfcStrippedOptional;
END_ENTITY;

ENTITY IfcWorkSchedule
SUBTYPE OF (IfcWorkControl);
PredefinedType : OPTIONAL IfcStrippedOptional;
WHERE
CorrectPredefinedType : NOT(EXISTS(PredefinedType)) OR (PredefinedType <> IfcWorkScheduleTypeEnum.USERDEFINED) OR ((PredefinedType = IfcWorkScheduleTypeEnum.USERDEFINED) AND EXISTS(SELF\IfcObject.ObjectType));
END_ENTITY;

ENTITY IfcZone
SUBTYPE OF (IfcSystem);
LongName : OPTIONAL IfcStrippedOptional;
WHERE
WR1 : (SIZEOF(SELF\IfcGroup.IsGroupedBy) = 0) OR (SIZEOF (QUERY (temp <* SELF\IfcGroup.IsGroupedBy[1].RelatedObjects | NOT(('IFCPRODUCTEXTENSION.IFCZONE' IN TYPEOF(temp)) OR ('IFCPRODUCTEXTENSION.IFCSPACE' IN TYPEOF(temp)) OR ('IFCPRODUCTEXTENSION.IFCSPATIALZONE' IN TYPEOF(temp)) ))) = 0);
END_ENTITY;

RULE IfcSingleProjectInstance FOR ( IfcProject );
    WHERE
     WR1 : SIZEOF(IfcProject) <= 1
END_RULE;


END_SCHEMA;