In this paper we present CoWSAMI, a middleware infrastructure that enables context awareness in open ambient intelligence environments, consisting of mobile users and context sources that become dynamically available as the users move from one location to another. A central requirement in such dynamic scenarios is to be able to integrate new context sources and users at run-time. CoWSAMI exploits a novel approach towards this goal. The proposed approach is based on utilizing Web services as interfaces to context sources and dynamically updatable relational views for storing, aggregating and interpreting context. Context rules are employed to provide mappings that specify how to populate context relations, with respect to the different context sources that become dynamically available. An underlying context sources discovery mechanism is utilized to maintain context information up to date as context sources, and users get dynamically involved. c 2007 Elsevier B.V. All rights reserved.