In this article, a formal approach for modeling central concepts of context-awareness in ubiquitous and mobile computing is introduced. The focus is on an appropriate handling of issues of vagueness and granularity in ubiquitous computing environments. A formalization of perceptual and sensory uncertainty and a characterization of granularity axe applied for modeling three central aspects of context-awareness: context as retrieved from sensors, context for representing relevance, and context as unfocussed background information. The notions are developed and demonstrated with respect to the special case of spatial contexts, but are sufficiently general to also cover other types of context. Use of the characterized concepts is motivated with an example of ongoing work on ontology design for ubiquitous computing environments.