In recent years, there has been a significant growth of context-aware applications, which extract the user's context from multiple embedded sensors in smartphones and wearable sensors. However, running multiple context-aware applications simultaneously causes extensive battery drainage for mobile devices. To alleviate the energy limitation in multi-context setting, we propose EGO: an ontology-based framework for group sensor selection to achieve synergy across applications while trading off energy consumption, accuracy, and delay in context recognition. A new context recognition ontology is designed to capture context recognition models. It captures the alternative groups of sensors for each context and the parameters for context recognition models. EGO includes an adaptive sensor selection mechanism that selects the appropriate sensors based on the current user state, the available resources, and the requested accuracies by running applications. The framework provides an open architecture that allows integration with other sensor optimization modules for sensor scheduling. EGO is validated using a real test-bed implemented on an Android platform that provides accessibility to on-board mobile sensors and external sensors. Results show that EGO provides better trade-off than previous state-of-the-art methods. Furthermore, EGO provides 63 percent energy saving with comparable accuracy when compared to the most accurate group of sensors.