From: <jen...@us...> - 2011-08-31 17:23:31
|
Revision: 3195 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3195&view=rev Author: jenslehmann Date: 2011-08-31 17:23:23 +0000 (Wed, 31 Aug 2011) Log Message: ----------- ripped out CELOECOnfigurator Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EvaluationComputingScript.java trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/OntologyEngineering.java trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java Removed Paths: ------------- trunk/components-core/src/main/java/org/dllearner/core/configurators/CELOEConfigurator.java trunk/scripts/src/main/java/org/dllearner/scripts/ConfigJavaGenerator.java Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java 2011-08-31 17:15:20 UTC (rev 3194) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/OEHeuristicRuntime.java 2011-08-31 17:23:23 UTC (rev 3195) @@ -22,7 +22,6 @@ import java.util.Comparator; import org.dllearner.core.ComponentAnn; -import org.dllearner.core.configurators.CELOEConfigurator; import org.dllearner.utilities.owl.ConceptComparator; /** Deleted: trunk/components-core/src/main/java/org/dllearner/core/configurators/CELOEConfigurator.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/configurators/CELOEConfigurator.java 2011-08-31 17:15:20 UTC (rev 3194) +++ trunk/components-core/src/main/java/org/dllearner/core/configurators/CELOEConfigurator.java 2011-08-31 17:23:23 UTC (rev 3195) @@ -1,539 +0,0 @@ -/** - * Copyright (C) 2007-2011, 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.algorithms.celoe.CELOE; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.AbstractLearningProblem; -import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.AbstractReasonerComponent; -import org.dllearner.core.configurators.RefinementOperatorConfigurator; - -/** -* automatically generated, do not edit manually. -* run org.dllearner.scripts.ConfigJavaGenerator to update -**/ -@SuppressWarnings("all") -public class CELOEConfigurator extends RefinementOperatorConfigurator implements Configurator { - -private boolean reinitNecessary = false; -private CELOE cELOE; - -/** -* @param cELOE see CELOE -**/ -public CELOEConfigurator(CELOE cELOE){ -this.cELOE = cELOE; -} - -/** -* @param reasoningService see reasoningService -* @param learningProblem see learningProblem -* @throws LearningProblemUnsupportedException see -* @return CELOE -**/ -public static CELOE getCELOE(AbstractLearningProblem learningProblem, AbstractReasonerComponent reasoningService) throws LearningProblemUnsupportedException{ -CELOE component = ComponentManager.getInstance().learningAlgorithm(CELOE.class, learningProblem, reasoningService); -return component; -} - -/** -* useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseAllConstructor() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useAllConstructor") ; -} -/** -* useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseExistsConstructor() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useExistsConstructor") ; -} -/** -* useHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getUseHasValueConstructor() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useHasValueConstructor") ; -} -/** -* useDataHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm in combination with data properties. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getUseDataHasValueConstructor() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useDataHasValueConstructor") ; -} -/** -* valueFrequencyThreshold specifies how often an object must occur as value in order to be considered for hasValue restrictions. -* mandatory: false| reinit necessary: true -* default value: 3 -* @return int -**/ -public int getValueFrequencyThreshold() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "valueFrequencyThreshold") ; -} -/** -* useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseCardinalityRestrictions() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useCardinalityRestrictions") ; -} -/** -* cardinalityLimit Gives the maximum number used in cardinality restrictions.. -* mandatory: false| reinit necessary: true -* default value: 5 -* @return int -**/ -public int getCardinalityLimit() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "cardinalityLimit") ; -} -/** -* useNegation specifies whether negation is used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getUseNegation() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useNegation") ; -} -/** -* useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseBooleanDatatypes() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useBooleanDatatypes") ; -} -/** -* useDoubleDatatypes specifies whether double datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getUseDoubleDatatypes() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "useDoubleDatatypes") ; -} -/** -* maxExecutionTimeInSeconds algorithm will stop after specified seconds. -* mandatory: false| reinit necessary: true -* default value: 10 -* @return int -**/ -public int getMaxExecutionTimeInSeconds() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxExecutionTimeInSeconds") ; -} -/** -* noisePercentage the (approximated) percentage of noise within the examples. -* mandatory: false| reinit necessary: true -* default value: 0.0 -* @return double -**/ -public double getNoisePercentage() { -return (Double) ComponentManager.getInstance().getConfigOptionValue(cELOE, "noisePercentage") ; -} -/** -* terminateOnNoiseReached specifies whether to terminate when noise criterion is met. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getTerminateOnNoiseReached() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "terminateOnNoiseReached") ; -} -/** -* maxDepth maximum depth of description. -* mandatory: false| reinit necessary: true -* default value: 7 -* @return int -**/ -public int getMaxDepth() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxDepth") ; -} -/** -* maxNrOfResults Sets the maximum number of results one is interested in. (Setting this to a lower value may increase performance as the learning algorithm has to store/evaluate/beautify less descriptions).. -* mandatory: false| reinit necessary: true -* default value: 10 -* @return int -**/ -public int getMaxNrOfResults() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxNrOfResults") ; -} -/** -* maxClassDescriptionTests The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.). -* mandatory: false| reinit necessary: true -* default value: 0 -* @return int -**/ -public int getMaxClassDescriptionTests() { -return (Integer) ComponentManager.getInstance().getConfigOptionValue(cELOE, "maxClassDescriptionTests") ; -} -/** -* singleSuggestionMode Use this if you are interested in only one suggestion and your learning problem has many (more than 1000) examples.. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getSingleSuggestionMode() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "singleSuggestionMode") ; -} -/** -* instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. -* mandatory: false| reinit necessary: true -* default value: true -* @return boolean -**/ -public boolean getInstanceBasedDisjoints() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "instanceBasedDisjoints") ; -} -/** -* filterDescriptionsFollowingFromKB If true, then the results will not contain suggestions, which already follow logically from the knowledge base. Be careful, since this requires a potentially expensive consistency check for candidate solutions.. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getFilterDescriptionsFollowingFromKB() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "filterDescriptionsFollowingFromKB") ; -} -/** -* reuseExistingDescription If true, the algorithm tries to find a good starting point close to an existing definition/super class of the given class in the knowledge base.. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getReuseExistingDescription() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "reuseExistingDescription") ; -} -/** -* writeSearchTree specifies whether to write a search tree. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getWriteSearchTree() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "writeSearchTree") ; -} -/** -* searchTreeFile file to use for the search tree. -* mandatory: false| reinit necessary: true -* default value: log/searchTree.txt -* @return String -**/ -public String getSearchTreeFile() { -return (String) ComponentManager.getInstance().getConfigOptionValue(cELOE, "searchTreeFile") ; -} -/** -* replaceSearchTree specifies whether to replace the search tree in the log file after each run or append the new search tree. -* mandatory: false| reinit necessary: true -* default value: false -* @return boolean -**/ -public boolean getReplaceSearchTree() { -return (Boolean) ComponentManager.getInstance().getConfigOptionValue(cELOE, "replaceSearchTree") ; -} -/** -* expansionPenaltyFactor heuristic penalty per syntactic construct used (lower = finds more complex expression, but might miss simple ones). -* mandatory: false| reinit necessary: true -* default value: 0.1 -* @return double -**/ -public double getExpansionPenaltyFactor() { -return (Double) ComponentManager.getInstance().getConfigOptionValue(cELOE, "expansionPenaltyFactor") ; -} -/** -* allowedConcepts concepts the algorithm is allowed to use. -* mandatory: false| reinit necessary: true -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getAllowedConcepts() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(cELOE, "allowedConcepts") ; -} -/** -* ignoredConcepts concepts the algorithm must ignore. -* mandatory: false| reinit necessary: true -* default value: null -* @return Set(String) -**/ -@SuppressWarnings("unchecked") -public Set<String> getIgnoredConcepts() { -return (Set<String>) ComponentManager.getInstance().getConfigOptionValue(cELOE, "ignoredConcepts") ; -} - -/** -* @param useAllConstructor specifies whether the universal concept constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseAllConstructor(boolean useAllConstructor) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "useAllConstructor", useAllConstructor); -reinitNecessary = true; -} -/** -* @param useExistsConstructor specifies whether the existential concept constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseExistsConstructor(boolean useExistsConstructor) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "useExistsConstructor", useExistsConstructor); -reinitNecessary = true; -} -/** -* @param useHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setUseHasValueConstructor(boolean useHasValueConstructor) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "useHasValueConstructor", useHasValueConstructor); -reinitNecessary = true; -} -/** -* @param useDataHasValueConstructor specifies whether the hasValue constructor is used in the learning algorithm in combination with data properties. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setUseDataHasValueConstructor(boolean useDataHasValueConstructor) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "useDataHasValueConstructor", useDataHasValueConstructor); -reinitNecessary = true; -} -/** -* @param valueFrequencyThreshold specifies how often an object must occur as value in order to be considered for hasValue restrictions. -* mandatory: false| reinit necessary: true -* default value: 3 -**/ -public void setValueFrequencyThreshold(int valueFrequencyThreshold) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "valueFrequencyThreshold", valueFrequencyThreshold); -reinitNecessary = true; -} -/** -* @param useCardinalityRestrictions specifies whether CardinalityRestrictions is used in the learning algorithm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseCardinalityRestrictions(boolean useCardinalityRestrictions) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "useCardinalityRestrictions", useCardinalityRestrictions); -reinitNecessary = true; -} -/** -* @param cardinalityLimit Gives the maximum number used in cardinality restrictions.. -* mandatory: false| reinit necessary: true -* default value: 5 -**/ -public void setCardinalityLimit(int cardinalityLimit) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "cardinalityLimit", cardinalityLimit); -reinitNecessary = true; -} -/** -* @param useNegation specifies whether negation is used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setUseNegation(boolean useNegation) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "useNegation", useNegation); -reinitNecessary = true; -} -/** -* @param useBooleanDatatypes specifies whether boolean datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseBooleanDatatypes(boolean useBooleanDatatypes) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "useBooleanDatatypes", useBooleanDatatypes); -reinitNecessary = true; -} -/** -* @param useDoubleDatatypes specifies whether double datatypes are used in the learning algorothm. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setUseDoubleDatatypes(boolean useDoubleDatatypes) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "useDoubleDatatypes", useDoubleDatatypes); -reinitNecessary = true; -} -/** -* @param maxExecutionTimeInSeconds algorithm will stop after specified seconds. -* mandatory: false| reinit necessary: true -* default value: 10 -**/ -public void setMaxExecutionTimeInSeconds(int maxExecutionTimeInSeconds) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds); -reinitNecessary = true; -} -/** -* @param noisePercentage the (approximated) percentage of noise within the examples. -* mandatory: false| reinit necessary: true -* default value: 0.0 -**/ -public void setNoisePercentage(double noisePercentage) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "noisePercentage", noisePercentage); -reinitNecessary = true; -} -/** -* @param terminateOnNoiseReached specifies whether to terminate when noise criterion is met. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setTerminateOnNoiseReached(boolean terminateOnNoiseReached) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "terminateOnNoiseReached", terminateOnNoiseReached); -reinitNecessary = true; -} -/** -* @param maxDepth maximum depth of description. -* mandatory: false| reinit necessary: true -* default value: 7 -**/ -public void setMaxDepth(int maxDepth) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "maxDepth", maxDepth); -reinitNecessary = true; -} -/** -* @param maxNrOfResults Sets the maximum number of results one is interested in. (Setting this to a lower value may increase performance as the learning algorithm has to store/evaluate/beautify less descriptions).. -* mandatory: false| reinit necessary: true -* default value: 10 -**/ -public void setMaxNrOfResults(int maxNrOfResults) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "maxNrOfResults", maxNrOfResults); -reinitNecessary = true; -} -/** -* @param maxClassDescriptionTests The maximum number of candidate hypothesis the algorithm is allowed to test (0 = no limit). The algorithm will stop afterwards. (The real number of tests can be slightly higher, because this criterion usually won't be checked after each single test.). -* mandatory: false| reinit necessary: true -* default value: 0 -**/ -public void setMaxClassDescriptionTests(int maxClassDescriptionTests) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "maxClassDescriptionTests", maxClassDescriptionTests); -reinitNecessary = true; -} -/** -* @param singleSuggestionMode Use this if you are interested in only one suggestion and your learning problem has many (more than 1000) examples.. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setSingleSuggestionMode(boolean singleSuggestionMode) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "singleSuggestionMode", singleSuggestionMode); -reinitNecessary = true; -} -/** -* @param instanceBasedDisjoints Specifies whether to use real disjointness checks or instance based ones (no common instances) in the refinement operator.. -* mandatory: false| reinit necessary: true -* default value: true -**/ -public void setInstanceBasedDisjoints(boolean instanceBasedDisjoints) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "instanceBasedDisjoints", instanceBasedDisjoints); -reinitNecessary = true; -} -/** -* @param filterDescriptionsFollowingFromKB If true, then the results will not contain suggestions, which already follow logically from the knowledge base. Be careful, since this requires a potentially expensive consistency check for candidate solutions.. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setFilterDescriptionsFollowingFromKB(boolean filterDescriptionsFollowingFromKB) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "filterDescriptionsFollowingFromKB", filterDescriptionsFollowingFromKB); -reinitNecessary = true; -} -/** -* @param reuseExistingDescription If true, the algorithm tries to find a good starting point close to an existing definition/super class of the given class in the knowledge base.. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setReuseExistingDescription(boolean reuseExistingDescription) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "reuseExistingDescription", reuseExistingDescription); -reinitNecessary = true; -} -/** -* @param writeSearchTree specifies whether to write a search tree. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setWriteSearchTree(boolean writeSearchTree) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "writeSearchTree", writeSearchTree); -reinitNecessary = true; -} -/** -* @param searchTreeFile file to use for the search tree. -* mandatory: false| reinit necessary: true -* default value: log/searchTree.txt -**/ -public void setSearchTreeFile(String searchTreeFile) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "searchTreeFile", searchTreeFile); -reinitNecessary = true; -} -/** -* @param replaceSearchTree specifies whether to replace the search tree in the log file after each run or append the new search tree. -* mandatory: false| reinit necessary: true -* default value: false -**/ -public void setReplaceSearchTree(boolean replaceSearchTree) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "replaceSearchTree", replaceSearchTree); -reinitNecessary = true; -} -/** -* @param expansionPenaltyFactor heuristic penalty per syntactic construct used (lower = finds more complex expression, but might miss simple ones). -* mandatory: false| reinit necessary: true -* default value: 0.1 -**/ -public void setExpansionPenaltyFactor(double expansionPenaltyFactor) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "expansionPenaltyFactor", expansionPenaltyFactor); -reinitNecessary = true; -} -/** -* @param allowedConcepts concepts the algorithm is allowed to use. -* mandatory: false| reinit necessary: true -* default value: null -**/ -public void setAllowedConcepts(Set<String> allowedConcepts) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "allowedConcepts", allowedConcepts); -reinitNecessary = true; -} -/** -* @param ignoredConcepts concepts the algorithm must ignore. -* mandatory: false| reinit necessary: true -* default value: null -**/ -public void setIgnoredConcepts(Set<String> ignoredConcepts) { -ComponentManager.getInstance().applyConfigEntry(cELOE, "ignoredConcepts", ignoredConcepts); -reinitNecessary = true; -} - -/** -* true, if this component needs reinitializsation. -* @return boolean -**/ -public boolean isReinitNecessary(){ -return reinitNecessary; -} - - -} Modified: trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2011-08-31 17:15:20 UTC (rev 3194) +++ trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2011-08-31 17:23:23 UTC (rev 3195) @@ -84,7 +84,6 @@ import org.dllearner.core.Score; import org.dllearner.core.config.ConfigHelper; import org.dllearner.core.config.ConfigOption; -import org.dllearner.core.configurators.CELOEConfigurator; import org.dllearner.core.owl.Axiom; import org.dllearner.core.owl.DatatypeProperty; import org.dllearner.core.owl.Entity; @@ -108,7 +107,6 @@ import org.dllearner.utilities.datastructures.Datastructures; import org.dllearner.utilities.datastructures.SetManipulation; import org.dllearner.utilities.datastructures.SortedSetTuple; -import org.dllearner.utilities.examples.AutomaticNegativeExampleFinderSPARQL; import org.dllearner.utilities.examples.AutomaticNegativeExampleFinderSPARQL2; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.io.SystemOutDocumentTarget; Deleted: trunk/scripts/src/main/java/org/dllearner/scripts/ConfigJavaGenerator.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/ConfigJavaGenerator.java 2011-08-31 17:15:20 UTC (rev 3194) +++ trunk/scripts/src/main/java/org/dllearner/scripts/ConfigJavaGenerator.java 2011-08-31 17:23:23 UTC (rev 3195) @@ -1,636 +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.scripts; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; - -import org.dllearner.core.AbstractCELA; -import org.dllearner.core.AbstractComponent; -import org.dllearner.core.AbstractKnowledgeSource; -import org.dllearner.core.AbstractLearningProblem; -import org.dllearner.core.AbstractReasonerComponent; -import org.dllearner.core.ComponentManager; -import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.configurators.CELOEConfigurator; -import org.dllearner.core.configurators.FuzzyCELOEConfigurator; -import org.dllearner.core.configurators.ISLEConfigurator; -import org.dllearner.core.configurators.ROLearnerConfigurator; -import org.dllearner.core.configurators.RefinementOperatorConfigurator; -import org.dllearner.core.options.ConfigOption; -import org.dllearner.kb.OWLAPIOntology; -import org.dllearner.reasoning.FastRetrievalReasoner; -import org.dllearner.utilities.Files; - -/** - * Collects information about all used configuration options and writes them - * into a file. This way the documentation is always in sync with the source - * code. - * - * @author Jens Lehmann - * @author Sebastian Hellmann - * - */ -public final class ConfigJavaGenerator { - - private static final SortedSet<String> DONOTDELETE = - new TreeSet<String>(Arrays.asList(new String[]{ - ".svn", - "RefinementOperatorConfigurator.java", - })); - - // currently it targets the configurators for - private static final SortedSet<String> EXTENDSREFINEMENTOPERATOR = - new TreeSet<String>(Arrays.asList(new String[]{ - ROLearnerConfigurator.class.getSimpleName(), -// OCELConfigurator.class.getSimpleName(), - CELOEConfigurator.class.getSimpleName(), - FuzzyCELOEConfigurator.class.getSimpleName(), - ISLEConfigurator.class.getSimpleName() - })); - - private static final Class<RefinementOperatorConfigurator> EXTENDSREFINEMENTOPERATORCLASS = RefinementOperatorConfigurator.class; - -// private static final boolean INCLUDE_UNUSED = false; - - @SuppressWarnings("unused") - private static final String UNUSED = "@SuppressWarnings(\"unused\")\n"; - private static final String OVERRIDE = "@SuppressWarnings(\"all\")\n"; - - private static final String TARGET_DIR = "../components-core/src/main/java/org/dllearner/core/configurators"; - - private static final String TARGET_PACKAGE = "org.dllearner.core.configurators"; - - private static final String HEADER_FILE = "../interfaces/doc/header.txt"; - - private static final String HEADER = getHeader(); - - private static final String REINITVAR = "reinitNecessary"; - - private static final String REINITGETTER = "/**\n* true, if this component needs reinitializsation.\n" - + "* @return boolean\n**/\n" - + "public boolean is" - + capitalize(REINITVAR) - + "(){\nreturn " - + REINITVAR + ";\n}\n"; - - // private static final String TEMPLATE_DIR = "doc/template/"; - - private static final String CONFIGURATOR = "Configurator"; - - private static final String COMPONENT_FACTORY = "ComponentFactory"; - private static final String CLASS_COMMENT = "* automatically generated, do not edit manually.\n" - + "* run " + ConfigJavaGenerator.class.getCanonicalName()+ " to update\n"; - - private static final SortedSet<String> COMPONENT_FACTORY_IMPORTS = new TreeSet<String>(); - - private static final List<String> COMPONENT_FACTORY_METHODS = new ArrayList<String>(); - - private Class<? extends AbstractComponent> component; - - private String className; - - private String componentType; - - private String extendS = ""; - - //private String implementS = ""; - - private List<String> body = new ArrayList<String>(); - - private List<String> vars = new ArrayList<String>(); - - private List<String> setters = new ArrayList<String>(); - - private List<String> getters = new ArrayList<String>(); - - private SortedSet<String> imports = new TreeSet<String>(); - - private SortedSet<String> getinstanceExceptions = new TreeSet<String>(); - - private Map<String, String> additionalMandatoryVars = new LinkedHashMap<String, String>(); - - private Map<String, String> mandatoryVars = new LinkedHashMap<String, String>(); - - // private Map<String,String> varMap = new LinkedHashMap<String, String>(); - - private List<ConfigOption<?>> mandatoryOptions = new LinkedList<ConfigOption<?>>(); - - /** - * @param args - * none - */ - public static void main(String[] args) { - - Files.backupDirectory(TARGET_DIR); - System.out.println("previous classes were backupped to tmp/+System.currentTimeMillis()"); - String[] files = Files.listDir(TARGET_DIR); - - for (String file : files){ - //System.out.println(DONOTDELETE); - - if(DONOTDELETE.contains(file)){ - continue; - } - //System.out.println(file); - String todelete = TARGET_DIR + File.separator + file; - Files.deleteFile(todelete); - - } - //System.exit(0); - //Files.deleteDir(TARGET_DIR); - - ComponentManager cm = ComponentManager.getInstance(); - COMPONENT_FACTORY_IMPORTS.add(AbstractKnowledgeSource.class.getCanonicalName()); - COMPONENT_FACTORY_IMPORTS - .add(AbstractReasonerComponent.class.getCanonicalName()); - COMPONENT_FACTORY_IMPORTS.add(AbstractLearningProblem.class.getCanonicalName()); - COMPONENT_FACTORY_IMPORTS.add(LearningProblemUnsupportedException.class - .getCanonicalName()); - COMPONENT_FACTORY_METHODS.add("private "+COMPONENT_FACTORY+"(){}\n"); - - for (Class<? extends AbstractKnowledgeSource> component : cm - .getKnowledgeSources()) { - String componentType = "knowledgeSource"; - - COMPONENT_FACTORY_IMPORTS.add(component.getCanonicalName()); - // configuratorImports.add(TARGET_PACKAGE+"."+component.getSimpleName()+CONFIGURATOR); - ConfigJavaGenerator c = new ConfigJavaGenerator(component, - componentType); - c.makeConfigurator(); - - } - for (Class<? extends AbstractReasonerComponent> component : cm - .getReasonerComponents()) { - - COMPONENT_FACTORY_IMPORTS.add(component.getCanonicalName()); - // configuratorImports.add(TARGET_PACKAGE+"."+component.getSimpleName()+CONFIGURATOR); - - ConfigJavaGenerator c = new ConfigJavaGenerator(component, - "reasoner"); - c.imports.add("org.dllearner.core.KnowledgeSource"); - c.imports.add(Set.class.getCanonicalName()); - c.additionalMandatoryVars.put("Set<KnowledgeSource> knowledgeSource", - "knowledgeSource"); - c.makeConfigurator(); - - } - for (Class<? extends AbstractLearningProblem> component : cm - .getLearningProblems()) { - - COMPONENT_FACTORY_IMPORTS.add(component.getCanonicalName()); - // configuratorImports.add(TARGET_PACKAGE + "." + - // component.getSimpleName()+CONFIGURATOR); - - ConfigJavaGenerator c = new ConfigJavaGenerator(component, - "learningProblem"); - c.imports.add("org.dllearner.core.ReasonerComponent"); - c.additionalMandatoryVars.put("ReasonerComponent reasoningService", - "reasoningService"); - c.makeConfigurator(); - - } - - for (Class<? extends AbstractCELA> component : cm - .getLearningAlgorithms()) { - - COMPONENT_FACTORY_IMPORTS.add(component.getCanonicalName()); - // configuratorImports.add(TARGET_PACKAGE+"."+ - // component.getSimpleName()+CONFIGURATOR); - - ConfigJavaGenerator c = new ConfigJavaGenerator(component, - "learningAlgorithm"); - c.imports.add("org.dllearner.core.LearningProblem"); - c.imports.add("org.dllearner.core.ReasonerComponent"); - c.imports.add(LearningProblemUnsupportedException.class - .getCanonicalName()); - - c.additionalMandatoryVars.put("LearningProblem learningProblem", - "learningProblem"); - c.additionalMandatoryVars.put("ReasonerComponent reasoningService", - "reasoningService"); - c.getinstanceExceptions.add("LearningProblemUnsupportedException"); - c.makeConfigurator(); - - } - - makeComponentFactory(); - makeInterface(); - writePackageHTML(); - - System.out.println("Done"); - } - - - - private ConfigJavaGenerator(Class<? extends AbstractComponent> component, - String componentType) { - this.className = component.getSimpleName(); - this.component = component; - this.componentType = componentType; - imports.add(component.getCanonicalName()); - imports.add(ComponentManager.class.getCanonicalName()); - // imports.add(Configurator.class.getCanonicalName()); - // imports.add(ConfigEntry.class.getCanonicalName()); - - vars.add("private " + className + " " + deCapitalize(className) - + ";\n"); - - if(EXTENDSREFINEMENTOPERATOR.contains(this.className+CONFIGURATOR)){ - this.extendS = EXTENDSREFINEMENTOPERATORCLASS.getSimpleName(); - this.imports.add(EXTENDSREFINEMENTOPERATORCLASS.getCanonicalName()); - } - - - } - - private void makeConfigurator() { - - for (ConfigOption<?> option : ComponentManager - .getConfigOptions(component)) { - - String type = option.getValueTypeAsJavaString(); - String optionName = option.getName(); - // String defaultValue = option.getDefaultValueInJava(); - String comment = option.getJavaDocString(); - - if (option.isMandatory()) { - mandatoryVars.put(type + " " + optionName, optionName); - mandatoryOptions.add(option); - COMPONENT_FACTORY_IMPORTS.addAll(option.getJavaImports()); - } - - imports.addAll(option.getJavaImports()); - // vars.add(fillVariableDefTemplate(optionName, type, - // defaultValue)); - setters.add(fillSetterTemplate(className, comment, optionName, - type, option.requiresInit())); - getters - .add(fillGetterTemplate(className, comment, optionName, - type)); - // System.out.println(option); - // componentOptions.get(component)) { - - } - - body.add("private boolean " + REINITVAR + " = false;"); - // suppress warnings if necessary - if(component.equals(FastRetrievalReasoner.class) || component.equals(OWLAPIOntology.class)) { - body.add(UNUSED); - } - body.add(expandCollection(vars, "", "", 0)); - body.add(fillConstructorTemplate(className)); - - body - .add(makeGetInstanceForConfigurators(getAllCommentsForOptionList(mandatoryOptions))); - - // body.add(makeApplyConfigEntryForOptionList(ComponentManager.getConfigOptions(component))); - - body.add(expandCollection(getters, "", "", 0)); - body.add(expandCollection(setters, "", "", 0)); - body.add(REINITGETTER); - String bodytmp = expandCollection(body, "", "\n",0); - String importtmp = expandCollection(imports, "import ", ";\n", 0); - String ret = fillClassTemplate( - TARGET_PACKAGE, - importtmp, - className + CONFIGURATOR, - extendS, - bodytmp , - "", - CONFIGURATOR); - - // configuratorMethods.add((className, componentType, - // mandatoryOptions)); - - Files.createFile(new File(TARGET_DIR + "/" + className + CONFIGURATOR - + ".java"), ret); - - COMPONENT_FACTORY_METHODS - .add(makeComponentFactoryMethods(getAllCommentsForOptionList(mandatoryOptions))); - } - - private static void makeInterface(){ - String ret =""; - ret+= HEADER+"\n"; - ret+= "package "+TARGET_PACKAGE+";\n\n"; - ret+= fillJavaDocComment(CLASS_COMMENT); - ret+="public interface Configurator{\n}\n"; - Files.createFile(new File(TARGET_DIR+File.separator+CONFIGURATOR+".java"), ret); - } - - @SuppressWarnings("unused") - private static String makeApplyConfigEntryForOptionList( - List<ConfigOption<?>> options) { - String ret = "@SuppressWarnings({ \"unchecked\" })\n" - + "public <T> void applyConfigEntry(ConfigEntry<T> entry){\n"; - ret += "String optionName = entry.getOptionName();\n"; - // ret+="ConfigOption<T> option = entry.getOption();\n"; - ret += "if(false){//empty block \n}"; - - for (ConfigOption<?> option : options) { - ret += "else if (optionName.equals(\"" + option.getName() - + "\")){\n"; - ret += "" + option.getName() + " = (" - + rightType(option.getValueTypeAsJavaString()) + ") " - + " entry.getValue();\n}"; - - } - ret += "\n}\n"; - return ret; - } - - private static String getAllCommentsForOptionList( - List<ConfigOption<?>> options) { - String ret = ""; - for (ConfigOption<?> option : options) { - ret += "* @param " + option.getName() + " " - + option.getDescription() + "\n"; - } - - return ret; - } - - private String makeGetInstanceForConfigurators(String comments) { - - Map<String, String> parametersWithType = new LinkedHashMap<String, String>(); - Map<String, String> parametersNoType = new LinkedHashMap<String, String>(); - String applyConf = ""; - // parametersWithType.put("ComponentManager cm", "cm"); - parametersNoType.put(className + ".class", className + ".class"); - for (String s : additionalMandatoryVars.keySet()) { - parametersWithType.put(s, additionalMandatoryVars.get(s)); - parametersNoType.put(s, additionalMandatoryVars.get(s)); - comments ="* @param "+additionalMandatoryVars.get(s)+" see "+additionalMandatoryVars.get(s)+"\n"+comments; - } - for (String s : mandatoryVars.keySet()) { - parametersWithType.put(s, mandatoryVars.get(s)); - applyConf += fillApplyConfigEntry("component", mandatoryVars.get(s)); - } - - String parWithType = expandCollection(parametersWithType.keySet(), "", - ", ", 2); - - String par = expandCollection(parametersNoType.values(), "", ", ", 2); - - String exceptions = ""; - if (!getinstanceExceptions.isEmpty()) { - exceptions += "throws "; - exceptions += expandCollection(getinstanceExceptions, "", ", ", 2); - comments+=expandCollection(getinstanceExceptions, "* @throws ", " see \n", 0); - } - comments = fillJavaDocComment(comments + "* @return " + className - + "\n"); - String ret = comments; - ret += "public static " + className + " get" + className + "(" - + parWithType + ") " + exceptions + "{\n"; - ret += className + " component = ComponentManager.getInstance()." - + componentType + "(" + par + ");\n"; - ret += applyConf; - - ret += "return component;\n}\n"; - - return ret; - } - - - - - private String makeComponentFactoryMethods(String comments) { - - Map<String, String> parametersWithType = new LinkedHashMap<String, String>(); - Map<String, String> parametersNoType = new LinkedHashMap<String, String>(); - String applyConf = ""; - // parametersWithType.put("ComponentManager cm", "cm"); - parametersNoType.put(className + ".class", className + ".class"); - for (String s : additionalMandatoryVars.keySet()) { - parametersWithType.put(s, additionalMandatoryVars.get(s)); - parametersNoType.put(s, additionalMandatoryVars.get(s)); - comments += "* @param " + additionalMandatoryVars.get(s) + " see " - + capitalize(additionalMandatoryVars.get(s)) + "\n"; - } - for (String s : mandatoryVars.keySet()) { - parametersWithType.put(s, mandatoryVars.get(s)); - applyConf += fillApplyConfigEntry("component", mandatoryVars.get(s)) - + ""; - } - - String parWithType = expandCollection(parametersWithType.keySet(), "", - ", ", 2); - - String par = expandCollection(parametersWithType.values(), "", ", ", 2); - - String exceptions = ""; - if (!getinstanceExceptions.isEmpty()) { - exceptions += "throws "; - exceptions += expandCollection(getinstanceExceptions, "", ", ", 2); - comments += expandCollection(getinstanceExceptions, "* @throws ", - " see\n", 0); - } - comments += "* @return a component ready for initialization " - + className + "\n"; - String ret = fillJavaDocComment(comments); - ret += "public static " + className + " get" + className + "(" - + parWithType + ") " + exceptions + " {\n" + "return " - + className + CONFIGURATOR + ".get" + className + "(" + par - + ");\n}\n"; - return ret; - } - - private static void makeComponentFactory() { - String ret = fillClassTemplate(TARGET_PACKAGE, expandCollection( - COMPONENT_FACTORY_IMPORTS, "import ", ";\n", 0), - COMPONENT_FACTORY, "", expandCollection( - COMPONENT_FACTORY_METHODS, "", "\n", 0), "final",""); - - Files.createFile(new File(TARGET_DIR + "/" + COMPONENT_FACTORY - + ".java"), ret); - } - - private static String fillApplyConfigEntry(String className, - String optionName) { - return "ComponentManager.getInstance().applyConfigEntry(" - + deCapitalize(className) + ", \"" + optionName + "\", " - + optionName + ");\n"; - } - - private static String fillConstructorTemplate(String className) { - return fillJavaDocComment("* @param " + deCapitalize(className) - + " see " + className + "\n") - + "public " - + className - + CONFIGURATOR - + "(" - + className - + " " - + deCapitalize(className) - + "){\n" - + "this." - + deCapitalize(className) - + " = " - + deCapitalize(className) - + ";\n" + "}\n"; - } - - @SuppressWarnings("unused") - private static String fillVariableDefTemplate(String optionName, - String type, String defaultValue) { - return "private " + type + " " + optionName + " = " + defaultValue - + ";\n"; - - } - - private static String fillJavaDocComment(String lines) { - return "/**\n" + lines + "**/\n"; - } - - private static String fillGetterTemplate(String className, String comment, - String optionName, String type) { - comment = comment.replaceAll("@param ", ""); - comment += "* @return " + checkstyleAdjust(type) + " \n"; - String ret = fillJavaDocComment(comment); - ret += (type.contains("<String>") || type.contains("<StringTuple>")) ? "@SuppressWarnings(\"unchecked\")\n" - : ""; - ret += "public " + type + " get" + capitalize(optionName) + "() {\n"; - ret += "return (" + rightType(type) - + ") ComponentManager.getInstance()."; - ret += "getConfigOptionValue(" + deCapitalize(className) + ", \"" - + optionName + "\") ;\n"; - ret += "}\n"; - return ret; - } - - private static String fillSetterTemplate(String className, String comment, - String optionName, String type, boolean reinit) { - String ret = fillJavaDocComment(comment); - ret += "public void set" + capitalize(optionName); - ret += "(" + type + " " + optionName + ") {\n"; - ret += fillApplyConfigEntry(className, optionName); - ret += (reinit) ? REINITVAR + " = true;\n" : ""; - ret += "}\n"; - return ret; - } - - - - - private static String fillClassTemplate(String packagE, String imports, - String className, String extendS, String body, String classModifier, String implementS) { - - - String ret = HEADER + "\n"; - ret += "package " + packagE + ";\n\n"; - ret += imports + "\n"; - ret += fillJavaDocComment(CLASS_COMMENT); -// ret += (INCLUDE_UNUSED) ? UNUSED : ""; - ret += (!extendS.isEmpty()) ? OVERRIDE : ""; - ret += "public "+classModifier+" class " + className + " " - + ((extendS.length() > 0) ? " extends " + extendS : "") - + ((implementS.length() > 0) ? " implements " + implementS : "") - + " {\n\n"; - ret += body + "\n"; - ret += "}\n"; - return ret; - - } - - private static void writePackageHTML(){ - String c = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">"+ - "<html>"+ - "<head></head>"+ - "<body bgcolor=\"white\">"+ - "<p>Automatically generated classes, which enable programmatically setting"+ - "and getting configuration options of components.</p>"+ - "</body>"+ - "</html>"; - try{ - Files.createFile(new File(TARGET_DIR+File.separator+"package.html"), c); - }catch (Exception e) { - e.printStackTrace(); - } - } - - - private static String expandCollection(Collection<String> col, - String before, String after, int removeChars) { - if (col.isEmpty()){ - return ""; - } - String ret = ""; - for (String string : col) { - ret += before + string + after; - } - - if (removeChars == 0) { - return ret; - } else { - return ret.substring(0, ret.length() - removeChars); - } - } - - private static String capitalize(String s) { - String tmp = s.substring(0, 1); - return tmp.toUpperCase() + s.substring(1); - } - - private static String deCapitalize(String s) { - String tmp = s.substring(0, 1); - return tmp.toLowerCase() + s.substring(1); - } - - private static String rightType(String type) { - if (type.equals("int")){ - return "Integer"; - }else if (type.equals("boolean")){ - return "Boolean"; - }else if (type.equals("double")){ - return "Double"; - }else{ - return type; - } - - } - - - private static String checkstyleAdjust(String type) { - type = type.replaceAll("<", "("); - type = type.replaceAll(">", ")"); - return type; - } - - private static String getHeader() { - try { - return Files.readFile(new File(HEADER_FILE)); - } catch (Exception e) { - e.printStackTrace(); - } - return ""; - } - -} Modified: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java 2011-08-31 17:15:20 UTC (rev 3194) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java 2011-08-31 17:23:23 UTC (rev 3195) @@ -69,7 +69,6 @@ import org.dllearner.algorithms.properties.DataPropertyDomainAxiomLearner; import org.dllearner.algorithms.properties.DataPropertyRangeAxiomLearner; import org.dllearner.algorithms.properties.DisjointDataPropertyAxiomLearner; -import org.dllearner.algorithms.properties.DisjointObjectPropertyAxiomLearner; import org.dllearner.algorithms.properties.EquivalentDataPropertyAxiomLearner; import org.dllearner.algorithms.properties.EquivalentObjectPropertyAxiomLearner; import org.dllearner.algorithms.properties.FunctionalDataPropertyAxiomLearner; @@ -83,7 +82,6 @@ import org.dllearner.algorithms.properties.SubObjectPropertyOfAxiomLearner; import org.dllearner.algorithms.properties.SymmetricObjectPropertyAxiomLearner; import org.dllearner.algorithms.properties.TransitiveObjectPropertyAxiomLearner; -import org.dllearner.core.AbstractCELA; import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.AnnComponentManager; import org.dllearner.core.AxiomLearningAlgorithm; @@ -96,7 +94,6 @@ import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.Score; import org.dllearner.core.config.ConfigHelper; -import org.dllearner.core.configurators.CELOEConfigurator; import org.dllearner.core.owl.Axiom; import org.dllearner.core.owl.DatatypeProperty; import org.dllearner.core.owl.EquivalentClassesAxiom; Modified: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EvaluationComputingScript.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EvaluationComputingScript.java 2011-08-31 17:15:20 UTC (rev 3194) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EvaluationComputingScript.java 2011-08-31 17:23:23 UTC (rev 3195) @@ -19,12 +19,11 @@ import java.util.TreeSet; import org.dllearner.algorithms.celoe.CELOE; +import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.AbstractReasonerComponent; -import org.dllearner.core.configurators.CELOEConfigurator; import org.dllearner.core.owl.Axiom; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.EquivalentClassesAxiom; @@ -227,7 +226,7 @@ ComponentManager cm = ComponentManager.getInstance(); ClassLearningProblem lp = null; CELOE celoe = null; - CELOEConfigurator cf = null; +// CELOEConfigurator cf = null; TreeSet<EvaluatedDescriptionClass> suggestions; for (int i = 0; i <= 1; i++) { if (i == 0) { @@ -298,8 +297,8 @@ // } else { // cf.setFilterDescriptionsFollowingFromKB(false); // } - cf.setReuseExistingDescription(reuseExistingDescription); - cf.setFilterDescriptionsFollowingFromKB(filterDescriptionsFollowingFromKB); + celoe.setReuseExistingDescription(reuseExistingDescription); + celoe.setFilterDescriptionsFollowingFromKB(filterDescriptionsFollowingFromKB); celoe.init(); @@ -362,7 +361,7 @@ ComponentManager cm = ComponentManager.getInstance(); ClassLearningProblem lp = null; CELOE celoe = null; - CELOEConfigurator cf = null; +// CELOEConfigurator cf = null; TreeSet<EvaluatedDescriptionClass> suggestions; for (int i = 0; i <= 1; i++) { if (i == 0) { @@ -456,7 +455,7 @@ // shrinkSet(classes, 20); ClassLearningProblem lp = null; CELOE celoe = null; - CELOEConfigurator cf = null; +// CELOEConfigurator cf = null; for (NamedClass nc : classes) { // check whether the class has sufficient instances int instanceCount = reasoner.getIndividuals(nc).size(); @@ -494,8 +493,8 @@ // } else { // cf.setFilterDescriptionsFollowingFromKB(false); // } - cf.setReuseExistingDescription(reuseExistingDescription); - cf.setFilterDescriptionsFollowingFromKB(filterDescriptionsFollowingFromKB); + celoe.setReuseExistingDescription(reuseExistingDescription); + celoe.setFilterDescriptionsFollowingFromKB(filterDescriptionsFollowingFromKB); celoe.init(); celoe.start(); Modified: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/OntologyEngineering.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/OntologyEngineering.java 2011-08-31 17:15:20 UTC (rev 3194) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/OntologyEngineering.java 2011-08-31 17:23:23 UTC (rev 3195) @@ -36,12 +36,11 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.dllearner.algorithms.celoe.CELOE; +import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentInitException; import org.dllearner.core.ComponentManager; import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.AbstractReasonerComponent; -import org.dllearner.core.configurators.CELOEConfigurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.NamedClass; Modified: trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java 2011-08-31 17:15:20 UTC (rev 3194) +++ trunk/scripts/src/main/java/org/dllearner/scripts/improveWikipedia/DBpediaClassLearnerCELOE.java 2011-08-31 17:23:23 UTC (rev 3195) @@ -30,13 +30,11 @@ import java.util.SortedSet; import java.util.TreeSet; -import org.apache.velocity.VelocityContext; import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.ComponentManager; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.OntologyFormat; -import org.dllearner.core.configurators.CELOEConfigurator; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.EquivalentClassesAxiom; import org.dllearner.core.owl.Individual; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |