I am not that much experienced with CityGML. But I can suggest couple of points for IFC.
As you may already know IFC EXPRESS has a graph-based data structure which means there are semantic relationships between entities. There are already some research studies to represent IFC in Resource Description Framework (RDF), and publish in semantic web. IfcOwl is the ontology model of IFC which includes the semantic relationship of building data (not sure whether includes the geometrical semantics). Besides, The open source IfcOpenShell library also provides tons of functionalities to explore the roots of IFC. If you are not familiar with coding, simplest way to export the semantic data from a BIM-tool. Solibri Model Checker is a good one which you can export relationships between entities with its Information Takeoff page.
For geometry, all I am able say is about exploring "bounding box"es of elements. However, there should be some other semantic contexts that might be available already.