From: <jen...@us...> - 2008-12-16 10:17:01
|
Revision: 1555 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1555&view=rev Author: jenslehmann Date: 2008-12-16 10:16:51 +0000 (Tue, 16 Dec 2008) Log Message: ----------- nnf conversion in fast instance checker Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java Modified: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java 2008-12-16 07:11:01 UTC (rev 1554) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java 2008-12-16 10:16:51 UTC (rev 1555) @@ -195,9 +195,9 @@ public Score computeScore(Description concept) { // FastInstanceChecker supports only negation normal form, so we have to make // sure to convert the description before - if(reasoner instanceof FastInstanceChecker) { - return definitionLP.computeScore(ConceptTransformation.transformToNegationNormalForm(new Negation(concept))); - } +// if(reasoner instanceof FastInstanceChecker) { +// return definitionLP.computeScore(ConceptTransformation.transformToNegationNormalForm(new Negation(concept))); +// } return definitionLP.computeScore(new Negation(concept)); } Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2008-12-16 07:11:01 UTC (rev 1554) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2008-12-16 10:16:51 UTC (rev 1555) @@ -70,6 +70,7 @@ import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; import org.dllearner.utilities.Helper; +import org.dllearner.utilities.owl.ConceptTransformation; /** * Reasoner for fast instance checks. It works by completely dematerialising the @@ -260,9 +261,12 @@ if (child instanceof NamedClass) { return classInstancesNeg.get((NamedClass) child).contains(individual); } else { - throw new ReasoningMethodUnsupportedException("Instance check for description " - + description - + " unsupported. Description needs to be in negation normal form."); + logger.debug("Converting description to negation normal form in fast instance check (should be avoided if possible)."); + Description nnf = ConceptTransformation.transformToNegationNormalForm(child); + return hasTypeImpl(nnf, individual); +// throw new ReasoningMethodUnsupportedException("Instance check for description " +// + description +// + " unsupported. Description needs to be in negation normal form."); } } else if (description instanceof Thing) { return true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |