Ontology concerns itself with the representation of the objects in the universe and the web of their various connections. The traditional task of ontologists has been to extract from this tangle a single ordered structure, in the form of a tree or lattice. This structure consists of the terms that represent the objects, and the relationships that represent connections between objects. Recent work in ontology goes so far as to consider several distinct, superimposed structures, which each represent a classification of the universe according to a particular criterion. Our purpose is to defer the task of globally classifying terms and relationships. Instead, we focus on composing them for use as we need them. We define contexts to be our unit of encapsulation for ontologies, and use a rule-based algebra to compose novel ontological structures within them. We separate context from concept, the unit of ontological abstraction. Also, we distinguish composition from subsumption, or containment, the relationships which commonly provide structure to ontologies. Adding a formal notion of encapsulation and composition to ontologies leads to more dynamic and maintainable structures, and, we believe, greater computational efficiency for knowledge bases.