(*
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 IFCPROPERTYRESOURCE;

REFERENCE FROM IFCMEASURERESOURCE
(
  IfcValue,
  IfcUnit,
  IfcDerivedUnit,
  IfcNamedUnit,
  IfcContextDependentUnit,
  IfcConversionBasedUnit,
  IfcSiUnit,
  IfcMeasureValue,
  IfcLabel,
  IfcIdentifier,
  IfcReal,
  IfcLengthMeasure,
  IfcAreaMeasure,
  IfcVolumeMeasure,
  IfcRatioMeasure,
  IfcText
);

REFERENCE FROM IFCACTORRESOURCE
(
  IfcPerson,
  IfcOrganization,
  IfcPostalAddress,
  IfcPersonAndOrganization,
  IfcAddress
);

REFERENCE FROM IFCMATERIALRESOURCE
(
  IfcMaterialDefinition
);

REFERENCE FROM IFCEXTERNALREFERENCERESOURCE
(
  IfcDocumentReference,
  IfcLibraryReference,
  IfcClassificationReference,
  IfcExternalReference,
  IfcExternalReferenceRelationship,
  IfcResourceLevelRelationship
);

REFERENCE FROM IFCDATETIMERESOURCE
(
  IfcTimeSeries
);

REFERENCE FROM IFCCOSTRESOURCE
(
  IfcAppliedValue
);

REFERENCE FROM IFCUTILITYRESOURCE
(
  IfcTable
);

REFERENCE FROM IFCKERNEL
(
  IfcPropertySet
);

REFERENCE FROM IFCCONSTRAINTRESOURCE
(
  IfcResourceConstraintRelationship
);

REFERENCE FROM IFCAPPROVALRESOURCE
(
  IfcResourceApprovalRelationship
);

TYPE IfcCurveInterpolationEnum = ENUMERATION OF
	(LINEAR
	,LOG_LINEAR
	,LOG_LOG
	,NOTDEFINED);
END_TYPE;

TYPE IfcObjectReferenceSelect = SELECT
	(IfcAddress
	,IfcAppliedValue
	,IfcExternalReference
	,IfcMaterialDefinition
	,IfcOrganization
	,IfcPerson
	,IfcPersonAndOrganization
	,IfcTable
	,IfcTimeSeries);
END_TYPE;

ENTITY IfcComplexProperty
 SUBTYPE OF (IfcProperty);
	UsageName : IfcIdentifier;
	HasProperties : SET [1:?] OF IfcProperty;
 WHERE
	WR21 : SIZEOF(QUERY(temp <* HasProperties | SELF :=: temp)) = 0;
	WR22 : IfcUniquePropertyName(HasProperties);
END_ENTITY;

ENTITY IfcExtendedProperties
 ABSTRACT SUPERTYPE OF (ONEOF
    (IfcMaterialProperties
    ,IfcProfileProperties))
 SUBTYPE OF (IfcPropertyAbstraction);
	Name : OPTIONAL IfcIdentifier;
	Description : OPTIONAL IfcText;
	Properties : SET [1:?] OF IfcProperty;
END_ENTITY;

ENTITY IfcPreDefinedProperties
 ABSTRACT SUPERTYPE OF (ONEOF
    (IfcReinforcementBarProperties
    ,IfcSectionProperties
    ,IfcSectionReinforcementProperties))
 SUBTYPE OF (IfcPropertyAbstraction);
END_ENTITY;

ENTITY IfcProperty
 ABSTRACT SUPERTYPE OF (ONEOF
    (IfcComplexProperty
    ,IfcSimpleProperty))
 SUBTYPE OF (IfcPropertyAbstraction);
	Name : IfcIdentifier;
	Description : OPTIONAL IfcText;
 INVERSE
	PartOfPset : SET [0:?] OF IfcPropertySet FOR HasProperties;
	PropertyForDependance : SET [0:?] OF IfcPropertyDependencyRelationship FOR DependingProperty;
	PropertyDependsOn : SET [0:?] OF IfcPropertyDependencyRelationship FOR DependantProperty;
	PartOfComplex : SET [0:?] OF IfcComplexProperty FOR HasProperties;
	HasConstraints : SET [0:?] OF IfcResourceConstraintRelationship FOR RelatedResourceObjects;
	HasApprovals : SET [0:?] OF IfcResourceApprovalRelationship FOR RelatedResourceObjects;
END_ENTITY;

ENTITY IfcPropertyAbstraction
 ABSTRACT SUPERTYPE OF (ONEOF
    (IfcExtendedProperties
    ,IfcPreDefinedProperties
    ,IfcProperty
    ,IfcPropertyEnumeration));
 INVERSE
	HasExternalReferences : SET [0:?] OF IfcExternalReferenceRelationship FOR RelatedResourceObjects;
END_ENTITY;

ENTITY IfcPropertyBoundedValue
 SUBTYPE OF (IfcSimpleProperty);
	UpperBoundValue : OPTIONAL IfcValue;
	LowerBoundValue : OPTIONAL IfcValue;
	Unit : OPTIONAL IfcUnit;
	SetPointValue : OPTIONAL IfcValue;
 WHERE
	SameUnitUpperLower : NOT(EXISTS(UpperBoundValue)) OR NOT(EXISTS(LowerBoundValue)) OR
(TYPEOF(UpperBoundValue) = TYPEOF(LowerBoundValue));
	SameUnitUpperSet : NOT(EXISTS(UpperBoundValue)) OR NOT(EXISTS(SetPointValue)) OR
(TYPEOF(UpperBoundValue) = TYPEOF(SetPointValue));
	SameUnitLowerSet : NOT(EXISTS(LowerBoundValue)) OR NOT(EXISTS(SetPointValue)) OR
(TYPEOF(LowerBoundValue) = TYPEOF(SetPointValue));
END_ENTITY;

ENTITY IfcPropertyDependencyRelationship
 SUBTYPE OF (IfcResourceLevelRelationship);
	DependingProperty : IfcProperty;
	DependantProperty : IfcProperty;
	Expression : OPTIONAL IfcText;
 WHERE
	NoSelfReference : DependingProperty :<>: DependantProperty;
END_ENTITY;

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

ENTITY IfcPropertyEnumeration
 SUBTYPE OF (IfcPropertyAbstraction);
	Name : IfcLabel;
	EnumerationValues : LIST [1:?] OF IfcValue;
	Unit : OPTIONAL IfcUnit;
 UNIQUE
	UR1 : Name;
 WHERE
	WR01 : SIZEOF(QUERY(temp <* SELF.EnumerationValues | 
  NOT(TYPEOF(SELF.EnumerationValues[1]) = TYPEOF(temp))
  )) = 0;
END_ENTITY;

ENTITY IfcPropertyListValue
 SUBTYPE OF (IfcSimpleProperty);
	ListValues : OPTIONAL LIST [1:?] OF IfcValue;
	Unit : OPTIONAL IfcUnit;
 WHERE
	WR31 : SIZEOF(QUERY(temp <* SELF.ListValues | 
  NOT(TYPEOF(SELF.ListValues[1]) = TYPEOF(temp))
  )) = 0;
END_ENTITY;

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

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

ENTITY IfcPropertyTableValue
 SUBTYPE OF (IfcSimpleProperty);
	DefiningValues : OPTIONAL LIST [1:?] OF IfcValue;
	DefinedValues : OPTIONAL LIST [1:?] OF IfcValue;
	Expression : OPTIONAL IfcText;
	DefiningUnit : OPTIONAL IfcUnit;
	DefinedUnit : OPTIONAL IfcUnit;
	CurveInterpolation : OPTIONAL IfcCurveInterpolationEnum;
 WHERE
	WR21 : (NOT(EXISTS(DefiningValues)) AND NOT(EXISTS(DefinedValues)))
OR (SIZEOF(DefiningValues) = SIZEOF(DefinedValues));
	WR22 : NOT(EXISTS(DefiningValues)) OR 
(SIZEOF(QUERY(temp <* SELF.DefiningValues | TYPEOF(temp) <> TYPEOF(SELF.DefiningValues[1])
)) = 0);
	WR23 : NOT(EXISTS(DefinedValues)) OR 
(SIZEOF(QUERY(temp <* SELF.DefinedValues | TYPEOF(temp) <> TYPEOF(SELF.DefinedValues[1])
)) = 0);
END_ENTITY;

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

END_SCHEMA;
