This paper presents a framework for context-aware applications, with a particular focus on collaboration and pervasiveness. The framework relies on distributed ontologies, which are shared components spread over a network. The architecture of the framework provides for the coexistence of devices with different nature and computing capabilities. The framework implements a peer-topeer model, encompassing three kinds of peer: ontology-management, contextmanagement, and interaction-management peers. The problem of supporting cooperative work practices in heterogeneous, pervasive computing environments is tackled, in particular with respect to the case of hospital settings.