In order to model a context and adapt it to any domain, it is necessary an ontology that captures generic concepts to a higher level. The context model must provide mechanisms to extend the specific information of a context in a hierarchical manner. In this paper, we propose CAMeOnto, an ontology with these characteristics, based on the principles of 5Ws: who, when, what, where and why. CAMeOnto is used by CARMiCLOC, a reflective middleware for context-aware applications, and is instantiated in several case studies, in order to test how CAMeOnto works correctly and can reason to infer information about the context.