From bf0ea9170ab269af70f2b91c360ab5e34d425e54 Mon Sep 17 00:00:00 2001 From: Balram Tiwari <70642077+Balramt@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:16:26 +0100 Subject: [PATCH] Update README.md --- README.md | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d428a8..4be6c35 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,51 @@ -# contrastive_explanations -Adding java based abduction reasoning methodology code +# README: contrastive_explanations with Pellet Reasoner +## Overview +This program uses abduction reasoning with OWL ontologies to explain why an individual satisfies a query and identifies missing axioms needed for another individual to satisfy the same query. The process leverages the **Pellet reasoner** for ontology reasoning and explanation generation. + +## Features +1. **Ontology Loading:** Reads an OWL ontology file for reasoning. +2. **Query Parsing:** Supports parsing OWL class expressions with logical operators (`and`, `or`, `not`, `some`, `only`, `exactly`). +3. **Explanation Generation:** Provides explanations for why an individual satisfies a class expression query. +4. **Abduction Reasoning:** Identifies and outputs missing axioms for another individual to meet the query. + +## Input File Format +- **Ontology Path:** Specifies the local path to the OWL ontology file. +- **Namespace:** Defines the namespace IRI for ontology terms. +- **Query:** Contains the OWL class expression to reason over. +- **Individuals:** + - **`individual_with_explanation`:** Individual that satisfies the query. + - **`individual_without_explanation`:** Individual for which missing axioms are computed. + +### Example Input File +``` +ontology=/path/to/ontology.owl +namespace=http://example.org/ontology# +query=(ClassA and (propertyA some ClassB)) +individual_with_explanation=Individual1 +individual_without_explanation=Individual2 +``` + +## How to Use +1. **Prepare the Input File:** Ensure the file is formatted as shown above. +2. **Run the Program:** + - Compile the program using required dependencies. + - Execute the program and provide the input file path when prompted. +3. **View the Output:** + - Query results and explanations for the selected individual. + - Missing axioms required for the second individual. + +## Output Details +- **Query:** The parsed class expression for reasoning. +- **Explanations:** A list of shared axioms that justify why the first individual satisfies the query. +- **Missing Axioms:** Axioms needed for the second individual to satisfy the query. +- **Execution Time:** Time taken for reasoning and explanation generation. + +## Requirements +- **Java 8 or Higher** +- **Pellet Reasoner Library** +- **OWLAPI v3.5 or Higher** +- An ontology file in OWL format. + +## Notes +- The ontology must include the individuals specified in the input file. +- Ensure all required libraries are included in the classpath during compilation and execution.