Compliance checking for clinical pathways (CPs) is getting increasing attention in health-care organizations due to stricter requirements for cost control and treatment excellence. Many compliance measures have been proposed for treatment behavior inspection in CPs. However, most of them look at aggregated data seen from an external perspective, e.g. length of stay, cost, infection rate, etc., which may provide only a posterior impression of the overall conformance with the established CPs such that in-depth and in near real time checking on the compliance of the essential/critical treatment behaviors of CPs is limited. To provide clinicians real time insights into violations of the established CP specification and support online compliance checking, this article presents a semantic rule-based CP compliance checking system. In detail, we construct a CP ontology (CPO) model to provide a formal grounding of CP compliance checking. Using the proposed CPO, domain treatment constraints are modeled into Semantic Web Rule Language (SWRL) rules to specify the underlying treatment behaviors and their quantified temporal structure in a CP. The established SWRL rules are integrated with the CP workflow such that a series of applicable compliance checking and evaluation can be reminded and recommended during the pathway execution. The proposed approach can, therefore, provides a comprehensive compliance checking service as a paralleling activity to the patient treatment journey of a CP rather than an afterthought. The proposed approach is illustrated with a case study on the unstable angina clinical pathway implemented in the Cardiology Department of a Chinese hospital. The results demonstrate that the approach, as a feasible solution to provide near real time conformance checking of CPs, not only enables clinicians to uncover non-compliant treatment behaviors, but also empowers clinicians with the capability to make informed decisions when dealing with treatment compliance violations in the pathway execution.