The unambiguous and effective delivery of data and knowledge on the Web relies heavily on the correct representation and understanding of the associated contexts. However, the current way of encoding data and knowledge on the Web is largely ad hoc. Contexts are often embedded in the application program or are implied by the application- or community-specific agreements. This makes the linking and reusing of data and knowledge, and thus the integration of Web applications, a difficult problem. Therefore, building the architectural support for contexts is one of the major challenges for the Web, and in particular, for the Semantic Web. In this paper, we propose a framework for contexts that provides formal and explicit representations for the usually implicit contextual assumptions of data and knowledge on the Web. This is done by supporting the description of logic institutions, relations of contexts, and provenance. Our framework is able to tackle some critical issues for extending Web as a ``Social Machine'', such as, permitting different views on the same data, faithful knowledge integration and situation awareness.