To support mass customization for industrialized construction, researchers and industry have adopted product configuration strategies. Based on the theory of modularization, pre-defined module libraries can be configured into feasible construction projects. However, the digital representation of configuration knowledge is understudied. Current Building Information Modeling (BIM) product modeling does not enable automatic generation and reasoning of configuration solutions for new products. This study proposes an ontology-based strategy to configure modular buildings. The proposed BIM-to-ontology workflow collects and formalizes configuration constraints. In particular, we elaborate on how those constraints can be modeled within the ontology in a modular building case. The ontology maintains the product hierarchy needed for product assembly. Such ontology development can support the rapid development of new products with customized variations. The paper identifies the limitations of the current product modeling approach. The proposed ontology can act as a foundation for BIM-based product platform development and increase the use of mass customization for industrialized construction.