From: <ku...@us...> - 2008-09-05 14:53:23
|
Revision: 1171 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1171&view=rev Author: kurzum Date: 2008-09-05 14:53:16 +0000 (Fri, 05 Sep 2008) Log Message: ----------- finished java interface for some components Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java trunk/src/dl-learner/org/dllearner/core/config/ConfigOption.java trunk/src/dl-learner/org/dllearner/core/config/DoubleConfigOption.java trunk/src/dl-learner/org/dllearner/core/config/IntegerConfigOption.java trunk/src/dl-learner/org/dllearner/core/config/StringConfigOption.java trunk/src/dl-learner/org/dllearner/core/configuration/Configurator.java trunk/src/dl-learner/org/dllearner/core/configuration/FastInstanceCheckerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/OWLFileConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/SparqlKnowledgeSourceConfigurator.java trunk/src/dl-learner/org/dllearner/kb/KBFile.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyLP.java trunk/src/dl-learner/org/dllearner/reasoning/FastInstanceChecker.java trunk/src/dl-learner/org/dllearner/reasoning/OWLAPIReasoner.java trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java trunk/src/dl-learner/org/dllearner/scripts/NewSample.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFile.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/core/configuration/BruteForceLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/DBpediaNavigationSuggestorConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/DIGReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/ExampleBasedROLComponentConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/FastRetrievalReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/GPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/KBFileConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/OWLAPIReasonerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/PosNegDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/PosNegInclusionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/PosOnlyDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/ROLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configuration/RandomGuesserConfigurator.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -36,16 +36,17 @@ import org.dllearner.core.config.ConfigOption; import org.dllearner.core.config.IntegerConfigOption; import org.dllearner.core.config.InvalidConfigOptionValueException; +import org.dllearner.core.config.ConfigOption.Tags; +import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Intersection; -import org.dllearner.core.owl.Union; -import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.Negation; import org.dllearner.core.owl.Nothing; -import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.ObjectAllRestriction; +import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.ObjectSomeRestriction; -import org.dllearner.core.owl.Negation; -import org.dllearner.core.owl.ObjectProperty; import org.dllearner.core.owl.Thing; +import org.dllearner.core.owl.Union; /** * A brute force learning algorithm. @@ -64,6 +65,7 @@ private Description bestDefinition; private Score bestScore; + //changing this wont have any effect any more private Integer maxLength = 7; private String returnType; @@ -90,7 +92,7 @@ public static Collection<ConfigOption<?>> createConfigOptions() { Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - options.add(new IntegerConfigOption("maxLength", "maximum length of generated concepts")); + options.add(new IntegerConfigOption("maxLength", "maximum length of generated concepts", 7, Tags.NORMAL)); options.add(CommonConfigOptions.getReturnType()); return options; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -36,6 +36,7 @@ import org.dllearner.core.config.DoubleConfigOption; import org.dllearner.core.config.InvalidConfigOptionValueException; import org.dllearner.core.config.StringConfigOption; +import org.dllearner.core.config.ConfigOption.Tags; import org.dllearner.core.owl.Description; import org.dllearner.learningproblems.PosNegDefinitionLP; import org.dllearner.learningproblems.PosNegLP; @@ -118,7 +119,8 @@ options.add(CommonConfigOptions.minExecutionTimeInSeconds()); options.add(CommonConfigOptions.guaranteeXgoodDescriptions()); options.add(CommonConfigOptions.getLogLevel()); - DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples"); + //TODO make a commonconfig Option out of this + DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples",0.0,Tags.NORMAL); noisePercentage.setLowerLimit(0); noisePercentage.setUpperLimit(100); options.add(noisePercentage); Modified: trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -23,8 +23,8 @@ import java.util.LinkedList; import org.apache.log4j.Logger; +import org.dllearner.algorithms.gp.GPUtilities; import org.dllearner.algorithms.gp.Program; -import org.dllearner.algorithms.gp.GPUtilities; import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; @@ -34,6 +34,7 @@ import org.dllearner.core.config.ConfigOption; import org.dllearner.core.config.IntegerConfigOption; import org.dllearner.core.config.InvalidConfigOptionValueException; +import org.dllearner.core.config.ConfigOption.Tags; import org.dllearner.core.owl.Description; public class RandomGuesser extends LearningAlgorithm { @@ -65,8 +66,8 @@ public static Collection<ConfigOption<?>> createConfigOptions() { Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); - options.add(new IntegerConfigOption("numberOfTrees", "number of randomly generated concepts/trees")); - options.add(new IntegerConfigOption("maxDepth", "maximum depth of generated concepts/trees")); + options.add(new IntegerConfigOption("numberOfTrees", "number of randomly generated concepts/trees", 5, Tags.NORMAL)); + options.add(new IntegerConfigOption("maxDepth", "maximum depth of generated concepts/trees", 5, Tags.NORMAL)); return options; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -44,16 +44,18 @@ import org.dllearner.core.config.IntegerConfigOption; import org.dllearner.core.config.InvalidConfigOptionValueException; import org.dllearner.core.config.StringConfigOption; +import org.dllearner.core.config.ConfigOption.Tags; +import org.dllearner.core.configuration.ExampleBasedROLComponentConfigurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.NamedClass; import org.dllearner.core.owl.ObjectProperty; import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyDefinitionLP; import org.dllearner.learningproblems.PosOnlyLP; +import org.dllearner.reasoning.ReasonerType; import org.dllearner.refinementoperators.RhoDRDown; import org.dllearner.utilities.Files; import org.dllearner.utilities.Helper; -import org.dllearner.reasoning.ReasonerType; /** * The DL-Learner learning algorithm component for the example @@ -91,6 +93,13 @@ private ReasoningService rs; private LearningProblem learningProblem; + private ExampleBasedROLComponentConfigurator configurator; + public ExampleBasedROLComponentConfigurator getConfigurator(){ + return configurator; + } + + + // configuration options private boolean writeSearchTree; private File searchTreeFile; @@ -116,10 +125,15 @@ private boolean useNegation = CommonConfigOptions.useNegationDefault; private boolean useBooleanDatatypes = CommonConfigOptions.useBooleanDatatypesDefault; private boolean useDoubleDatatypes = CommonConfigOptions.useDoubleDatatypesDefault; - private double noisePercentage = 0.0; + private static double noisePercentageDefault = 0.0; + private double noisePercentage = noisePercentageDefault; private NamedClass startClass = null; - private boolean usePropernessChecks = false; - private int maxPosOnlyExpansion = 4; + //refactor this + private static boolean usePropernessChecksDefault = false; + private boolean usePropernessChecks = usePropernessChecksDefault; + // refactor this + private static int maxPosOnlyExpansionDefault = 4; + private int maxPosOnlyExpansion = maxPosOnlyExpansionDefault; //extended Options //in seconds private int maxExecutionTimeInSeconds = CommonConfigOptions.maxExecutionTimeInSecondsDefault; @@ -141,11 +155,13 @@ public ExampleBasedROLComponent(PosNegLP learningProblem, ReasoningService rs) { this.learningProblem = learningProblem; this.rs = rs; + this.configurator = new ExampleBasedROLComponentConfigurator(this); } public ExampleBasedROLComponent(PosOnlyDefinitionLP learningProblem, ReasoningService rs) { this.learningProblem = learningProblem; this.rs = rs; + this.configurator = new ExampleBasedROLComponentConfigurator(this); } public static Collection<Class<? extends LearningProblem>> supportedLearningProblems() { @@ -188,10 +204,10 @@ options.add(CommonConfigOptions.minExecutionTimeInSeconds()); options.add(CommonConfigOptions.guaranteeXgoodDescriptions()); options.add(CommonConfigOptions.getLogLevel()); - options.add(new BooleanConfigOption("usePropernessChecks", "specifies whether to check for equivalence (i.e. discard equivalent refinements)")); + options.add(new BooleanConfigOption("usePropernessChecks", "specifies whether to check for equivalence (i.e. discard equivalent refinements)",usePropernessChecksDefault,Tags.NORMAL)); options.add(new IntegerConfigOption("maxPosOnlyExpansion", "specifies how often a node in the search tree of a posonly learning problem needs to be expanded before it is" + - " considered as solution candidate")); - DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples"); + " considered as solution candidate",maxPosOnlyExpansionDefault,Tags.NORMAL)); + DoubleConfigOption noisePercentage = new DoubleConfigOption("noisePercentage", "the (approximated) percentage of noise within the examples",noisePercentageDefault,Tags.NORMAL); noisePercentage.setLowerLimit(0); noisePercentage.setUpperLimit(100); options.add(noisePercentage); Modified: trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/core/config/CommonConfigOptions.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -19,7 +19,9 @@ */ package org.dllearner.core.config; +import org.dllearner.core.config.ConfigOption.Tags; + /** * Contains methods for creating common configuration options, i.e. options * which are or may be of use for several components. @@ -57,7 +59,7 @@ } public static DoubleConfigOption getPercentPerLenghtUnitOption(double defaultValue) { - DoubleConfigOption option = new DoubleConfigOption("percentPerLenghtUnit", "describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one", defaultValue); + DoubleConfigOption option = new DoubleConfigOption("percentPerLenghtUnit", "describes the reduction in classification accuracy in percent one is willing to accept for reducing the length of the concept by one", defaultValue, Tags.NORMAL); option.setLowerLimit(0.0); option.setUpperLimit(1.0); return option; @@ -112,7 +114,7 @@ } public static BooleanConfigOption useDoubleDatatypes() { - return new BooleanConfigOption("useBooleanDatatypes", "specifies whether boolean datatypes are used in the learning algorothm",useDoubleDatatypesDefault); + return new BooleanConfigOption("useDoubleDatatypes", "specifies whether boolean datatypes are used in the learning algorothm",useDoubleDatatypesDefault); } public static IntegerConfigOption maxExecutionTimeInSeconds() { Modified: trunk/src/dl-learner/org/dllearner/core/config/ConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/ConfigOption.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/core/config/ConfigOption.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -152,6 +152,14 @@ return "option name: " + name + "\ndescription: " + description + "\nvalues: " + getAllowedValuesDescription() + "\ndefault value: " + defaultValue + "\n"; } + + public String getJavaDocString() { + String line = "* option name: " + name + "\n"; + line += "* " + description + "\n"; + //line += "* allowed values: "+ getAllowedValuesDescription() + "\n"; + line += "* default value: " + defaultValue + "\n"; + return line; + } /** * Get a formatted value to put into configuration file. Modified: trunk/src/dl-learner/org/dllearner/core/config/DoubleConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/DoubleConfigOption.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/core/config/DoubleConfigOption.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -19,7 +19,6 @@ */ package org.dllearner.core.config; -import org.dllearner.core.config.ConfigOption.Tags; /** * Represents a configuration option with values of type value. Similar to the Modified: trunk/src/dl-learner/org/dllearner/core/config/IntegerConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/IntegerConfigOption.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/core/config/IntegerConfigOption.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -19,7 +19,6 @@ */ package org.dllearner.core.config; -import org.dllearner.core.config.ConfigOption.Tags; /** * A configuration option, which allows values of type integer. A minimum and Modified: trunk/src/dl-learner/org/dllearner/core/config/StringConfigOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/config/StringConfigOption.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/core/config/StringConfigOption.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -23,8 +23,6 @@ import java.util.Set; import java.util.TreeSet; -import org.dllearner.core.config.ConfigOption.Tags; - /** * A configuration option, which allows values of type String. Optionally a set * of allowed strings can be set. By default all strings are allowed. Added: trunk/src/dl-learner/org/dllearner/core/configuration/BruteForceLearnerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configuration/BruteForceLearnerConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configuration/BruteForceLearnerConfigurator.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -0,0 +1,102 @@ +/** + * 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.configuration; + +import org.dllearner.algorithms.BruteForceLearner; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.ReasoningService; +import org.dllearner.core.config.ConfigEntry; +import org.dllearner.core.configuration.Configurator; + +/** +* automatically generated, do not edit manually +**/ +@SuppressWarnings("unused") +public class BruteForceLearnerConfigurator extends Configurator { + +private boolean reinitNecessary = false; +private BruteForceLearner BruteForceLearner; +private int maxLength = 7; +private String returnType = null; + +public BruteForceLearnerConfigurator (BruteForceLearner BruteForceLearner){ +this.BruteForceLearner = BruteForceLearner; +} + +/** +**/ +public static BruteForceLearner getBruteForceLearner (ComponentManager cm, LearningProblem learningProblem, ReasoningService reasoningService ) throws LearningProblemUnsupportedException{ +BruteForceLearner component = cm.learningAlgorithm(BruteForceLearner.class, learningProblem, reasoningService ); +return component; +} + +@SuppressWarnings({ "unchecked" }) +public <T> void applyConfigEntry(ConfigEntry<T> entry){ +String optionName = entry.getOptionName(); +if(false){//empty block +}else if (optionName.equals("maxLength")){ +maxLength = (Integer) entry.getValue(); +}else if (optionName.equals("returnType")){ +returnType = (String) entry.getValue(); +} +} + +/** +* option name: maxLength +* maximum length of generated concepts +* default value: 7 +**/ +public int getMaxLength ( ) { +return this.maxLength; +} +/** +* option name: returnType +* Specifies the type which the solution has to belong to (if already) known. This means we inform the learning algorithm that the solution is a subclass of this type. +* default value: null +**/ +public String getReturnType ( ) { +return this.returnType; +} + +/** +* option name: maxLength +* maximum length of generated concepts +* default value: 7 +**/ +public void setMaxLength ( ComponentManager cm, int maxLength) { +cm.applyConfigEntry(BruteForceLearner, "maxLength", maxLength); +} +/** +* option name: returnType +* Specifies the type which the solution has to belong to (if already) known. This means we inform the learning algorithm that the solution is a subclass of this type. +* default value: null +**/ +public void setReturnType ( ComponentManager cm, String returnType) { +cm.applyConfigEntry(BruteForceLearner, "returnType", returnType); +} + +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Modified: trunk/src/dl-learner/org/dllearner/core/configuration/Configurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configuration/Configurator.java 2008-09-05 12:24:05 UTC (rev 1170) +++ trunk/src/dl-learner/org/dllearner/core/configuration/Configurator.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -18,44 +18,156 @@ **/ package org.dllearner.core.configuration; + import java.util.Set; +import org.dllearner.algorithms.BruteForceLearner; +import org.dllearner.algorithms.DBpediaNavigationSuggestor; +import org.dllearner.algorithms.RandomGuesser; +import org.dllearner.algorithms.gp.GP; +import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; +import org.dllearner.algorithms.refinement.ROLearner; import org.dllearner.core.ComponentManager; import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.ReasoningService; +import org.dllearner.core.configuration.BruteForceLearnerConfigurator; +import org.dllearner.core.configuration.DBpediaNavigationSuggestorConfigurator; +import org.dllearner.core.configuration.DIGReasonerConfigurator; +import org.dllearner.core.configuration.ExampleBasedROLComponentConfigurator; import org.dllearner.core.configuration.FastInstanceCheckerConfigurator; +import org.dllearner.core.configuration.FastRetrievalReasonerConfigurator; +import org.dllearner.core.configuration.GPConfigurator; +import org.dllearner.core.configuration.KBFileConfigurator; +import org.dllearner.core.configuration.OWLAPIReasonerConfigurator; import org.dllearner.core.configuration.OWLFileConfigurator; +import org.dllearner.core.configuration.PosNegDefinitionLPConfigurator; +import org.dllearner.core.configuration.PosNegInclusionLPConfigurator; +import org.dllearner.core.configuration.PosOnlyDefinitionLPConfigurator; +import org.dllearner.core.configuration.ROLearnerConfigurator; +import org.dllearner.core.configuration.RandomGuesserConfigurator; import org.dllearner.core.configuration.SparqlKnowledgeSourceConfigurator; +import org.dllearner.kb.KBFile; import org.dllearner.kb.OWLFile; import org.dllearner.kb.sparql.SparqlKnowledgeSource; +import org.dllearner.learningproblems.PosNegDefinitionLP; +import org.dllearner.learningproblems.PosNegInclusionLP; +import org.dllearner.learningproblems.PosOnlyDefinitionLP; +import org.dllearner.reasoning.DIGReasoner; import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.reasoning.FastRetrievalReasoner; +import org.dllearner.reasoning.OWLAPIReasoner; /** * automatically generated, do not edit manually **/ +@SuppressWarnings("unused") public class Configurator { /** -* url: URL pointing to the OWL file +* @param filename pointer to the KB file on local file system **/ -public static OWLFile getOWLFile (ComponentManager cm, String url ) { +public static KBFile getKBFile (ComponentManager cm, String filename ) { +return KBFileConfigurator.getKBFile(cm, filename); +} + +/** +* @param url URL pointing to the OWL file +**/ +public static OWLFile getOWLFile (ComponentManager cm, String url ) { return OWLFileConfigurator.getOWLFile(cm, url); } /** -* instances: relevant instances e.g. positive and negative examples in a learning problem +* @param instances relevant instances e.g. positive and negative examples in a learning problem **/ -public static SparqlKnowledgeSource getSparqlKnowledgeSource (ComponentManager cm, Set<String> instances ) { +public static SparqlKnowledgeSource getSparqlKnowledgeSource (ComponentManager cm, Set<String> instances ) { return SparqlKnowledgeSourceConfigurator.getSparqlKnowledgeSource(cm, instances); } /** **/ -public static FastInstanceChecker getFastInstanceChecker (ComponentManager cm, KnowledgeSource knowledgeSource ) { +public static DIGReasoner getDIGReasoner (ComponentManager cm, KnowledgeSource knowledgeSource ) { +return DIGReasonerConfigurator.getDIGReasoner(cm, knowledgeSource); +} + +/** +**/ +public static FastInstanceChecker getFastInstanceChecker (ComponentManager cm, KnowledgeSource knowledgeSource ) { return FastInstanceCheckerConfigurator.getFastInstanceChecker(cm, knowledgeSource); } +/** +**/ +public static FastRetrievalReasoner getFastRetrievalReasoner (ComponentManager cm, KnowledgeSource knowledgeSource ) { +return FastRetrievalReasonerConfigurator.getFastRetrievalReasoner(cm, knowledgeSource); +} +/** +**/ +public static OWLAPIReasoner getOWLAPIReasoner (ComponentManager cm, KnowledgeSource knowledgeSource ) { +return OWLAPIReasonerConfigurator.getOWLAPIReasoner(cm, knowledgeSource); } + +/** +* @param positiveExamples positive examples +* @param negativeExamples negative examples +**/ +public static PosNegDefinitionLP getPosNegDefinitionLP (ComponentManager cm, ReasoningService reasoningService, Set<String> positiveExamples, Set<String> negativeExamples ) { +return PosNegDefinitionLPConfigurator.getPosNegDefinitionLP(cm, reasoningService, positiveExamples, negativeExamples); +} + +/** +* @param positiveExamples positive examples +* @param negativeExamples negative examples +**/ +public static PosNegInclusionLP getPosNegInclusionLP (ComponentManager cm, ReasoningService reasoningService, Set<String> positiveExamples, Set<String> negativeExamples ) { +return PosNegInclusionLPConfigurator.getPosNegInclusionLP(cm, reasoningService, positiveExamples, negativeExamples); +} + +/** +* @param positiveExamples positive examples +**/ +public static PosOnlyDefinitionLP getPosOnlyDefinitionLP (ComponentManager cm, ReasoningService reasoningService, Set<String> positiveExamples ) { +return PosOnlyDefinitionLPConfigurator.getPosOnlyDefinitionLP(cm, reasoningService, positiveExamples); +} + +/** +**/ +public static BruteForceLearner getBruteForceLearner (ComponentManager cm, LearningProblem learningProblem, ReasoningService reasoningService ) throws LearningProblemUnsupportedException { +return BruteForceLearnerConfigurator.getBruteForceLearner(cm, learningProblem, reasoningService); +} + +/** +**/ +public static DBpediaNavigationSuggestor getDBpediaNavigationSuggestor (ComponentManager cm, LearningProblem learningProblem, ReasoningService reasoningService ) throws LearningProblemUnsupportedException { +return DBpediaNavigationSuggestorConfigurator.getDBpediaNavigationSuggestor(cm, learningProblem, reasoningService); +} + +/** +**/ +public static RandomGuesser getRandomGuesser (ComponentManager cm, LearningProblem learningProblem, ReasoningService reasoningService ) throws LearningProblemUnsupportedException { +return RandomGuesserConfigurator.getRandomGuesser(cm, learningProblem, reasoningService); +} + +/** +**/ +public static GP getGP (ComponentManager cm, LearningProblem learningProblem, ReasoningService reasoningService ) throws LearningProblemUnsupportedException { +return GPConfigurator.getGP(cm, learningProblem, reasoningService); +} + +/** +**/ +public static ExampleBasedROLComponent getExampleBasedROLComponent (ComponentManager cm, LearningProblem learningProblem, ReasoningService reasoningService ) throws LearningProblemUnsupportedException { +return ExampleBasedROLComponentConfigurator.getExampleBasedROLComponent(cm, learningProblem, reasoningService); +} + +/** +**/ +public static ROLearner getROLearner (ComponentManager cm, LearningProblem learningProblem, ReasoningService reasoningService ) throws LearningProblemUnsupportedException { +return ROLearnerConfigurator.getROLearner(cm, learningProblem, reasoningService); +} + + +} Added: trunk/src/dl-learner/org/dllearner/core/configuration/DBpediaNavigationSuggestorConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configuration/DBpediaNavigationSuggestorConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configuration/DBpediaNavigationSuggestorConfigurator.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -0,0 +1,559 @@ +/** + * 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.configuration; + +import java.util.Set; +import org.dllearner.algorithms.DBpediaNavigationSuggestor; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.ReasoningService; +import org.dllearner.core.config.ConfigEntry; +import org.dllearner.core.configuration.Configurator; + +/** +* automatically generated, do not edit manually +**/ +@SuppressWarnings("unused") +public class DBpediaNavigationSuggestorConfigurator extends Configurator { + +private boolean reinitNecessary = false; +private DBpediaNavigationSuggestor DBpediaNavigationSuggestor; +private boolean writeSearchTree = false; +private String searchTreeFile = "log/searchTree.txt"; +private boolean replaceSearchTree = false; +private String heuristic = "lexicographic"; +private boolean applyAllFilter = true; +private boolean applyExistsFilter = true; +private boolean useTooWeakList = true; +private boolean useOverlyGeneralList = true; +private boolean useShortConceptConstruction = true; +private double horizontalExpansionFactor = 0.6; +private boolean improveSubsumptionHierarchy = true; +private Set<String> allowedConcepts = null; +private Set<String> ignoredConcepts = null; +private Set<String> allowedRoles = null; +private Set<String> ignoredRoles = null; +private boolean useAllConstructor = true; +private boolean useExistsConstructor = true; +private boolean useCardinalityRestrictions = true; +private boolean useNegation = true; +private boolean useBooleanDatatypes = true; +private int maxExecutionTimeInSeconds = 0; +private int minExecutionTimeInSeconds = 0; +private int guaranteeXgoodDescriptions = 1; +private String logLevel = "DEBUG"; +private double noisePercentage = 0.0; +private String startClass = null; + +public DBpediaNavigationSuggestorConfigurator (DBpediaNavigationSuggestor DBpediaNavigationSuggestor){ +this.DBpediaNavigationSuggestor = DBpediaNavigationSuggestor; +} + +/** +**/ +public static DBpediaNavigationSuggestor getDBpediaNavigationSuggestor (ComponentManager cm, LearningProblem learningProblem, ReasoningService reasoningService ) throws LearningProblemUnsupportedException{ +DBpediaNavigationSuggestor component = cm.learningAlgorithm(DBpediaNavigationSuggestor.class, learningProblem, reasoningService ); +return component; +} + +@SuppressWarnings({ "unchecked" }) +public <T> void applyConfigEntry(ConfigEntry<T> entry){ +String optionName = entry.getOptionName(); +if(false){//empty block +}else if (optionName.equals("writeSearchTree")){ +writeSearchTree = (Boolean) entry.getValue(); +}else if (optionName.equals("searchTreeFile")){ +searchTreeFile = (String) entry.getValue(); +}else if (optionName.equals("replaceSearchTree")){ +replaceSearchTree = (Boolean) entry.getValue(); +}else if (optionName.equals("heuristic")){ +heuristic = (String) entry.getValue(); +}else if (optionName.equals("applyAllFilter")){ +applyAllFilter = (Boolean) entry.getValue(); +}else if (optionName.equals("applyExistsFilter")){ +applyExistsFilter = (Boolean) entry.getValue(); +}else if (optionName.equals("useTooWeakList")){ +useTooWeakList = (Boolean) entry.getValue(); +}else if (optionName.equals("useOverlyGeneralList")){ +useOverlyGeneralList = (Boolean) entry.getValue(); +}else if (optionName.equals("useShortConceptConstruction")){ +useShortConceptConstruction = (Boolean) entry.getValue(); +}else if (optionName.equals("horizontalExpansionFactor")){ +horizontalExpansionFactor = (Double) entry.getValue(); +}else if (optionName.equals("improveSubsumptionHierarchy")){ +improveSubsumptionHierarchy = (Boolean) entry.getValue(); +}else if (optionName.equals("allowedConcepts")){ +allowedConcepts = (Set<String>) entry.getValue(); +}else if (optionName.equals("ignoredConcepts")){ +ignoredConcepts = (Set<String>) entry.getValue(); +}else if (optionName.equals("allowedRoles")){ +allowedRoles = (Set<String>) entry.getValue(); +}else if (optionName.equals("ignoredRoles")){ +ignoredRoles = (Set<String>) entry.getValue(); +}else if (optionName.equals("useAllConstructor")){ +useAllConstructor = (Boolean) entry.getValue(); +}else if (optionName.equals("useExistsConstructor")){ +useExistsConstructor = (Boolean) entry.getValue(); +}else if (optionName.equals("useCardinalityRestrictions")){ +useCardinalityRestrictions = (Boolean) entry.getValue(); +}else if (optionName.equals("useNegation")){ +useNegation = (Boolean) entry.getValue(); +}else if (optionName.equals("useBooleanDatatypes")){ +useBooleanDatatypes = (Boolean) entry.getValue(); +}else if (optionName.equals("maxExecutionTimeInSeconds")){ +maxExecutionTimeInSeconds = (Integer) entry.getValue(); +}else if (optionName.equals("minExecutionTimeInSeconds")){ +minExecutionTimeInSeconds = (Integer) entry.getValue(); +}else if (optionName.equals("guaranteeXgoodDescriptions")){ +guaranteeXgoodDescriptions = (Integer) entry.getValue(); +}else if (optionName.equals("logLevel")){ +logLevel = (String) entry.getValue(); +}else if (optionName.equals("noisePercentage")){ +noisePercentage = (Double) entry.getValue(); +}else if (optionName.equals("startClass")){ +startClass = (String) entry.getValue(); +} +} + +/** +* option name: writeSearchTree +* specifies whether to write a search tree +* default value: false +**/ +public boolean getWriteSearchTree ( ) { +return this.writeSearchTree; +} +/** +* option name: searchTreeFile +* file to use for the search tree +* default value: log/searchTree.txt +**/ +public String getSearchTreeFile ( ) { +return this.searchTreeFile; +} +/** +* option name: replaceSearchTree +* specifies whether to replace the search tree in the log file after each run or append the new search tree +* default value: false +**/ +public boolean getReplaceSearchTree ( ) { +return this.replaceSearchTree; +} +/** +* option name: heuristic +* specifiy the heuristic to use +* default value: lexicographic +**/ +public String getHeuristic ( ) { +return this.heuristic; +} +/** +* option name: applyAllFilter +* usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) +* default value: true +**/ +public boolean getApplyAllFilter ( ) { +return this.applyAllFilter; +} +/** +* option name: applyExistsFilter +* usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) +* default value: true +**/ +public boolean getApplyExistsFilter ( ) { +return this.applyExistsFilter; +} +/** +* option name: useTooWeakList +* try to filter out too weak concepts without sending them to the reasoner +* default value: true +**/ +public boolean getUseTooWeakList ( ) { +return this.useTooWeakList; +} +/** +* option name: useOverlyGeneralList +* try to find overly general concept without sending them to the reasoner +* default value: true +**/ +public boolean getUseOverlyGeneralList ( ) { +return this.useOverlyGeneralList; +} +/** +* option name: useShortConceptConstruction +* shorten concept to see whether they already exist +* default value: true +**/ +public boolean getUseShortConceptConstruction ( ) { +return this.useShortConceptConstruction; +} +/** +* option name: horizontalExpansionFactor +* horizontal expansion factor (see publication for description) +* default value: 0.6 +**/ +public double getHorizontalExpansionFactor ( ) { +return this.horizontalExpansionFactor; +} +/** +* option name: improveSubsumptionHierarchy +* simplify subsumption hierarchy to reduce search space (see publication for description) +* default value: true +**/ +public boolean getImproveSubsumptionHierarchy ( ) { +return this.improveSubsumptionHierarchy; +} +/** +* option name: allowedConcepts +* concepts the algorithm is allowed to use +* default value: null +**/ +public Set<String> getAllowedConcepts ( ) { +return this.allowedConcepts; +} +/** +* option name: ignoredConcepts +* concepts the algorithm must ignore +* default value: null +**/ +public Set<String> getIgnoredConcepts ( ) { +return this.ignoredConcepts; +} +/** +* option name: allowedRoles +* roles the algorithm is allowed to use +* default value: null +**/ +public Set<String> getAllowedRoles ( ) { +return this.allowedRoles; +} +/** +* option name: ignoredRoles +* roles the algorithm must ignore +* default value: null +**/ +public Set<String> getIgnoredRoles ( ) { +return this.ignoredRoles; +} +/** +* option name: useAllConstructor +* specifies whether the universal concept constructor is used in the learning algorithm +* default value: true +**/ +public boolean getUseAllConstructor ( ) { +return this.useAllConstructor; +} +/** +* option name: useExistsConstructor +* specifies whether the existential concept constructor is used in the learning algorithm +* default value: true +**/ +public boolean getUseExistsConstructor ( ) { +return this.useExistsConstructor; +} +/** +* option name: useCardinalityRestrictions +* specifies whether CardinalityRestrictions is used in the learning algorithm +* default value: true +**/ +public boolean getUseCardinalityRestrictions ( ) { +return this.useCardinalityRestrictions; +} +/** +* option name: useNegation +* specifies whether negation is used in the learning algorothm +* default value: true +**/ +public boolean getUseNegation ( ) { +return this.useNegation; +} +/** +* option name: useBooleanDatatypes +* specifies whether boolean datatypes are used in the learning algorothm +* default value: true +**/ +public boolean getUseBooleanDatatypes ( ) { +return this.useBooleanDatatypes; +} +/** +* option name: maxExecutionTimeInSeconds +* algorithm will stop after specified seconds +* default value: 0 +**/ +public int getMaxExecutionTimeInSeconds ( ) { +return this.maxExecutionTimeInSeconds; +} +/** +* option name: minExecutionTimeInSeconds +* algorithm will run at least specified seconds +* default value: 0 +**/ +public int getMinExecutionTimeInSeconds ( ) { +return this.minExecutionTimeInSeconds; +} +/** +* option name: guaranteeXgoodDescriptions +* algorithm will run until X good (100%) concept descritpions are found +* default value: 1 +**/ +public int getGuaranteeXgoodDescriptions ( ) { +return this.guaranteeXgoodDescriptions; +} +/** +* option name: logLevel +* determines the logLevel for this component, can be {TRACE, DEBUG, INFO} +* default value: DEBUG +**/ +public String getLogLevel ( ) { +return this.logLevel; +} +/** +* option name: noisePercentage +* the (approximated) percentage of noise within the examples +* default value: 0.0 +**/ +public double getNoisePercentage ( ) { +return this.noisePercentage; +} +/** +* option name: startClass +* the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) +* default value: null +**/ +public String getStartClass ( ) { +return this.startClass; +} + +/** +* option name: writeSearchTree +* specifies whether to write a search tree +* default value: false +**/ +public void setWriteSearchTree ( ComponentManager cm, boolean writeSearchTree) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "writeSearchTree", writeSearchTree); +} +/** +* option name: searchTreeFile +* file to use for the search tree +* default value: log/searchTree.txt +**/ +public void setSearchTreeFile ( ComponentManager cm, String searchTreeFile) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "searchTreeFile", searchTreeFile); +} +/** +* option name: replaceSearchTree +* specifies whether to replace the search tree in the log file after each run or append the new search tree +* default value: false +**/ +public void setReplaceSearchTree ( ComponentManager cm, boolean replaceSearchTree) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "replaceSearchTree", replaceSearchTree); +} +/** +* option name: heuristic +* specifiy the heuristic to use +* default value: lexicographic +**/ +public void setHeuristic ( ComponentManager cm, String heuristic) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "heuristic", heuristic); +} +/** +* option name: applyAllFilter +* usage of equivalence ALL R.C AND ALL R.D = ALL R.(C AND D) +* default value: true +**/ +public void setApplyAllFilter ( ComponentManager cm, boolean applyAllFilter) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "applyAllFilter", applyAllFilter); +} +/** +* option name: applyExistsFilter +* usage of equivalence EXISTS R.C OR EXISTS R.D = EXISTS R.(C OR D) +* default value: true +**/ +public void setApplyExistsFilter ( ComponentManager cm, boolean applyExistsFilter) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "applyExistsFilter", applyExistsFilter); +} +/** +* option name: useTooWeakList +* try to filter out too weak concepts without sending them to the reasoner +* default value: true +**/ +public void setUseTooWeakList ( ComponentManager cm, boolean useTooWeakList) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "useTooWeakList", useTooWeakList); +} +/** +* option name: useOverlyGeneralList +* try to find overly general concept without sending them to the reasoner +* default value: true +**/ +public void setUseOverlyGeneralList ( ComponentManager cm, boolean useOverlyGeneralList) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "useOverlyGeneralList", useOverlyGeneralList); +} +/** +* option name: useShortConceptConstruction +* shorten concept to see whether they already exist +* default value: true +**/ +public void setUseShortConceptConstruction ( ComponentManager cm, boolean useShortConceptConstruction) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "useShortConceptConstruction", useShortConceptConstruction); +} +/** +* option name: horizontalExpansionFactor +* horizontal expansion factor (see publication for description) +* default value: 0.6 +**/ +public void setHorizontalExpansionFactor ( ComponentManager cm, double horizontalExpansionFactor) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "horizontalExpansionFactor", horizontalExpansionFactor); +} +/** +* option name: improveSubsumptionHierarchy +* simplify subsumption hierarchy to reduce search space (see publication for description) +* default value: true +**/ +public void setImproveSubsumptionHierarchy ( ComponentManager cm, boolean improveSubsumptionHierarchy) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "improveSubsumptionHierarchy", improveSubsumptionHierarchy); +} +/** +* option name: allowedConcepts +* concepts the algorithm is allowed to use +* default value: null +**/ +public void setAllowedConcepts ( ComponentManager cm, Set<String> allowedConcepts) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "allowedConcepts", allowedConcepts); +} +/** +* option name: ignoredConcepts +* concepts the algorithm must ignore +* default value: null +**/ +public void setIgnoredConcepts ( ComponentManager cm, Set<String> ignoredConcepts) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "ignoredConcepts", ignoredConcepts); +} +/** +* option name: allowedRoles +* roles the algorithm is allowed to use +* default value: null +**/ +public void setAllowedRoles ( ComponentManager cm, Set<String> allowedRoles) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "allowedRoles", allowedRoles); +} +/** +* option name: ignoredRoles +* roles the algorithm must ignore +* default value: null +**/ +public void setIgnoredRoles ( ComponentManager cm, Set<String> ignoredRoles) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "ignoredRoles", ignoredRoles); +} +/** +* option name: useAllConstructor +* specifies whether the universal concept constructor is used in the learning algorithm +* default value: true +**/ +public void setUseAllConstructor ( ComponentManager cm, boolean useAllConstructor) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "useAllConstructor", useAllConstructor); +} +/** +* option name: useExistsConstructor +* specifies whether the existential concept constructor is used in the learning algorithm +* default value: true +**/ +public void setUseExistsConstructor ( ComponentManager cm, boolean useExistsConstructor) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "useExistsConstructor", useExistsConstructor); +} +/** +* option name: useCardinalityRestrictions +* specifies whether CardinalityRestrictions is used in the learning algorithm +* default value: true +**/ +public void setUseCardinalityRestrictions ( ComponentManager cm, boolean useCardinalityRestrictions) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "useCardinalityRestrictions", useCardinalityRestrictions); +} +/** +* option name: useNegation +* specifies whether negation is used in the learning algorothm +* default value: true +**/ +public void setUseNegation ( ComponentManager cm, boolean useNegation) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "useNegation", useNegation); +} +/** +* option name: useBooleanDatatypes +* specifies whether boolean datatypes are used in the learning algorothm +* default value: true +**/ +public void setUseBooleanDatatypes ( ComponentManager cm, boolean useBooleanDatatypes) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "useBooleanDatatypes", useBooleanDatatypes); +} +/** +* option name: maxExecutionTimeInSeconds +* algorithm will stop after specified seconds +* default value: 0 +**/ +public void setMaxExecutionTimeInSeconds ( ComponentManager cm, int maxExecutionTimeInSeconds) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds); +} +/** +* option name: minExecutionTimeInSeconds +* algorithm will run at least specified seconds +* default value: 0 +**/ +public void setMinExecutionTimeInSeconds ( ComponentManager cm, int minExecutionTimeInSeconds) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "minExecutionTimeInSeconds", minExecutionTimeInSeconds); +} +/** +* option name: guaranteeXgoodDescriptions +* algorithm will run until X good (100%) concept descritpions are found +* default value: 1 +**/ +public void setGuaranteeXgoodDescriptions ( ComponentManager cm, int guaranteeXgoodDescriptions) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "guaranteeXgoodDescriptions", guaranteeXgoodDescriptions); +} +/** +* option name: logLevel +* determines the logLevel for this component, can be {TRACE, DEBUG, INFO} +* default value: DEBUG +**/ +public void setLogLevel ( ComponentManager cm, String logLevel) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "logLevel", logLevel); +} +/** +* option name: noisePercentage +* the (approximated) percentage of noise within the examples +* default value: 0.0 +**/ +public void setNoisePercentage ( ComponentManager cm, double noisePercentage) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "noisePercentage", noisePercentage); +} +/** +* option name: startClass +* the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class) +* default value: null +**/ +public void setStartClass ( ComponentManager cm, String startClass) { +cm.applyConfigEntry(DBpediaNavigationSuggestor, "startClass", startClass); +} + +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Added: trunk/src/dl-learner/org/dllearner/core/configuration/DIGReasonerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configuration/DIGReasonerConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configuration/DIGReasonerConfigurator.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -0,0 +1,119 @@ +/** + * 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.configuration; + +import org.dllearner.core.ComponentManager; +import org.dllearner.core.KnowledgeSource; +import org.dllearner.core.config.ConfigEntry; +import org.dllearner.core.configuration.Configurator; +import org.dllearner.reasoning.DIGReasoner; + +/** +* automatically generated, do not edit manually +**/ +@SuppressWarnings("unused") +public class DIGReasonerConfigurator extends Configurator { + +private boolean reinitNecessary = false; +private DIGReasoner DIGReasoner; +private String reasonerUrl = null; +private boolean writeDIGProtocol = false; +private String digProtocolFile = "log/digProtocol.txt"; + +public DIGReasonerConfigurator (DIGReasoner DIGReasoner){ +this.DIGReasoner = DIGReasoner; +} + +/** +**/ +public static DIGReasoner getDIGReasoner (ComponentManager cm, KnowledgeSource knowledgeSource ) { +DIGReasoner component = cm.reasoner(DIGReasoner.class, knowledgeSource ); +return component; +} + +@SuppressWarnings({ "unchecked" }) +public <T> void applyConfigEntry(ConfigEntry<T> entry){ +String optionName = entry.getOptionName(); +if(false){//empty block +}else if (optionName.equals("reasonerUrl")){ +reasonerUrl = (String) entry.getValue(); +}else if (optionName.equals("writeDIGProtocol")){ +writeDIGProtocol = (Boolean) entry.getValue(); +}else if (optionName.equals("digProtocolFile")){ +digProtocolFile = (String) entry.getValue(); +} +} + +/** +* option name: reasonerUrl +* URL of the DIG reasoner +* default value: null +**/ +public String getReasonerUrl ( ) { +return this.reasonerUrl; +} +/** +* option name: writeDIGProtocol +* specifies whether or not to write a protocoll of send and received DIG requests +* default value: false +**/ +public boolean getWriteDIGProtocol ( ) { +return this.writeDIGProtocol; +} +/** +* option name: digProtocolFile +* the file to store the DIG protocol +* default value: log/digProtocol.txt +**/ +public String getDigProtocolFile ( ) { +return this.digProtocolFile; +} + +/** +* option name: reasonerUrl +* URL of the DIG reasoner +* default value: null +**/ +public void setReasonerUrl ( ComponentManager cm, String reasonerUrl) { +cm.applyConfigEntry(DIGReasoner, "reasonerUrl", reasonerUrl); +} +/** +* option name: writeDIGProtocol +* specifies whether or not to write a protocoll of send and received DIG requests +* default value: false +**/ +public void setWriteDIGProtocol ( ComponentManager cm, boolean writeDIGProtocol) { +cm.applyConfigEntry(DIGReasoner, "writeDIGProtocol", writeDIGProtocol); +} +/** +* option name: digProtocolFile +* the file to store the DIG protocol +* default value: log/digProtocol.txt +**/ +public void setDigProtocolFile ( ComponentManager cm, String digProtocolFile) { +cm.applyConfigEntry(DIGReasoner, "digProtocolFile", digProtocolFile); +} + +public boolean isReinitNecessary(){ +return reinitNecessary; +} + + +} Added: trunk/src/dl-learner/org/dllearner/core/configuration/ExampleBasedROLComponentConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configuration/ExampleBasedROLComponentConfigurator.java (rev 0) +++ trunk/src/dl-learner/org/dllearner/core/configuration/ExampleBasedROLComponentConfigurator.java 2008-09-05 14:53:16 UTC (rev 1171) @@ -0,0 +1,616 @@ +/** + * 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.configuration; + +import java.util.Set; +import org.dllearner.algorithms.refexamples.ExampleBasedROLComponent; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.LearningProblem; +import org.dllearner.core.LearningProblemUnsupportedException; +import org.dllearner.core.ReasoningService; +import org.dllearner.core.config.ConfigEntry; +import org.dllearner.core.configuration.Configurator; + +/** +* automatically generated, do not edit manually +**/ +@SuppressWarnings("unused") +public class ExampleBasedROLComponentConfigurator extends Configurator { + +private boolean reinitNecessary = false; +private ExampleBasedROLComponent ExampleBasedROLComponent; +private boolean writeSearchTree = false; +private String searchTreeFile = "log/searchTree.txt"; +private boolean replaceSearchTree = false; +private String heuristic = "lexicographic"; +private boolean applyAllFilter = true; +private boolean applyExistsFilter = true; +private boolean useTooWeakList = true; +private boolean useOverlyGeneralList = true; +private boolean useShortConceptConstruction = true; +private double horizontalExpansionFactor = 0.6; +private boolean improveSubsumptionHierarchy = true; +private Set<String> allowedConcepts = null; +private Set<String> ignoredConcepts = null; +private Set<String> allowedRoles = null; +private Set<String> ignoredRoles = null; +private boolean useAllConstructor = true; +private boolean useExistsConstructor = true; +private boolean useCardinalityRestrictions = true; +private boolean useNegation = true; +private boolean useBooleanDatatypes = true; +private boolean useDoubleDatatypes = true; +private int maxExecutionTimeInSeconds = 0; +private int minExecutionTimeInSeconds = 0; +private int guaranteeXgoodDescriptions = 1; +private String logLevel = "DEBUG"; +private boolean usePropernessChecks = false; +private int maxPosOnlyExpansion = 4; +private double noisePercentage = 0.0; +private String startClass = null; + +public ExampleBasedROLComponentConfigurator (ExampleBasedROLComponent ExampleBasedROLComponent){ +this.ExampleBasedROLComponent = ExampleBasedROLComponent; +} + +/** +**/ +public static ExampleBasedROLComponent getExampleBasedROLComponent (ComponentManager cm, LearningProblem learningProblem, ReasoningService reasoningService ) throws LearningProblemUnsupportedException{ +ExampleBasedROLComponent component = cm.learningAlgorithm(ExampleBasedROLComponent.class, learningProblem, reasoningService ); +return component; +} + +@SuppressWarnings({ "unchecked" }) +public <T> void applyConfigEntry(ConfigEntry<T> entry){ +String optionName = entry.getOptionName(); +if(false){//empty block +}else if (optionName.equals("writeSearchTree")){ +writeSearchTree = (Boolean) entry.getValue(); +}else if (optionName.equals("searchTreeFile")){ +searchTreeFile = (String) entry.getValue(); +}else if (optionName.equals("replaceSearchTree")){ +replaceSearchTree = (Boolean) entry.getValue(); +}else if (optionName.equals("heuristic")){ +heuristic = (String) entry.getValue(); +}else if (optionName.equals("applyAllFilter")){ +applyAllFilter = (Boolean) entry.getValue(); +}else if (optionName.equals("applyExistsFilter")){ +applyExistsFilter = (Boolean) entry.getValue(); +}else if (optionName.equals("useTooWeakList")){ +useTooWeakList = (Boolean) entry.getValue(); +}else if (optionName.equals("useOverlyGeneralList")){ +useOverlyGeneralList = (Boolean) entry.getValue(); +}else if (optionName.equals("useShortConceptConstruction")){ +useShortConceptConstruction = (Boolean) entry.getValue(); +}else if (optionName.equals("horizontalExpansionFactor")){ +horizontalExpansionFactor = (Double) entry.getValue(); +}else if (optionName.equals("improveSubsumptionHierarchy")){ +improveSubsumptionHierarchy = (Boolean) entry.getValue(); +}else if (optionName.equals("allowedConcepts")){ +allowedConcepts = (Set<String>) entry.getValue(); +}else if (optionName.equals("ignoredConcepts")){ +ignoredConcepts = (Set<String>) entry.getValue(); +}else if (optionName.equals("allowedRoles")){ +allowedRoles = (Set<String>) entry.getValue(); +}else if (optionName.equals("ignoredRoles")){ +ignoredRoles = (Set<String>) entry.getValue(); +}else if (optionName.equals("useAllConstructor")){ +useAllConstructor = (Boolean) entry.getValue(); +}else if (optionName.equals("useExistsConstructor")){ +useExistsConstructor = (Boolean) entry.getValue(); +}else if (optionName.equals("useCardinalityRestrictions")){ +useCardinalityRestrictions = (Boolean) entry.getValue(); +}else if (optionName.equals("useNegation")){ +useNegation = (Boolean) entry.getValue(); +}else if (optionName.equals("useBooleanDatatypes")){ +useBooleanDatatypes = (Boolean) entry.getValue(); +}else if (optionName.equals("useDoubleDatatypes")){ +useDoubleDatatypes = (Boolean) entry.getValue(); +}else if (optionName.equals("maxExecutionTimeInSeconds")){ +maxExecutionTimeInSeconds = (Integer) entry.getValue(); +}else if (optionName.equals("minExecutionTimeInSeconds")){ +minExecutionTimeInSeconds = (Integer) entry.getValue(); +}else if (optionName.equals("guaranteeXgoodDescriptions")){ +guaranteeXgoodDescriptions = (Integer) entry.getValue(); +}else if (optionName.equals("logLevel")){ +logLevel = (String) entry.getValue(); +}else if (optionName.equals("usePropernessChecks")){ +usePropernessChecks = (Boolean) entry.getValue(); +}else if (optionName.equals("maxPosOnlyExpansion")){ +maxPosOnlyExpansion = (Integer) entry.getValue(); +}else if (optionName.equals("noisePercentage")){ +noisePercentage = (Double) entry.getValue(); +}else if (optionName.equals("startClass")){ +startClass = (String) entry.getValue(); +} +} + +/** +* option name: writeSearchTree +* specifies whether to write a search tree +* default value: false +**/ +public boolean getWriteSearchTree ( ) { +return this.writeSearchTree; +} +/** +* option name: searchTreeFile +* file to use for the search tree +* default value: log/searchTree.txt +**/ +public String getSearchTreeFile ( ) { +return this.searchTreeFile; +} +/** +* option name: replaceSearchTree +* specifies whether to replace the search tree in the log file after each run or append the new search tree +* default value: false +**/ +public boolean getReplaceSearchTree ( ) { +return this.replaceSearchTree; +} +/** +* option name: heuristic +* specifiy the heuristic to use +* default value: lexicographic +**/ +public String getHeuristic ( ) { +return this.heuristic; +} +/** +* option name: applyAllFi... [truncated message content] |