The ontology based framework is developed for representing image domain. The textual features of images are extracted and annotated as the part of the ontology. The ontology is represented in Web Ontology Language (OWL) format which is based on Resource Description Framework (RDF) and Resource Description Framework Schema (RDFS). Internally, the RDF statements represent an RDF graph which provides the way to represent the image data in a semantic manner. Various tools and languages are used to retrieve the semantically relevant textual data from ontology model. The SPARQL query language is more popular methods to retrieve the textual data stored in the ontology. The text or keyword based search is not adequate for retrieving images. The end users are not able to convey the visual features of an image in SPARQL query form. Moreover, the SPARQL query provides more accurate results by traversing through RDF graph. The relevant images cannot be retrieved by one to one mapping. So the relevancy can be provided by some kind of onto mapping. The relevancy is achieved by applying a decision tree algorithm. This study proposes methods to retrieve the images from ontology and compare the image retrieval performance by using SPARQL query language, decision tree algorithm and Lire which is an open source image search engine. The SPARQL query language is used to retrieving the semantically relevant images using keyword based annotation and the decision tree algorithms are used in retrieving the relevant images using visual features of an image. Lastly, the image retrieval efficiency is compared and graph is plotted to indicate the efficiency of the system.