Ontology matching and alignment are key mechanism for linking the diverse datasets and ontologies arising in the Semantic Web and other application areas for formalised ontologies. We show that category theory provides the powerful abstractions needed for a uniform treatment of ontology alignment at various levels: semantics, language design, reasoning and tools. The general representation and reasoning framework that we propose includes: (1) an abstract notion of logical system, consisting of a logic syntax and a model theory, based on an extension of institutions with additional features specific to alignments, (2) a declarative language to specify networks of ontologies and alignments, with independent control over specifying local ontologies and complex alignment relations, based on and improving the Distributed Ontology, Model and Specification Language DOL, (3) the possibility to align logically heterogeneous ontologies, and (4) the provision of generic proof support for global reasoning over networks of aligned ontologies, employing different semantics. In particular, we show how the three semantics of Zimmermann and Euzenat can be uniformly and faithfully represented using $$\mathsf {DOL}$$ language constructs, by refining them into four different kinds of semantics: simple, integrated (general and inclusive), and contextualised. Finally, we discuss the implementation of the $$\mathsf {DOL}$$ alignment features in the Ontohub/Hets tool system.