I am parsing the IFC4.exp to store the specification as a graph. All seems good, but I sometimes find “deviating” patterns. For instance in the EXPRESS definition of IfcElement
ENTITY IfcElement
ABSTRACT SUPERTYPE OF (ONEOF
(IfcBuildingElement ,IfcCivilElement, IfcDistributionElement, IfcElementAssembly, IfcElementComponent, IfcFeatureElement, IfcFurnishingElement, IfcGeographicElement, IfcTransportElement, IfcVirtualElement))
SUBTYPE OF (IfcProduct);
Tag : OPTIONAL IfcIdentifier;
INVERSE
FillsVoids : SET [0:1] OF IfcRelFillsElement FOR RelatedBuildingElement;
ConnectedTo : SET [0:?] OF IfcRelConnectsElements FOR RelatingElement;
IsInterferedByElements : SET [0:?] OF IfcRelInterferesElements FOR RelatedElement;
InterferesElements : SET [0:?] OF IfcRelInterferesElements FOR RelatingElement;
HasProjections : SET [0:?] OF IfcRelProjectsElement FOR RelatingElement;
ReferencedInStructures : SET [0:?] OF IfcRelReferencedInSpatialStructure FOR RelatedElements;
HasOpenings : SET [0:?] OF IfcRelVoidsElement FOR RelatingBuildingElement;
IsConnectionRealization : SET [0:?] OF IfcRelConnectsWithRealizingElements FOR RealizingElements;
ProvidesBoundaries : SET [0:?] OF IfcRelSpaceBoundary FOR RelatedBuildingElement;
ConnectedFrom : SET [0:?] OF IfcRelConnectsElements FOR RelatedElement;
ContainedInStructure : SET [0:1] OF IfcRelContainedInSpatialStructure FOR RelatedElements;
HasCoverings : SET [0:?] OF IfcRelCoversBldgElements FOR RelatingBuildingElement;
END_ENTITY;
9 out of 11 INVERSE attributes refer to an IfcRel entity that links back to IfcElement
. The two others
ReferencedInStructures : SET [0:?] OF IfcRelReferencedInSpatialStructure FOR RelatedElements;
ContainedInStructure : SET [0:1] OF IfcRelContainedInSpatialStructure FOR RelatedElements;
refer to an IfcRel entity that refers back to IfcProduct
.
ENTITY IfcRelReferencedInSpatialStructure
SUBTYPE OF (IfcRelConnects);
RelatedElements : SET [1:?] OF IfcProduct;
RelatingStructure : IfcSpatialElement;
WHERE
AllowedRelatedElements : SIZEOF(QUERY(temp <* RelatedElements | ('IFC4.IFCSPATIALSTRUCTUREELEMENT' IN TYPEOF(temp)) AND (NOT ('IFC4.IFCSPACE' IN TYPEOF(temp)))
)) = 0;
END_ENTITY;
ENTITY IfcRelContainedInSpatialStructure
SUBTYPE OF (IfcRelConnects);
RelatedElements : SET [1:?] OF IfcProduct;
RelatingStructure : IfcSpatialElement;
WHERE
WR31 : SIZEOF(QUERY(temp <* RelatedElements | 'IFC4.IFCSPATIALSTRUCTUREELEMENT' IN TYPEOF(temp))) = 0;
END_ENTITY;
My question: wouldn’t it be more consistent if these two INVERSE attributes were part of the IfcProduct
Express definition?