Giter Site home page Giter Site logo

ignazio1977 / owlexplanation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matthewhorridge/owlexplanation

2.0 2.0 0.0 217 KB

An API and reference implementation for generating justifications for entailments in OWL ontologies

License: GNU Lesser General Public License v3.0

Java 100.00%

owlexplanation's Introduction

OWL Explanation

An API and reference implementation for generating justifications for entailments in OWL ontologies.

Maven Dependency

<dependency>
    <groupId>net.sourceforge.owlapi</groupId>
    <artifactId>owlexplanation</artifactId>
    <version>5.0.0</version>
</dependency>

Example Usage

import org.semanticweb.owl.explanation.api.*;
import org.semanticweb.owlapi.model.*;
import org.semanticweb.owlapi.reasoner.OWLReasonerFactory;

OWLReasonerFactory rf = ; // Get hold of a reasoner factory
OWLOntology ont = ; // Reference to an OWLOntology

// Create the explanation generator factory which uses reasoners provided by the specified
// reasoner factory
ExplanationGeneratorFactory<OWLAxiom> genFac = ExplanationManager.createExplanationGeneratorFactory(rf);

// Now create the actual explanation generator for our ontology
ExplanationGenerator<OWLAxiom> gen = genFac.createExplanationGenerator(ont);

// Ask for explanations for some entailment
OWLAxiom entailment ; // Get a reference to the axiom that represents the entailment that we want explanation for

// Get our explanations.  Ask for a maximum of 5.
Set<Explanation<OWLAxiom>> expl = gen.getExplanations(entailment, 5);

Explanations for Inconsistent Ontologies

To obtain explanations for inconsistent ontologies the InconsistentOntologyExplanationGeneratorFactory can be used. Ask for explanations for SubClassOf(owl:Thing owl:Nothing).

owlexplanation's People

Contributors

ignazio1977 avatar matthewhorridge avatar sesuncedu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

owlexplanation's Issues

Documentation/example needed

It would be great if some documentation/example code is provided on how to use the API. I have been struggling since a long time to understand the usage.

UnsupportedAxiomTypeException: Unsupported type of axiom: EquivalentClasses

Hi Ignazio,

I am facing this issue which I can't figure out. Is the EquivalentClassAxiom supported by owlexplanation 5.0.0?

I get org.semanticweb.owl.explanation.impl.blackbox.checker.SatisfiabilityEntailmentChecker$UnsupportedAxiomTypeException: Unsupported type of axiom: EquivalentClasses

for the axiom EquivalentClasses(<http://stelios.org/onto.owl#Dog> <http://stelios.org/onto.owl#Rough> <http://stelios.org/onto.owl#Young>), of this ontology.

Keep in mind the ontology is randomly generated so don't bother making sense of any meaning in it.

I am using HermiT 1.4.5.519, OWLAPI 5.1.19 and Owlexplanation 5.0.0.

Thank you for your work.

There seems to be a bug in StructuralTypePriorityExpansionStrategy

The constructor of StructuralTypePriorityExpansionStrategy has a potential NullPointerException which is guaranteed to be generated if the Configuration Constructor public Configuration(EntailmentCheckerFactory<E> checkerFactory, Supplier<OWLOntologyManager> m) is used anywhere in the code.

Perhaps replace:
public StructuralTypePriorityExpansionStrategy(InitialEntailmentCheckStrategy initialEntailmentCheckStrategy,
Supplier<OWLOntologyManager> m) {
this.initialEntailmentCheckStrategy = initialEntailmentCheckStrategy;
this.m = m;
}

with:
public StructuralTypePriorityExpansionStrategy(InitialEntailmentCheckStrategy initialEntailmentCheckStrategy, Supplier<OWLOntologyManager> m) {
if(initialEntailmentCheckStrategy != null){
this.initialEntailmentCheckStrategy = initialEntailmentCheckStrategy;
}
this.m = m;
}

Null pointer exception

@ignazio1977 I am getting a Null Pointer Exception when trying to generate explanations. The code which fixes this issue probably isn't present in the version 5.0.0 of the dependency available in Maven repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.