We present SWAP (Semantic Web application pyramid), a framework for incorporating ontologies in data-oriented semantic Web applications. We have implemented this framework with a measurement ontology for a quality management Web service. This quality management Web service is built on top of a set of XML Web services implementing agents representing quality management clients, quality management servers, and vendors. SWAP facilitates data exchange between these Web services with vendor data stored in databases, and the processing of the data using a combination of RuleML and SQL. The testbed implementation demonstrates the feasibility and scalability of the framework for any type of three-tier ontology-based semantic Web applications involving low to moderate data exchange. We discuss methods for improving this framework for high data exchange volumes as well. The primary contribution of this framework is in the component-based implementation of real-world semantic Web applications.