Clinical practice guidelines (CPGs) constitute a systematically developed, critical body of medical knowledge which is compiled and maintained in order to assist healthcare professionals in decision making. They are available for diverse diseases/conditions and routinely used in many countries, providing reference material for healthcare delivery in clinical settings. As CPGs are paper-based, i.e. plain documents, there have been various approaches for their computerization and expression in a formal manner so that they can be incorporated in clinical information and decision support systems. Semantic Web technologies and ontologies have been extensively used for CPG formalization. In this paper, we present a novel method for the representation and execution of CPGs using OWL ontologies and SPARQL-based inference rules. The proposed approach is capable of expressing complex CPG constructs and can be used to express formalisms, such as negations, which are hard to express using ontologies alone. The encapsulation of SPARQL rules in the CPG ontology is based on the SPARQL Inference Notation (SPIN). The proposed representation of different aspects of CPGs, such as numerical comparisons, calculations, decision branches and state transitions, and their execution is demonstrated through the respective parts of comprehensive, though complex enough, CPGs for arterial hypertension management. The paper concludes by comparing the proposed approach with other relevant works, indicating its potential and limitations, as well as a future work directions.