In Software Engineering (SE), the graphical models specify the system's architecture, connection, and characteristics. New SE methods such as MDA utilize graphical models as a nucleus of all development activities. This paper presents the transformation and verification of class diagram and Object Constraint Language (OCL) and transformation algorithm from Class model to ontology in the continuity of our research on UML and ontology integration. The class diagram is transformed into ontology, and constraints specified through OCL are transformed into SPARQL.