From: <ku...@us...> - 2008-09-09 09:42:42
|
Revision: 1182 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1182&view=rev Author: kurzum Date: 2008-09-09 09:42:37 +0000 (Tue, 09 Sep 2008) Log Message: ----------- minor changes Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2008-09-09 09:42:10 UTC (rev 1181) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2008-09-09 09:42:37 UTC (rev 1182) @@ -24,6 +24,7 @@ import org.dllearner.algorithms.BruteForceLearner; import org.dllearner.algorithms.DBpediaNavigationSuggestor; import org.dllearner.algorithms.RandomGuesser; +import org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm; import org.dllearner.algorithms.gp.GP; import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; import org.dllearner.algorithms.refinement.ROLearner; @@ -32,11 +33,14 @@ import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasoningService; import org.dllearner.kb.KBFile; +import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegDefinitionLPStrict; import org.dllearner.learningproblems.PosNegInclusionLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.learningproblems.PosOnlyInclusionLP; import org.dllearner.reasoning.DIGReasoner; import org.dllearner.reasoning.FastInstanceChecker; import org.dllearner.reasoning.FastRetrievalReasoner; @@ -57,6 +61,13 @@ } /** +* @return a component ready for initialization OWLAPIOntology +**/ +public static OWLAPIOntology getOWLAPIOntology() { +return OWLAPIOntologyConfigurator.getOWLAPIOntology(); +} + +/** * @param url URL pointing to the OWL file * @return a component ready for initialization OWLFile **/ @@ -119,6 +130,16 @@ * @param positiveExamples positive examples * @param negativeExamples negative examples * @param reasoningService see ReasoningService +* @return a component ready for initialization PosNegDefinitionLPStrict +**/ +public static PosNegDefinitionLPStrict getPosNegDefinitionLPStrict(ReasoningService reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +return PosNegDefinitionLPStrictConfigurator.getPosNegDefinitionLPStrict(reasoningService, positiveExamples, negativeExamples); +} + +/** +* @param positiveExamples positive examples +* @param negativeExamples negative examples +* @param reasoningService see ReasoningService * @return a component ready for initialization PosNegInclusionLP **/ public static PosNegInclusionLP getPosNegInclusionLP(ReasoningService reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { @@ -135,6 +156,15 @@ } /** +* @param positiveExamples positive examples +* @param reasoningService see ReasoningService +* @return a component ready for initialization PosOnlyInclusionLP +**/ +public static PosOnlyInclusionLP getPosOnlyInclusionLP(ReasoningService reasoningService, Set<String> positiveExamples) { +return PosOnlyInclusionLPConfigurator.getPosOnlyInclusionLP(reasoningService, positiveExamples); +} + +/** * @param learningProblem see LearningProblem * @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see @@ -168,6 +198,16 @@ * @param learningProblem see LearningProblem * @param reasoningService see ReasoningService * @throws LearningProblemUnsupportedException see +* @return a component ready for initialization SimpleSuggestionLearningAlgorithm +**/ +public static SimpleSuggestionLearningAlgorithm getSimpleSuggestionLearningAlgorithm(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException { +return SimpleSuggestionLearningAlgorithmConfigurator.getSimpleSuggestionLearningAlgorithm(learningProblem, reasoningService); +} + +/** +* @param learningProblem see LearningProblem +* @param reasoningService see ReasoningService +* @throws LearningProblemUnsupportedException see * @return a component ready for initialization GP **/ public static GP getGP(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException { Added: trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/OWLAPIOntologyConfigurator.java 2008-09-09 09:42:37 UTC (rev 1182) @@ -0,0 +1,62 @@ +/** + * 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 org.dllearner.core.ComponentManager; +import org.dllearner.kb.OWLAPIOntology; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class OWLAPIOntologyConfigurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private OWLAPIOntology oWLAPIOntology; + +/** +* @param oWLAPIOntology see OWLAPIOntology +**/ +public OWLAPIOntologyConfigurator(OWLAPIOntology oWLAPIOntology){ +this.oWLAPIOntology = oWLAPIOntology; +} + +/** +* @return OWLAPIOntology +**/ +public static OWLAPIOntology getOWLAPIOntology() { +OWLAPIOntology component = ComponentManager.getInstance().knowledgeSource(OWLAPIOntology.class); +return component; +} + + + +/** +* true, if this component needs reinitializsation +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Added: trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java 2008-09-09 09:42:37 UTC (rev 1182) @@ -0,0 +1,212 @@ +/** + * 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.ReasoningService; +import org.dllearner.learningproblems.PosNegDefinitionLPStrict; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class PosNegDefinitionLPStrictConfigurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private PosNegDefinitionLPStrict posNegDefinitionLPStrict; + +/** +* @param posNegDefinitionLPStrict see PosNegDefinitionLPStrict +**/ +public PosNegDefinitionLPStrictConfigurator(PosNegDefinitionLPStrict posNegDefinitionLPStrict){ +this.posNegDefinitionLPStrict = posNegDefinitionLPStrict; +} + +/** +* @param positiveExamples positive examples +* @param negativeExamples negative examples +* @return PosNegDefinitionLPStrict +**/ +public static PosNegDefinitionLPStrict getPosNegDefinitionLPStrict(ReasoningService reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +PosNegDefinitionLPStrict component = ComponentManager.getInstance().learningProblem(PosNegDefinitionLPStrict.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(posNegDefinitionLPStrict, "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(posNegDefinitionLPStrict, "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(posNegDefinitionLPStrict, "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(posNegDefinitionLPStrict, "percentPerLenghtUnit") ; +} +/** +* useMultiInstanceChecks See UseMultiInstanceChecks enum.. +* mandatory: false| reinit necessary: true +* default value: twoChecks +* @return String +**/ +public String getUseMultiInstanceChecks() { +return (String) ComponentManager.getInstance().getConfigOptionValue(posNegDefinitionLPStrict, "useMultiInstanceChecks") ; +} +/** +* penaliseNeutralExamples if set to true neutral examples are penalised. +* mandatory: false| reinit necessary: true +* default value: null +* @return boolean +**/ +public boolean getPenaliseNeutralExamples() { +return (Boolean) ComponentManager.getInstance().getConfigOptionValue(posNegDefinitionLPStrict, "penaliseNeutralExamples") ; +} +/** +* accuracyPenalty penalty for pos/neg examples which are classified as neutral. +* mandatory: false| reinit necessary: true +* default value: 1.0 +* @return double +**/ +public double getAccuracyPenalty() { +return (Double) ComponentManager.getInstance().getConfigOptionValue(posNegDefinitionLPStrict, "accuracyPenalty") ; +} +/** +* errorPenalty penalty for pos. examples classified as negative or vice versa. +* mandatory: false| reinit necessary: true +* default value: 3.0 +* @return double +**/ +public double getErrorPenalty() { +return (Double) ComponentManager.getInstance().getConfigOptionValue(posNegDefinitionLPStrict, "errorPenalty") ; +} + +/** +* @param positiveExamples positive examples. +* mandatory: true| reinit necessary: false +* default value: null +**/ +public void setPositiveExamples(Set<String> positiveExamples) { +ComponentManager.getInstance().applyConfigEntry(posNegDefinitionLPStrict, "positiveExamples", positiveExamples); +} +/** +* @param negativeExamples negative examples. +* mandatory: true| reinit necessary: false +* default value: null +**/ +public void setNegativeExamples(Set<String> negativeExamples) { +ComponentManager.getInstance().applyConfigEntry(posNegDefinitionLPStrict, "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(posNegDefinitionLPStrict, "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(posNegDefinitionLPStrict, "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(posNegDefinitionLPStrict, "useMultiInstanceChecks", useMultiInstanceChecks); +reinitNecessary = true; +} +/** +* @param penaliseNeutralExamples if set to true neutral examples are penalised. +* mandatory: false| reinit necessary: true +* default value: null +**/ +public void setPenaliseNeutralExamples(boolean penaliseNeutralExamples) { +ComponentManager.getInstance().applyConfigEntry(posNegDefinitionLPStrict, "penaliseNeutralExamples", penaliseNeutralExamples); +reinitNecessary = true; +} +/** +* @param accuracyPenalty penalty for pos/neg examples which are classified as neutral. +* mandatory: false| reinit necessary: true +* default value: 1.0 +**/ +public void setAccuracyPenalty(double accuracyPenalty) { +ComponentManager.getInstance().applyConfigEntry(posNegDefinitionLPStrict, "accuracyPenalty", accuracyPenalty); +reinitNecessary = true; +} +/** +* @param errorPenalty penalty for pos. examples classified as negative or vice versa. +* mandatory: false| reinit necessary: true +* default value: 3.0 +**/ +public void setErrorPenalty(double errorPenalty) { +ComponentManager.getInstance().applyConfigEntry(posNegDefinitionLPStrict, "errorPenalty", errorPenalty); +reinitNecessary = true; +} + +/** +* true, if this component needs reinitializsation +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Added: trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java 2008-09-09 09:42:37 UTC (rev 1182) @@ -0,0 +1,84 @@ +/** + * 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.ReasoningService; +import org.dllearner.learningproblems.PosOnlyInclusionLP; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class PosOnlyInclusionLPConfigurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private PosOnlyInclusionLP posOnlyInclusionLP; + +/** +* @param posOnlyInclusionLP see PosOnlyInclusionLP +**/ +public PosOnlyInclusionLPConfigurator(PosOnlyInclusionLP posOnlyInclusionLP){ +this.posOnlyInclusionLP = posOnlyInclusionLP; +} + +/** +* @param positiveExamples positive examples +* @return PosOnlyInclusionLP +**/ +public static PosOnlyInclusionLP getPosOnlyInclusionLP(ReasoningService reasoningService, Set<String> positiveExamples) { +PosOnlyInclusionLP component = ComponentManager.getInstance().learningProblem(PosOnlyInclusionLP.class, reasoningService); +ComponentManager.getInstance().applyConfigEntry(component, "positiveExamples", positiveExamples); +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(posOnlyInclusionLP, "positiveExamples") ; +} + +/** +* @param positiveExamples positive examples. +* mandatory: true| reinit necessary: false +* default value: null +**/ +public void setPositiveExamples(Set<String> positiveExamples) { +ComponentManager.getInstance().applyConfigEntry(posOnlyInclusionLP, "positiveExamples", positiveExamples); +} + +/** +* true, if this component needs reinitializsation +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Added: trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java 2008-09-09 09:42:37 UTC (rev 1182) @@ -0,0 +1,65 @@ +/** + * 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 org.dllearner.algorithms.SimpleSuggestionLearningAlgorithm; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.ReasoningService; + +/** +* automatically generated, do not edit manually. +* run org.dllearner.scripts.ConfigJavaGenerator to update +**/ +public class SimpleSuggestionLearningAlgorithmConfigurator { + +private boolean reinitNecessary = false; +@SuppressWarnings("unused") + +private SimpleSuggestionLearningAlgorithm simpleSuggestionLearningAlgorithm; + +/** +* @param simpleSuggestionLearningAlgorithm see SimpleSuggestionLearningAlgorithm +**/ +public SimpleSuggestionLearningAlgorithmConfigurator(SimpleSuggestionLearningAlgorithm simpleSuggestionLearningAlgorithm){ +this.simpleSuggestionLearningAlgorithm = simpleSuggestionLearningAlgorithm; +} + +/** +* @return SimpleSuggestionLearningAlgorithm +**/ +public static SimpleSuggestionLearningAlgorithm getSimpleSuggestionLearningAlgorithm(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException{ +SimpleSuggestionLearningAlgorithm component = ComponentManager.getInstance().learningAlgorithm(SimpleSuggestionLearningAlgorithm.class, learningProblem, reasoningService); +return component; +} + + + +/** +* true, if this component needs reinitializsation +**/ +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Modified: trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-09-09 09:42:10 UTC (rev 1181) +++ trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java 2008-09-09 09:42:37 UTC (rev 1182) @@ -142,6 +142,7 @@ public OWLAPIReasoner(Set<KnowledgeSource> sources) { this.sources = sources; this.configurator = new OWLAPIReasonerConfigurator(this); + } public static String getName() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |