Inconsistencies, whether they occur during the process of ontology evolution or appear during the ontology reconciliation process, result in potential harm to an ontology structure, and decrease credibility in representing a consistent and shared vocabulary of an underlying domain. When an inconsistency occurs, there are mainly two ways to deal with it: either resolve it, or reason with the inconsistent ontology. In this paper, we propose our approach for detecting and resolving inconsistencies in ontologies. Our inconsistency detection deals with the identification of contradiction derivations under the integrity constraint rules -- that are given in a logic program. For resolving detected inconsistencies, we generate all possible Minimal Inconsistent Resolve Candidates (MIRCs). Removing an MIRC from the inconsistent ontology will result in a maximal consistent sub-ontology w.r.t. the given logic program. To inform the user about the consequences of removing an MIRC, we also provide a list of all its derived triples. We evaluated our approach on the POKM domain ontology, where we detected all the inconsistencies in this ontology and generated all possible MIRCs for extracting a maximal consistent sub-ontology.