From: <jen...@us...> - 2009-02-24 16:42:17
|
Revision: 1626 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1626&view=rev Author: jenslehmann Date: 2009-02-24 16:42:10 +0000 (Tue, 24 Feb 2009) Log Message: ----------- cleaned up by removing some code marked as @Deprecated Modified Paths: -------------- trunk/lib/components.ini trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionPosNeg.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/core/configurators/DIGReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/FastRetrievalReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/GPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/KBFileConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/OWLFileConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/RandomGuesserConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java trunk/src/dl-learner/org/dllearner/core/options/StringConfigOption.java trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java Removed Paths: ------------- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegInclusionLPConfigurator.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java Modified: trunk/lib/components.ini =================================================================== --- trunk/lib/components.ini 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/lib/components.ini 2009-02-24 16:42:10 UTC (rev 1626) @@ -13,7 +13,6 @@ # learning problems org.dllearner.learningproblems.PosNegLPStandard org.dllearner.learningproblems.PosNegLPStrict -org.dllearner.learningproblems.PosNegInclusionLP org.dllearner.learningproblems.PosOnlyLP org.dllearner.learningproblems.ClassLearningProblem # learning algorithms Modified: trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionPosNeg.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionPosNeg.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/algorithms/EvaluatedDescriptionPosNeg.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -22,7 +22,6 @@ import java.util.Set; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.Score; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.learningproblems.ScorePosNeg; Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/CELOE.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -28,8 +28,6 @@ import java.util.SortedSet; import java.util.TreeSet; -import javax.sound.midi.SysexMessage; - import org.apache.log4j.Logger; import org.dllearner.core.ComponentInitException; import org.dllearner.core.EvaluatedDescription; @@ -47,8 +45,6 @@ import org.dllearner.core.owl.Restriction; import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.ClassLearningProblem; -import org.dllearner.parser.KBParser; -import org.dllearner.parser.ParseException; import org.dllearner.refinementoperators.RefinementOperator; import org.dllearner.refinementoperators.RhoDRDown; import org.dllearner.utilities.owl.ConceptComparator; @@ -106,7 +102,7 @@ private String baseURI; private Map<String, String> prefixes; private DecimalFormat dfPercent = new DecimalFormat("0.00%"); - private ConceptComparator descriptionComparator = new ConceptComparator(); +// private ConceptComparator descriptionComparator = new ConceptComparator(); // statistical variables private int descriptionTests = 0; Modified: trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/algorithms/celoe/OENode.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -23,8 +23,6 @@ import java.util.LinkedList; import java.util.List; -import org.dllearner.algorithms.refinement2.ExampleBasedNode; -import org.dllearner.algorithms.refinement2.MultiHeuristic; import org.dllearner.core.owl.Description; /** Modified: trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/cli/ConfMapper.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -42,7 +42,6 @@ import org.dllearner.learningproblems.ClassLearningProblem; import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.learningproblems.PosNegLPStrict; -import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.reasoning.DIGReasoner; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; @@ -84,7 +83,6 @@ reasonerMapping.put("fastInstanceChecker", FastInstanceChecker.class); reasonerMapping.put("fastRetrievalReasoner", FastRetrievalReasoner.class); learningProblemMapping.put("posNegDefinitionLP", PosNegLPStandard.class); - learningProblemMapping.put("posNegInclusionLP", PosNegInclusionLP.class); learningProblemMapping.put("posNegDefinitionLPStrict", PosNegLPStrict.class); learningProblemMapping.put("classLearning", ClassLearningProblem.class); learningAlgorithmMapping.put("random", RandomGuesser.class); Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -43,10 +43,6 @@ import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; import org.dllearner.Info; -import org.dllearner.algorithms.BruteForceLearner; -import org.dllearner.algorithms.RandomGuesser; -import org.dllearner.algorithms.gp.GP; -import org.dllearner.algorithms.refinement.ROLearner; import org.dllearner.algorithms.refinement2.ROLComponent2; import org.dllearner.core.Component; import org.dllearner.core.ComponentInitException; @@ -74,7 +70,6 @@ import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.learningproblems.PosNegLPStandard; -import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.learningproblems.ScorePosNeg; import org.dllearner.parser.ConfParser; @@ -83,8 +78,6 @@ import org.dllearner.parser.TokenMgrError; import org.dllearner.reasoning.DIGReasoner; import org.dllearner.reasoning.FastInstanceChecker; -import org.dllearner.reasoning.FastRetrievalReasoner; -import org.dllearner.reasoning.OWLAPIReasoner; import org.dllearner.utilities.Files; import org.dllearner.utilities.Helper; import org.dllearner.utilities.JamonMonitorLogger; @@ -351,36 +344,6 @@ printConclusions(rc, algDuration); } } - - /** - * @deprecated See ConfMapper. - * creates a mapping from components to option prefix strings - */ - @Deprecated - public static Map<Class<? extends Component>, String> createComponentPrefixMapping() { - Map<Class<? extends Component>, String> componentPrefixMapping = new HashMap<Class<? extends Component>, String>(); - // knowledge sources - componentPrefixMapping.put(SparqlKnowledgeSource.class, "sparql"); - // reasoners - componentPrefixMapping.put(DIGReasoner.class, "digReasoner"); - componentPrefixMapping.put(FastInstanceChecker.class, "fastInstanceChecker"); - componentPrefixMapping.put(OWLAPIReasoner.class, "owlAPIReasoner"); - componentPrefixMapping.put(FastRetrievalReasoner.class, "fastRetrieval"); - - // learning problems - configured via + and - flags for examples - componentPrefixMapping.put(PosNegLPStandard.class, "posNegDefinitionLP"); - componentPrefixMapping.put(PosNegInclusionLP.class, "posNegInclusionLP"); - componentPrefixMapping.put(PosOnlyLP.class, "posOnlyDefinitionLP"); - - // learning algorithms - componentPrefixMapping.put(ROLearner.class, "refinement"); - componentPrefixMapping.put(ROLComponent2.class, "refexamples"); - componentPrefixMapping.put(GP.class, "gp"); - componentPrefixMapping.put(BruteForceLearner.class, "bruteForce"); - componentPrefixMapping.put(RandomGuesser.class, "random"); - - return componentPrefixMapping; - } /** * convenience method basically every prefix (e.g. "refinement" in @@ -897,98 +860,4 @@ return rc; } - /** - * @deprecated See ConfMapper. - * @param componentSuperClass - * @return String. - */ - @Deprecated - public static String getCLIMapping(String componentSuperClass){ - HashMap<String, String> m = new HashMap<String, String>(); - m.put("KnowledgeSource", "import"); - m.put("ReasonerComponent", "reasoner"); - m.put("PosNegLP", "problem"); - m.put("PosOnlyLP", "problem"); - m.put("LearningAlgorithm", "algorithm"); - return m.get(componentSuperClass); - } - - /** - * Set Reasoner class. Define here all possible reasoners. - * - * @deprecated See ConfMapper. - * @param reasonerOption - * from config file - * @return reasonerClass reasoner class - */ - @Deprecated - public static Class<? extends ReasonerComponent> getReasonerClass(ConfFileOption reasonerOption) { - Class<? extends ReasonerComponent> reasonerClass = null; - if (reasonerOption == null || reasonerOption.getStringValue().equals("fastInstanceChecker")) - reasonerClass = FastInstanceChecker.class; - else if (reasonerOption.getStringValue().equals("owlAPI")) - reasonerClass = OWLAPIReasoner.class; - else if (reasonerOption.getStringValue().equals("fastRetrieval")) - reasonerClass = FastRetrievalReasoner.class; - else if (reasonerOption.getStringValue().equals("dig")) - reasonerClass = DIGReasoner.class; - else { - handleError("Unknown value " + reasonerOption.getStringValue() - + " for option \"reasoner\"."); - } - return reasonerClass; - } - - /** - * Set LearningProblem class. Define here all possible problems. - * - * @deprecated See ConfMapper. - * @param problemOption - * from config file - * @return lpClass learning problem class - */ - @Deprecated - public static Class<? extends LearningProblem> getLearningProblemClass( - ConfFileOption problemOption) { - Class<? extends LearningProblem> lpClass = null; - if (problemOption == null || problemOption.getStringValue().equals("posNegDefinitionLP")) - lpClass = PosNegLPStandard.class; - else if (problemOption.getStringValue().equals("posNegInclusionLP")) - lpClass = PosNegInclusionLP.class; - else if (problemOption.getStringValue().equals("posOnlyDefinitionLP")) - lpClass = PosOnlyLP.class; - else - handleError("Unknown value " + problemOption.getValue() + " for option \"problem\"."); - - return lpClass; - } - - /** - * Set LearningAlorithm class. Define here all possible learning algorithms. - * - * @deprecated See ConfMapper. - * @param algorithmOption - * from config file - * @return laClass learning algorithm class - */ - @Deprecated - public static Class<? extends LearningAlgorithm> getLearningAlgorithm( - ConfFileOption algorithmOption) { - Class<? extends LearningAlgorithm> laClass = null; - if (algorithmOption == null || algorithmOption.getStringValue().equals("refexamples")) - laClass = ROLComponent2.class; - else if (algorithmOption.getStringValue().equals("refinement")) - laClass = ROLearner.class; - else if (algorithmOption.getStringValue().equals("gp")) - laClass = GP.class; - else if (algorithmOption.getStringValue().equals("bruteForce")) - laClass = BruteForceLearner.class; - else if (algorithmOption.getStringValue().equals("randomGuesser")) - laClass = RandomGuesser.class; - else - handleError("Unknown value in " + algorithmOption); - - return laClass; - } - } Modified: trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -33,7 +33,7 @@ public class BruteForceLearnerConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private BruteForceLearner bruteForceLearner; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/CELOEConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -34,7 +34,7 @@ public class CELOEConfigurator extends RefinementOperatorConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private CELOE cELOE; @@ -158,7 +158,7 @@ /** * maxDepth maximum depth of description. * mandatory: false| reinit necessary: true -* default value: 4 +* default value: 7 * @return int **/ public int getMaxDepth() { @@ -276,7 +276,7 @@ /** * @param maxDepth maximum depth of description. * mandatory: false| reinit necessary: true -* default value: 4 +* default value: 7 **/ public void setMaxDepth(int maxDepth) { ComponentManager.getInstance().applyConfigEntry(cELOE, "maxDepth", maxDepth); Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ClassLearningProblemConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -31,7 +31,7 @@ public class ClassLearningProblemConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private ClassLearningProblem classLearningProblem; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -38,7 +38,6 @@ import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.learningproblems.ClassLearningProblem; -import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.learningproblems.PosNegLPStrict; import org.dllearner.learningproblems.PosOnlyLP; @@ -131,16 +130,6 @@ * @param positiveExamples positive examples * @param negativeExamples negative examples * @param reasoningService see ReasoningService -* @return a component ready for initialization PosNegInclusionLP -**/ -public static PosNegInclusionLP getPosNegInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { -return PosNegInclusionLPConfigurator.getPosNegInclusionLP(reasoningService, positiveExamples, negativeExamples); -} - -/** -* @param positiveExamples positive examples -* @param negativeExamples negative examples -* @param reasoningService see ReasoningService * @return a component ready for initialization PosNegLPStandard **/ public static PosNegLPStandard getPosNegLPStandard(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { Modified: trunk/src/dl-learner/org/dllearner/core/configurators/DIGReasonerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/DIGReasonerConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/DIGReasonerConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -32,7 +32,7 @@ public class DIGReasonerConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private DIGReasoner dIGReasoner; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ELLearningAlgorithmConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -33,7 +33,7 @@ public class ELLearningAlgorithmConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private ELLearningAlgorithm eLLearningAlgorithm; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/FastInstanceCheckerConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -32,7 +32,7 @@ public class FastInstanceCheckerConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private FastInstanceChecker fastInstanceChecker; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/FastRetrievalReasonerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/FastRetrievalReasonerConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/FastRetrievalReasonerConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -32,7 +32,7 @@ public class FastRetrievalReasonerConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private FastRetrievalReasoner fastRetrievalReasoner; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/GPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/GPConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/GPConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -33,7 +33,7 @@ public class GPConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private GP gP; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/KBFileConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/KBFileConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/KBFileConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -31,7 +31,7 @@ public class KBFileConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private KBFile kBFile; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -30,7 +30,7 @@ public class OWLAPIOntologyConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private OWLAPIOntology oWLAPIOntology; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIReasonerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIReasonerConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIReasonerConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -32,7 +32,7 @@ public class OWLAPIReasonerConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private OWLAPIReasoner oWLAPIReasoner; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/OWLFileConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/OWLFileConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/OWLFileConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -31,7 +31,7 @@ public class OWLFileConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private OWLFile oWLFile; Deleted: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegInclusionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegInclusionLPConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegInclusionLPConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -1,160 +0,0 @@ -/** - * Copyright (C) 2007-2008, Jens Lehmann - * - * This file is part of DL-Learner. - * - * DL-Learner is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * DL-Learner is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -package org.dllearner.core.configurators; - -import java.util.Set; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.learningproblems.PosNegInclusionLP; - -/** -* automatically generated, do not edit manually. -* run org.dllearner.scripts.ConfigJavaGenerator to update -**/ -public class PosNegInclusionLPConfigurator implements Configurator { - -private boolean reinitNecessary = false; -@SuppressWarnings("unused") - -private PosNegInclusionLP posNegInclusionLP; - -/** -* @param posNegInclusionLP see PosNegInclusionLP -**/ -public PosNegInclusionLPConfigurator(PosNegInclusionLP posNegInclusionLP){ -this.posNegInclusionLP = posNegInclusionLP; -} - -/** -* @param reasoningService see reasoningService -* @param positiveExamples positive examples -* @param negativeExamples negative examples -* @return PosNegInclusionLP -**/ -public static PosNegInclusionLP getPosNegInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { -PosNegInclusionLP component = ComponentManager.getInstance().learningProblem(PosNegInclusionLP.class, reasoningService); -ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); -ComponentManager.getInstance().applyConfigEntry(component, "negativeExamples", negativeExamples); -return component; -} - -/** -* positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getPositiveExamples() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posNegInclusionLP, "positiveExamples") ; -} -/** -* negativeExamples negative examples. -* mandatory: true| reinit necessary: false -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getNegativeExamples() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(posNegInclusionLP, "negativeExamples") ; -} -/** -* useRetrievalForClassficiation Specifies whether to use retrieval or instance checks for testing a concept.. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getUseRetrievalForClassficiation() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(posNegInclusionLP, "useRetrievalForClassficiation") ; -} -/** -* percentPerLenghtUnit describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one. -* mandatory: false| reinit necessary: true -* default value: 0.05 -* @return double -**/ -public double getPercentPerLenghtUnit() { -return (Double) ComponentManager.getInstance().getConfigOptionValue(posNegInclusionLP, "percentPerLenghtUnit") ; -} -/** -* useMultiInstanceChecks See UseMultiInstanceChecks enum.. -* mandatory: false| reinit necessary: true -* default value: twoChecks -* @return String -**/ -public String getUseMultiInstanceChecks() { -return (String) ComponentManager.getInstance().getConfigOptionValue(posNegInclusionLP, "useMultiInstanceChecks") ; -} - -/** -* @param positiveExamples positive examples. -* mandatory: true| reinit necessary: false -* default value: null -**/ -public void setPositiveExamples(Set<String> positiveExamples) { -ComponentManager.getInstance().applyConfigEntry(posNegInclusionLP, "positiveExamples", positiveExamples); -} -/** -* @param negativeExamples negative examples. -* mandatory: true| reinit necessary: false -* default value: null -**/ -public void setNegativeExamples(Set<String> negativeExamples) { -ComponentManager.getInstance().applyConfigEntry(posNegInclusionLP, "negativeExamples", negativeExamples); -} -/** -* @param useRetrievalForClassficiation Specifies whether to use retrieval or instance checks for testing a concept.. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setUseRetrievalForClassficiation(boolean useRetrievalForClassficiation) { -ComponentManager.getInstance().applyConfigEntry(posNegInclusionLP, "useRetrievalForClassficiation", useRetrievalForClassficiation); -reinitNecessary = true; -} -/** -* @param percentPerLenghtUnit describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one. -* mandatory: false| reinit necessary: true -* default value: 0.05 -**/ -public void setPercentPerLenghtUnit(double percentPerLenghtUnit) { -ComponentManager.getInstance().applyConfigEntry(posNegInclusionLP, "percentPerLenghtUnit", percentPerLenghtUnit); -reinitNecessary = true; -} -/** -* @param useMultiInstanceChecks See UseMultiInstanceChecks enum.. -* mandatory: false| reinit necessary: true -* default value: twoChecks -**/ -public void setUseMultiInstanceChecks(String useMultiInstanceChecks) { -ComponentManager.getInstance().applyConfigEntry(posNegInclusionLP, "useMultiInstanceChecks", useMultiInstanceChecks); -reinitNecessary = true; -} - -/** -* true, if this component needs reinitializsation. -* @return boolean -**/ -public boolean isReinitNecessary(){ -return reinitNecessary; -} - - -} Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStandardConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -32,7 +32,7 @@ public class PosNegLPStandardConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private PosNegLPStandard posNegLPStandard; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStrictConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStrictConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegLPStrictConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -32,7 +32,7 @@ public class PosNegLPStrictConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private PosNegLPStrict posNegLPStrict; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyLPConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -32,7 +32,7 @@ public class PosOnlyLPConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private PosOnlyLP posOnlyLP; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ROLComponent2Configurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -34,7 +34,7 @@ public class ROLComponent2Configurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private ROLComponent2 rOLComponent2; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -35,7 +35,7 @@ public class ROLearnerConfigurator extends RefinementOperatorConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private ROLearner rOLearner; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/RandomGuesserConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/RandomGuesserConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/RandomGuesserConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -33,7 +33,7 @@ public class RandomGuesserConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private RandomGuesser randomGuesser; Modified: trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/configurators/SparqlKnowledgeSourceConfigurator.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -34,7 +34,7 @@ public class SparqlKnowledgeSourceConfigurator implements Configurator { private boolean reinitNecessary = false; -@SuppressWarnings("unused") +@SuppressWarnings("all") private SparqlKnowledgeSource sparqlKnowledgeSource; Modified: trunk/src/dl-learner/org/dllearner/core/options/StringConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/options/StringConfigOption.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/core/options/StringConfigOption.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -85,6 +85,7 @@ /* (non-Javadoc) * @see org.dllearner.core.options.ConfigOption#getAllowedValuesDescription() */ + @Override public String getAllowedValuesDescription() { return getValueTypeAsJavaString() + " "+allowedValues+" "; } Deleted: trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -1,230 +0,0 @@ -/** - * Copyright (C) 2007, Jens Lehmann - * - * This file is part of DL-Learner. - * - * DL-Learner is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * DL-Learner is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package org.dllearner.learningproblems; - -import java.util.Set; -import java.util.SortedSet; - -import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.configurators.ComponentFactory; -import org.dllearner.core.configurators.PosNegInclusionLPConfigurator; -import org.dllearner.core.owl.Description; -import org.dllearner.core.owl.Individual; -import org.dllearner.core.owl.Negation; -import org.dllearner.utilities.Helper; -import org.dllearner.utilities.datastructures.SetManipulation; - -/** - * The aim of this learning problem is to find an appropriate inclusion axiom - * given positive and negative examples. - * - * This is similar to the definition learning problem, but here the positive - * and negative examples usually do not follow when the inclusion is added to - * the knowledge base. This raises the question how the quality of a concept - * with respect to this learning problem can be measured. Due to the fact that - * the inclusion does not entail examples, we have to look at the negation of - * the concept we are looking at. For a good solution it is the case that - * no positive examples follow from the negated concept, the negative - * examples follow from it. This means that the standard definition learning - * problem and the inclusion learning problem can be seen as two possible - * weakenings of the strict definition learning problem. (Of course, both problems - * can yield the same solution.) - * - * @author Jens Lehmann - * - */ -@Deprecated -public class PosNegInclusionLP extends PosNegLP { - - private PosNegLPStandard definitionLP; - private PosNegInclusionLPConfigurator configurator; - - @Override - public PosNegInclusionLPConfigurator getConfigurator(){ - return configurator; - } - - public PosNegInclusionLP(ReasonerComponent reasoningService) { - super(reasoningService); - configurator = new PosNegInclusionLPConfigurator(this); - } -/* - public static Collection<ConfigOption<?>> createConfigOptions() { - Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - options.add(new StringSetConfigOption("positiveExamples", - "positive examples")); - options.add(new StringSetConfigOption("negativeExamples", - "negative examples")); - options.add(new BooleanConfigOption("useRetrievalForClassficiation", - "Specifies whether to use retrieval or instance checks for testing a concept.")); - return options; - } -*/ - /* - * (non-Javadoc) - * - * @see org.dllearner.core.Component#getName() - */ - public static String getName() { - return "two valued inclusion learning problem"; - } - - - /* - * (non-Javadoc) - * - * @see org.dllearner.core.Component#init() - */ - @Override - public void init() { - super.init(); - definitionLP = ComponentFactory.getPosNegLPStandard( - reasoner, - SetManipulation.indToString(negativeExamples), - SetManipulation.indToString(positiveExamples)); - //definitionLP = new PosNegDefinitionLP(reasoningService, negativeExamples, positiveExamples); - // TODO: we must make sure that the problem also gets the same - // reasoning options (i.e. options are the same up to reversed example sets) - definitionLP.init(); - } - - /** - * See the documentation of <code>coveredNegativeExamplesOrTooWeak</code> in - * the definition learning problem case. This method works differently: - * First, it tests whether none of the positive examples is covered by the - * negation of the given concept. Should this be the case, it returns - * too weak. If this is not the case, the method returns the number of - * negative examples, which do not follow from the negation of the input - * concept. Thus, this methods uses a different notion of coverage than - * the one for the standard definition learning problem. - * - * @see org.dllearner.learningproblems.PosNegLP.UseMultiInstanceChecks - * @param concept - * The concept to test. - * @return -1 if concept is too weak and the number of covered negative - * examples otherwise. - */ - @Override - public int coveredNegativeExamplesOrTooWeak(Description concept) { - - if (useRetrievalForClassification) { - SortedSet<Individual> inNegatedConcept = reasoner.getIndividuals(new Negation(concept)); - - for (Individual posExample : positiveExamples) { - // if any positive example follows from the negation, then - // the concept is "too weak" - if (inNegatedConcept.contains(posExample)) - return -1; - } - - // number of covered negatives - // cover = neg. example does not belong to the negated concept - SortedSet<Individual> negExInNegatedConcept = Helper.intersection(negativeExamples, inNegatedConcept); - return (negativeExamples.size() - negExInNegatedConcept.size()); - } else { - if (useMultiInstanceChecks != UseMultiInstanceChecks.NEVER) { - // two checks - if (useMultiInstanceChecks == UseMultiInstanceChecks.TWOCHECKS) { - Set<Individual> posExInNegatedConcept = reasoner.hasType(new Negation(concept), positiveExamples); - - if(posExInNegatedConcept.size()>0) { - return -1; - } else { - Set<Individual> negExInNegatedConcept = reasoner.hasType(new Negation(concept), negativeExamples); - return (negativeExamples.size() - negExInNegatedConcept.size()); - } - - // one check - } else { - Set<Individual> inNegatedConcept = reasoner.hasType(new Negation(concept), allExamples); - - for(Individual i : positiveExamples) { - if(inNegatedConcept.contains(i)) - return -1; - } - - // we can now be sure that inNegatedConcept contains only - // negative examples - return (negativeExamples.size() - inNegatedConcept.size()); - - } - // single instance checks - } else { - int coverCount = negativeExamples.size(); - - for (Individual example : positiveExamples) { - if (reasoner.hasType(new Negation(concept), example)) - return -1; - } - for (Individual example : negativeExamples) { - if (!reasoner.hasType(new Negation(concept), example)) - coverCount--; - } - - return coverCount; - } - } - } - - /** - * Calls the same method on the standard definition learning problem, but - * negates the concept before and permutes positive and negative examples. - * - * @see org.dllearner.core.LearningProblem#computeScore(org.dllearner.core.owl.Description) - */ - @Override - public ScorePosNeg 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))); -// } - return definitionLP.computeScore(new Negation(concept)); - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningProblem#getAccuracy(org.dllearner.core.owl.Description) - */ - @Override - public double getAccuracy(Description description) { - // TODO Auto-generated method stub - return 0; - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningProblem#getAccuracyOrTooWeak(org.dllearner.core.owl.Description, double) - */ - @Override - public double getAccuracyOrTooWeak(Description description, double minAccuracy) { - // TODO Auto-generated method stub - return 0; - } - - /* (non-Javadoc) - * @see org.dllearner.core.LearningProblem#evaluate(org.dllearner.core.owl.Description) - */ - @Override - public EvaluatedDescription evaluate(Description description) { - // TODO Auto-generated method stub - return null; - } - -} Modified: trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -642,7 +642,7 @@ ObjectProperty op = (ObjectProperty) ope; Description child = description.getChild(0); Map<Individual, SortedSet<Individual>> mapping = opPos.get(op); - SortedSet<Individual> targetSet = getIndividualsImpl(description.getChild(0)); + SortedSet<Individual> targetSet = getIndividualsImpl(child); // initially all individuals are in the return set and we then remove those // with too many fillers SortedSet<Individual> returnSet = (SortedSet<Individual>) individuals.clone(); Modified: trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java =================================================================== --- trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2009-02-24 16:08:18 UTC (rev 1625) +++ trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java 2009-02-24 16:42:10 UTC (rev 1626) @@ -40,7 +40,6 @@ import org.apache.log4j.Logger; import org.dllearner.Info; import org.dllearner.algorithms.BruteForceLearner; -import org.dllearner.algorithms.EvaluatedDescriptionPosNeg; import org.dllearner.algorithms.RandomGuesser; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.refinement.ROLearner; @@ -68,7 +67,6 @@ import org.dllearner.kb.sparql.SparqlQueryDescriptionConvertVisitor; import org.dllearner.kb.sparql.SparqlQueryException; import org.dllearner.learningproblems.PosNegLPStandard; -import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.parser.KBParser; import org.dllearner.parser.ParseException; @@ -113,7 +111,6 @@ reasonerMapping.put("owlapi", OWLAPIReasoner.class); reasonerMapping.put("fastInstanceChecker", FastInstanceChecker.class); learningProblemMapping.put("posNegDefinition", PosNegLPStandard.class); - learningProblemMapping.put("posNegInclusion", PosNegInclusionLP.class); learningProblemMapping.put("posOnlyDefinition", PosOnlyLP.class); learningAlgorithmMapping.put("random", RandomGuesser.class); learningAlgorithmMapping.put("bruteForce", BruteForceLearner.class); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |