From: <jen...@us...> - 2009-04-17 09:52:04
|
Revision: 1711 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1711&view=rev Author: jenslehmann Date: 2009-04-17 09:51:53 +0000 (Fri, 17 Apr 2009) Log Message: ----------- added flag showing whether the suggested axiom already logically follows from the knowledge base Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java trunk/src/dl-learner/org/dllearner/learningproblems/EvaluatedDescriptionClass.java Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-04-17 09:34:44 UTC (rev 1710) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassLearningProblem.java 2009-04-17 09:51:53 UTC (rev 1711) @@ -157,7 +157,10 @@ // leads to an inconsistent knowledge base boolean isConsistent = coverage >= 0.999999 || isConsistent(description); - return new ClassScore(coveredInstances, coverage, additionalInstances, protusion, getAccuracy(coverage, protusion), isConsistent); + // we check whether the axiom already follows from the knowledge base + boolean followsFromKB = reasoner.isSuperClassOf(description, classToDescribe); + + return new ClassScore(coveredInstances, coverage, additionalInstances, protusion, getAccuracy(coverage, protusion), isConsistent, followsFromKB); } public boolean isEquivalenceProblem() { Modified: trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-04-17 09:34:44 UTC (rev 1710) +++ trunk/src/dl-learner/org/dllearner/learningproblems/ClassScore.java 2009-04-17 09:51:53 UTC (rev 1711) @@ -40,14 +40,16 @@ private double accuracy; private boolean isConsistent; + private boolean followsFromKB; - public ClassScore(Set<Individual> coveredInstances, double coverage, Set<Individual> additionalInstances, double protusion, double accuracy, boolean isConsistent) { + public ClassScore(Set<Individual> coveredInstances, double coverage, Set<Individual> additionalInstances, double protusion, double accuracy, boolean isConsistent, boolean followsFromKB) { this.coveredInstances = coveredInstances; this.additionalInstances = additionalInstances; this.coverage = coverage; this.addition = protusion; this.accuracy = accuracy; this.isConsistent = isConsistent; + this.followsFromKB = followsFromKB; } /** @@ -95,6 +97,13 @@ */ public boolean isConsistent() { return isConsistent; + } + + /** + * @return the followsFromKB + */ + public boolean followsFromKB() { + return followsFromKB; } } Modified: trunk/src/dl-learner/org/dllearner/learningproblems/EvaluatedDescriptionClass.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/EvaluatedDescriptionClass.java 2009-04-17 09:34:44 UTC (rev 1710) +++ trunk/src/dl-learner/org/dllearner/learningproblems/EvaluatedDescriptionClass.java 2009-04-17 09:51:53 UTC (rev 1711) @@ -87,4 +87,12 @@ return classScore.isConsistent(); } + /** + * + * @return True if adding the axiom to the knowledge base does not logically change the knowledge base (i.e. the axiom already follows from it). False otherwise. + */ + public boolean followsFromKB() { + return classScore.followsFromKB(); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |