Spatial Composition for building separation wall

Helloeveryone,
I have a question concerning the spatial decomposition with IFC. In the schema it is stated: “an element can only be contained within a single spatial structure element”.
How do I handle Building separation wall in multi-family houses / terraced houses? They belong somehow to 2 different IfcBuilding/ IfcBuildingStorey.
Any idea how to adress that issue? Is there a correct solution? At the moment I’m thinking of 2 options:

  1. I can not decompose my 2 houses in 2 different IfcBuilding. I need to have only one.
  2. I have to choose where the wall belongs to and one IfcBuilding will have a missing wallelement.

I would be happy if anyone knows a correct solution here or if I am missing something in the schema.

An element may only have one primary containment, thus having a hierarchical structure.

If an element has multiple spatial locations, like a multistorey column, or a dividing wall, door, or so on, you can use IfcRelReferencedInSpatialStructure.

Great, then I understood it correctly.
So in the project I need to define where my building separation wall belongs to with IfcRelContainedInSpatialStructure and additionally reference the other building with IfcRelReferencedInSpatialStructure.