From: <lor...@us...> - 2012-02-22 21:03:15
|
Revision: 3583 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3583&view=rev Author: lorenz_b Date: 2012-02-22 21:03:09 +0000 (Wed, 22 Feb 2012) Log Message: ----------- Fixed problem when no root class was detected. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/utilities/JustificationBasedCoherentOntologyExtractor.java Modified: trunk/components-core/src/main/java/org/dllearner/utilities/JustificationBasedCoherentOntologyExtractor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/JustificationBasedCoherentOntologyExtractor.java 2012-02-22 17:56:55 UTC (rev 3582) +++ trunk/components-core/src/main/java/org/dllearner/utilities/JustificationBasedCoherentOntologyExtractor.java 2012-02-22 21:03:09 UTC (rev 3583) @@ -172,6 +172,7 @@ StructureBasedRootClassFinder rootFinder = new StructureBasedRootClassFinder(reasoner); Set<OWLClass> unsatClasses = rootFinder.getRootUnsatisfiableClasses(); Set<OWLClass> derivedUnsatClasses = rootFinder.getDerivedUnsatisfiableClasses(); + logger.info("...done in " + (System.currentTimeMillis()-startTime) + "ms."); int rootCnt = unsatClasses.size(); int derivedCnt = derivedUnsatClasses.size(); @@ -180,6 +181,10 @@ int unsatPropCnt = unsatObjectProperties.size(); logger.info("Detected " + cnt + " unsatisfiable classes, " + rootCnt + " of them as root."); + if(unsatClasses.isEmpty()){ + unsatClasses = derivedUnsatClasses; + } + //if the ontology is not incoherent we return it here if(unsatClasses.isEmpty()){ return incoherentOntology; @@ -226,6 +231,10 @@ logger.info("Remaining unsatisfiable classes: " + (rootCnt + derivedCnt) + "(" + rootCnt + " roots)."); + if(unsatClasses.isEmpty()){ + unsatClasses = derivedUnsatClasses; + } + //recompute unsatisfiable object properties if(computeParallel){ unsatObjectProperties = getUnsatisfiableObjectProperties(reasoner); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |