From: <jen...@us...> - 2008-11-10 12:44:30
|
Revision: 1501 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1501&view=rev Author: jenslehmann Date: 2008-11-10 12:44:17 +0000 (Mon, 10 Nov 2008) Log Message: ----------- - reasoner component redesign continued - SVN is still *broken*, please don't update if you want everything to work properly 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/SimpleSuggestionLearningAlgorithm.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/SubsumptionComparator.java trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/core/ComponentManager.java trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java trunk/src/dl-learner/org/dllearner/core/LearningProblem.java trunk/src/dl-learner/org/dllearner/core/ReasonerOld.java trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java trunk/src/dl-learner/org/dllearner/core/configurators/DBpediaNavigationSuggestorConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ExampleBasedROLComponentConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/GPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegDefinitionLPStrictConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosNegInclusionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyDefinitionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/PosOnlyInclusionLPConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/ROLearnerConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/RandomGuesserConfigurator.java trunk/src/dl-learner/org/dllearner/core/configurators/SimpleSuggestionLearningAlgorithmConfigurator.java trunk/src/dl-learner/org/dllearner/examples/KRKModular.java trunk/src/dl-learner/org/dllearner/gui/Config.java trunk/src/dl-learner/org/dllearner/gui/MiniGUI.java trunk/src/dl-learner/org/dllearner/gui/RunPanel.java trunk/src/dl-learner/org/dllearner/gui/TreeWindow.java trunk/src/dl-learner/org/dllearner/gui/widgets/WidgetPanelStringSet.java trunk/src/dl-learner/org/dllearner/kb/sparql/NaturalLanguageDescriptionConvertVisitor.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegDefinitionLPStrict.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegInclusionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosNegLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyDefinitionLP.java trunk/src/dl-learner/org/dllearner/learningproblems/PosOnlyInclusionLP.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/FastRetrievalReasoner.java trunk/src/dl-learner/org/dllearner/refinementoperators/ELDown.java trunk/src/dl-learner/org/dllearner/refinementoperators/PsiDown.java trunk/src/dl-learner/org/dllearner/refinementoperators/PsiUp.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDRDown.java trunk/src/dl-learner/org/dllearner/refinementoperators/RhoDown.java trunk/src/dl-learner/org/dllearner/refinementoperators/Utility.java trunk/src/dl-learner/org/dllearner/scripts/ConfigJavaGenerator.java trunk/src/dl-learner/org/dllearner/scripts/CrossValidation.java trunk/src/dl-learner/org/dllearner/scripts/DumbLPFinder.java trunk/src/dl-learner/org/dllearner/scripts/NewSample.java trunk/src/dl-learner/org/dllearner/scripts/PaperStatistics.java trunk/src/dl-learner/org/dllearner/scripts/RoleLearning.java trunk/src/dl-learner/org/dllearner/scripts/Sample.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBible.java trunk/src/dl-learner/org/dllearner/scripts/SemanticBibleComparison.java trunk/src/dl-learner/org/dllearner/scripts/TestValidation.java trunk/src/dl-learner/org/dllearner/scripts/WikipediaCategoryCleaner.java trunk/src/dl-learner/org/dllearner/server/ClientState.java trunk/src/dl-learner/org/dllearner/server/DLLearnerWS.java trunk/src/dl-learner/org/dllearner/test/ComponentTest.java trunk/src/dl-learner/org/dllearner/test/junit/ELDescriptionTreeTests.java trunk/src/dl-learner/org/dllearner/test/junit/ELDownTests.java trunk/src/dl-learner/org/dllearner/test/junit/ExampleTests.java trunk/src/dl-learner/org/dllearner/test/junit/RefinementOperatorTests.java trunk/src/dl-learner/org/dllearner/test/junit/SimulationTests.java trunk/src/dl-learner/org/dllearner/test/junit/TestOntologies.java trunk/src/dl-learner/org/dllearner/tools/ore/ORE.java trunk/src/dl-learner/org/dllearner/tools/ore/OntologyModifier.java trunk/src/dl-learner/org/dllearner/tools/ore/WizardController.java trunk/src/dl-learner/org/dllearner/tools/protege/DLLearnerModel.java trunk/src/dl-learner/org/dllearner/utilities/Helper.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticNegativeExampleFinderOWL.java trunk/src/dl-learner/org/dllearner/utilities/examples/AutomaticPositiveExampleFinderOWL.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnConfiguration.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFile.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnOWLFileConfiguration.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnSPARQLConfiguration.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnSparql.java trunk/src/dl-learner/org/dllearner/utilities/learn/LearnSparqlold.java trunk/src/dl-learner/org/dllearner/utilities/owl/ConceptTransformation.java trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloser.java trunk/src/dl-learner/org/dllearner/utilities/owl/OntologyCloserOWLAPI.java trunk/src/dl-learner/org/dllearner/utilities/owl/ReasoningServiceFactory.java Added Paths: ----------- trunk/src/dl-learner/org/dllearner/utilities/learn/ComponentCombo.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/BruteForceLearner.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -29,7 +29,8 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.config.CommonConfigOptions; import org.dllearner.core.config.ConfigEntry; @@ -67,7 +68,7 @@ private LearningProblem learningProblem; - private ReasoningService rs; + private ReasonerComponent rs; private Description bestDefinition; private Score bestScore; @@ -82,7 +83,7 @@ // list of all generated concepts sorted by length private Map<Integer,List<Description>> generatedDefinitions = new HashMap<Integer,List<Description>>(); - public BruteForceLearner(LearningProblem learningProblem, ReasoningService rs) { + public BruteForceLearner(LearningProblem learningProblem, ReasonerComponent rs) { super(learningProblem, rs); this.learningProblem = learningProblem; this.rs = rs; Modified: trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/DBpediaNavigationSuggestor.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -28,7 +28,8 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.config.BooleanConfigOption; import org.dllearner.core.config.CommonConfigOptions; @@ -63,11 +64,11 @@ } -// private ReasoningService rs; +// private ReasonerComponent rs; private ExampleBasedROLComponent learner; private static String defaultSearchTreeFile = "log/searchTree.txt"; - public DBpediaNavigationSuggestor(LearningProblem learningProblem, ReasoningService rs) { + public DBpediaNavigationSuggestor(LearningProblem learningProblem, ReasonerComponent rs) { super(learningProblem, rs); // this.rs=rs; this.configurator = new DBpediaNavigationSuggestorConfigurator(this); @@ -97,12 +98,12 @@ return "DBpedia Navigation Suggestor"; } - public DBpediaNavigationSuggestor(PosOnlyDefinitionLP learningProblem, ReasoningService rs) { + public DBpediaNavigationSuggestor(PosOnlyDefinitionLP learningProblem, ReasonerComponent rs) { super(learningProblem, rs); System.out.println("test1"); } - public DBpediaNavigationSuggestor(PosNegDefinitionLP learningProblem, ReasoningService rs) { + public DBpediaNavigationSuggestor(PosNegDefinitionLP learningProblem, ReasonerComponent rs) { super(learningProblem, rs); System.out.println("test2"); } Modified: trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/RandomGuesser.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -28,7 +28,7 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.config.ConfigEntry; import org.dllearner.core.config.ConfigOption; @@ -48,17 +48,14 @@ private Description bestDefinition = null; private Score bestScore; private double bestFitness = Double.NEGATIVE_INFINITY; - private LearningProblem learningProblem; - private ReasoningService rs; + private int numberOfTrees; private int maxDepth; private static Logger logger = Logger.getLogger(RandomGuesser.class); - public RandomGuesser(LearningProblem learningProblem, ReasoningService rs) { - super(learningProblem, rs); - this.learningProblem = learningProblem; - this.rs = rs; + public RandomGuesser(LearningProblem learningProblem, ReasonerComponent rs) { + super(learningProblem, rs); this.configurator = new RandomGuesserConfigurator(this); } @@ -110,7 +107,7 @@ for(int i=0; i<numberOfTrees; i++) { // p = GPUtilities.createGrowRandomProgram(learningProblem, maxDepth); - p = GPUtilities.createGrowRandomProgram(learningProblem, rs, maxDepth, false); + p = GPUtilities.createGrowRandomProgram(learningProblem, reasoner, maxDepth, false); if(p.getFitness()>bestFitness) { bestFitness = p.getFitness(); bestScore = p.getScore(); Modified: trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/SimpleSuggestionLearningAlgorithm.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -25,7 +25,7 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.config.ConfigEntry; import org.dllearner.core.configurators.SimpleSuggestionLearningAlgorithmConfigurator; @@ -103,7 +103,7 @@ } - public Set<Description> getSimpleSuggestions(ReasoningService rs, Set<Individual> indi) { + public Set<Description> getSimpleSuggestions(ReasonerComponent rs, Set<Individual> indi) { // EXISTS property.TOP // ESISTS hasChild // EXISTS hasChild.male Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionNode.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -19,17 +19,14 @@ */ package org.dllearner.algorithms.el; -import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.NavigableSet; import java.util.Set; -import java.util.SortedSet; import java.util.TreeSet; -import org.dllearner.core.ReasoningService; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.NamedClass; Modified: trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/el/ELDescriptionTree.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -29,7 +29,7 @@ import java.util.TreeSet; import java.util.Map.Entry; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.NamedClass; @@ -65,11 +65,11 @@ // the background knowledge (we need to have it explicitly here, // since we store simulation information in the tree and simulation // updates depend on background knowledge) - protected ReasoningService rs; + protected ReasonerComponent rs; protected SubsumptionHierarchy subsumptionHierarchy; protected ObjectPropertyHierarchy roleHierarchy; - public ELDescriptionTree(ReasoningService rs) { + public ELDescriptionTree(ReasonerComponent rs) { this.rs = rs; subsumptionHierarchy = rs.getSubsumptionHierarchy(); roleHierarchy = rs.getRoleHierarchy(); @@ -81,7 +81,7 @@ * @param description * A description */ - public ELDescriptionTree(ReasoningService rs, Description description) { + public ELDescriptionTree(ReasonerComponent rs, Description description) { this(rs); // construct root node and recursively build the tree rootNode = new ELDescriptionNode(this); Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GP.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -33,7 +33,7 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.config.BooleanConfigOption; import org.dllearner.core.config.ConfigEntry; @@ -140,7 +140,7 @@ * 1.0 and a probability of mutation of 0.01. * */ - public GP(PosNegLP learningProblem, ReasoningService rs) { + public GP(PosNegLP learningProblem, ReasonerComponent rs) { super(learningProblem, rs); this.configurator = new GPConfigurator(this); } @@ -270,14 +270,14 @@ */ @Override public void init() { - reasoningService.prepareSubsumptionHierarchy(); - reasoningService.prepareRoleHierarchy(); +// reasoner.prepareSubsumptionHierarchy(); +// reasoner.prepareRoleHierarchy(); } @Override public void start() { // falls refinement-Wahrscheinlichkeit größer 0, dann erzeuge psi - psi = new Psi((PosNegLP)learningProblem, reasoningService); + psi = new Psi((PosNegLP)learningProblem, reasoner); System.out.println(); System.out.println("Starting Genetic Programming Learner"); @@ -440,11 +440,11 @@ i++; // mutation } else if(rand >= crossoverBoundary && rand < mutationBoundary) { - newIndividuals[i] = GPUtilities.mutation(learningProblem, reasoningService, individuals[selectedIndividuals[i]]); + newIndividuals[i] = GPUtilities.mutation(learningProblem, reasoner, individuals[selectedIndividuals[i]]); // hill climbing } else if(rand >= mutationBoundary && rand < hillClimbingBoundary) { // System.out.println("hill climbing"); - newIndividuals[i] = GPUtilities.hillClimbing(learningProblem, reasoningService, individuals[selectedIndividuals[i]]); + newIndividuals[i] = GPUtilities.hillClimbing(learningProblem, reasoner, individuals[selectedIndividuals[i]]); // refinement operator } else if(rand >= hillClimbingBoundary && rand < refinementBoundary) { newIndividuals[i] = psi.applyOperator(individuals[selectedIndividuals[i]]); @@ -583,7 +583,7 @@ } /* - Collection<Concept> test = ReasoningService.retrievals; + Collection<Concept> test = ReasonerComponent.retrievals; // for(Concept c : ) test.removeAll(psi.evalCache.keySet()); @@ -618,9 +618,9 @@ // int depth = rand.nextInt(initMaxDepth-initMinDepth)+initMinDepth; if(grow) - individuals[i] = GPUtilities.createGrowRandomProgram(learningProblem, reasoningService, depth, adc); + individuals[i] = GPUtilities.createGrowRandomProgram(learningProblem, reasoner, depth, adc); else - individuals[i] = GPUtilities.createFullRandomProgram(learningProblem, reasoningService, depth, adc); + individuals[i] = GPUtilities.createFullRandomProgram(learningProblem, reasoner, depth, adc); } /* @@ -843,7 +843,7 @@ // long algorithmTime = System.nanoTime() - Main.getAlgorithmStartTime(); long algorithmTime = System.nanoTime() - startTime; System.out.println("overall algorithm runtime: " + Helper.prettyPrintNanoSeconds(algorithmTime)); - // System.out.println("instance checks: " + learningProblem.getReasoningService().getNrOfInstanceChecks()); + // System.out.println("instance checks: " + learningProblem.getReasonerComponent().getNrOfInstanceChecks()); // System.out.println("fitness evals: " + Program.fitnessEvaluations); // System.out.println("nr. of individuals: " + individuals.length + " (" + numberOfSelectedIndividuals + " selected)"); Modified: trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/gp/GPUtilities.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -8,8 +8,8 @@ import java.util.TreeMap; import org.dllearner.core.LearningProblem; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.ReasoningMethodUnsupportedException; -import org.dllearner.core.ReasoningService; import org.dllearner.core.Score; import org.dllearner.core.owl.ObjectAllRestriction; import org.dllearner.core.owl.NamedClass; @@ -135,7 +135,7 @@ * Perform a point mutation on the given program. * @param p The program to be mutated. */ - public static Program mutation(LearningProblem learningProblem, ReasoningService rs, Program p) { + public static Program mutation(LearningProblem learningProblem, ReasonerComponent rs, Program p) { mutation++; if(p.getAdc() != null) { // TODO: hier kann man noch mehr Feinabstimmung machen, d.h. @@ -159,7 +159,7 @@ } } - private static Description mutation(LearningProblem learningProblem, ReasoningService rs, Description tree, boolean useADC) { + private static Description mutation(LearningProblem learningProblem, ReasonerComponent rs, Description tree, boolean useADC) { // auch bei Mutation muss darauf geachtet werden, dass // Baum nicht modifiziert wird (sonst w�rde man automatisch auch // andere "selected individuals" modifizieren) @@ -304,7 +304,7 @@ // m�sste auch mit ADC funktionieren, da nur am Hauptbaum etwas // ver�ndert wird - public static Program hillClimbing(LearningProblem learningProblem, ReasoningService rs, Program p) { + public static Program hillClimbing(LearningProblem learningProblem, ReasonerComponent rs, Program p) { hillClimbing++; // checken, ob Bedingungen f�r hill-climbing erf�llt sind if(!rs.getReasonerType().equals(ReasonerType.FAST_RETRIEVAL) @@ -327,7 +327,7 @@ // Alternativen zu speichern und dann ein Element zuf�llig auszuw�hlen, // aber w�rde man das nicht machen, dann w�re das ein starker Bias // zu z.B. Disjunktion (weil die als erstes getestet wird) - private static Description hillClimbing(LearningProblem learningProblem, ReasoningService rs, Description node, ScoreThreeValued score) { + private static Description hillClimbing(LearningProblem learningProblem, ReasonerComponent rs, Description node, ScoreThreeValued score) { SortedSetTuple<Individual> tuple = new SortedSetTuple<Individual>(score.getPosClassified(),score.getNegClassified()); SortedSetTuple<String> stringTuple = Helper.getStringTuple(tuple); // FlatABox abox = FlatABox.getInstance(); @@ -452,7 +452,7 @@ } } - private static ScoreThreeValued getScore(int conceptLength, LearningProblem learningProblem, ReasoningService rs, SortedSet<Individual> posClassified, SortedSet<Individual> negClassified) { + private static ScoreThreeValued getScore(int conceptLength, LearningProblem learningProblem, ReasonerComponent rs, SortedSet<Individual> posClassified, SortedSet<Individual> negClassified) { // es muss hier die Helper-Methode verwendet werden, sonst werden // Individuals gel�scht !! SortedSet<Individual> neutClassified = Helper.intersection(rs.getIndividuals(),posClassified); @@ -489,7 +489,7 @@ return returnMap; } - private static Description pickTerminalSymbol(LearningProblem learningProblem, ReasoningService rs, boolean useADC) { + private static Description pickTerminalSymbol(LearningProblem learningProblem, ReasonerComponent rs, boolean useADC) { // FlatABox abox = FlatABox.getInstance(); int nr; int nrOfConcepts = rs.getNamedClasses().size(); @@ -619,7 +619,7 @@ * @param depth Depth of the tree. * @return The created program. */ - public static Program createFullRandomProgram(LearningProblem learningProblem, ReasoningService rs, int depth, boolean adc) { + public static Program createFullRandomProgram(LearningProblem learningProblem, ReasonerComponent rs, int depth, boolean adc) { if(adc) { // erster Baum Hauptbaum, zweiter Baum ADC return createProgram(learningProblem, createFullRandomTree(learningProblem, rs, depth, true), @@ -629,7 +629,7 @@ return createProgram(learningProblem, createFullRandomTree(learningProblem, rs, depth, false)); } - private static Description createFullRandomTree(LearningProblem learningProblem, ReasoningService rs, int depth, boolean useADC) { + private static Description createFullRandomTree(LearningProblem learningProblem, ReasonerComponent rs, int depth, boolean useADC) { // FlatABox abox = FlatABox.getInstance(); int numberOfRoles = rs.getObjectProperties().size(); // abox.roles.size(); @@ -680,7 +680,7 @@ * @param depth The maximum depth of the program tree. * @return The created program. */ - public static Program createGrowRandomProgram(LearningProblem learningProblem, ReasoningService rs, int depth, boolean adc) { + public static Program createGrowRandomProgram(LearningProblem learningProblem, ReasonerComponent rs, int depth, boolean adc) { if(adc) { // erster Baum Hauptbaum, zweiter Baum ADC return createProgram(learningProblem, createGrowRandomTree(learningProblem,rs,depth,true), @@ -690,7 +690,7 @@ return createProgram(learningProblem, createGrowRandomTree(learningProblem, rs, depth,false)); } - private static Description createGrowRandomTree(LearningProblem learningProblem, ReasoningService rs, int depth, boolean useADC) { + private static Description createGrowRandomTree(LearningProblem learningProblem, ReasonerComponent rs, int depth, boolean useADC) { /* private static Concept pickAlphabetSymbol(boolean useADC) { FlatABox abox = FlatABox.getInstance(); Modified: trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/hybridgp/Psi.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -6,7 +6,7 @@ import java.util.TreeMap; import org.dllearner.algorithms.gp.Program; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.owl.Description; import org.dllearner.learningproblems.PosNegLP; @@ -49,7 +49,7 @@ private long someTimeStart = 0; public long someTime = 0; - public Psi(PosNegLP learningProblem, ReasoningService reasoningService) { //, PsiUp pu, PsiDown pd) { + public Psi(PosNegLP learningProblem, ReasonerComponent reasoningService) { //, PsiUp pu, PsiDown pd) { // this.pu = pu; // this.pd = pd; this.learningProblem = learningProblem; Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -33,7 +33,8 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.config.BooleanConfigOption; import org.dllearner.core.config.CommonConfigMappings; @@ -150,12 +151,12 @@ // soll später einen Operator und eine Heuristik entgegennehmen // public ROLearner(LearningProblem learningProblem, LearningProblem learningProblem2) { - public ExampleBasedROLComponent(PosNegLP learningProblem, ReasoningService reasoningService) { + public ExampleBasedROLComponent(PosNegLP learningProblem, ReasonerComponent reasoningService) { super(learningProblem, reasoningService); this.configurator = new ExampleBasedROLComponentConfigurator(this); } - public ExampleBasedROLComponent(PosOnlyDefinitionLP learningProblem, ReasoningService reasoningService) { + public ExampleBasedROLComponent(PosOnlyDefinitionLP learningProblem, ReasonerComponent reasoningService) { super(learningProblem, reasoningService); this.configurator = new ExampleBasedROLComponentConfigurator(this); } @@ -300,7 +301,7 @@ public void init() throws ComponentInitException { // exit with a ComponentInitException if the reasoner is unsupported for this learning algorithm - if(reasoningService.getReasonerType() == ReasonerType.DIG) { + if(reasoner.getReasonerType() == ReasonerType.DIG) { throw new ComponentInitException("DIG does not support the inferences needed in the selected learning algorithm component: " + getName()); } @@ -337,38 +338,38 @@ // concepts/roles if(allowedConcepts != null) { // sanity check to control if no non-existing concepts are in the list - Helper.checkConcepts(reasoningService, allowedConcepts); + Helper.checkConcepts(reasoner, allowedConcepts); usedConcepts = allowedConcepts; } else if(ignoredConcepts != null) { - usedConcepts = Helper.computeConceptsUsingIgnoreList(reasoningService, ignoredConcepts); + usedConcepts = Helper.computeConceptsUsingIgnoreList(reasoner, ignoredConcepts); } else { - usedConcepts = Helper.computeConcepts(reasoningService); + usedConcepts = Helper.computeConcepts(reasoner); } if(allowedRoles != null) { - Helper.checkRoles(reasoningService, allowedRoles); + Helper.checkRoles(reasoner, allowedRoles); usedRoles = allowedRoles; } else if(ignoredRoles != null) { - Helper.checkRoles(reasoningService, ignoredRoles); - usedRoles = Helper.difference(reasoningService.getObjectProperties(), ignoredRoles); + Helper.checkRoles(reasoner, ignoredRoles); + usedRoles = Helper.difference(reasoner.getObjectProperties(), ignoredRoles); } else { - usedRoles = reasoningService.getObjectProperties(); + usedRoles = reasoner.getObjectProperties(); } // prepare subsumption and role hierarchies, because they are needed // during the run of the algorithm - reasoningService.prepareSubsumptionHierarchy(usedConcepts); + reasoner.prepareSubsumptionHierarchy(usedConcepts); if(improveSubsumptionHierarchy) - reasoningService.getSubsumptionHierarchy().improveSubsumptionHierarchy(); - reasoningService.prepareRoleHierarchy(usedRoles); + reasoner.getSubsumptionHierarchy().improveSubsumptionHierarchy(); + reasoner.prepareRoleHierarchy(usedRoles); // prepare datatype hierarchy only if necessary - if(reasoningService.hasDatatypeSupport()) - reasoningService.prepareDatatypePropertyHierarchy(); + if(reasoner.hasDatatypeSupport()) + reasoner.prepareDatatypePropertyHierarchy(); // create a refinement operator and pass all configuration // variables to it RhoDRDown operator = new RhoDRDown( - reasoningService, + reasoner, applyAllFilter, applyExistsFilter, useAllConstructor, @@ -386,7 +387,7 @@ // options to it algorithm = new ExampleBasedROLearner( learningProblem, - reasoningService, + reasoner, operator, algHeuristic, startClass, Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -35,7 +35,8 @@ import org.apache.log4j.Logger; import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.owl.Description; import org.dllearner.core.owl.Individual; @@ -75,7 +76,7 @@ private static Logger logger = Logger.getLogger(ExampleBasedROLearner.class); // basic setup: learning problem and reasoning service - private ReasoningService rs; + private ReasonerComponent rs; // often the learning problems needn't be accessed directly; instead // use the example sets below and the posonly variable private PosNegLP learningProblem; @@ -233,7 +234,7 @@ public ExampleBasedROLearner( LearningProblem learningProblem, - ReasoningService rs, + ReasonerComponent rs, RefinementOperator operator, ExampleBasedHeuristic heuristic, Description startDescription, @@ -722,7 +723,7 @@ improperConcepts = rs.subsumes(toEvaluateConcepts, concept); propernessTestsReasoner += toEvaluateConcepts.size(); // boolean isProper = - // !learningProblem.getReasoningService().subsumes(refinement, + // !learningProblem.getReasonerComponent().subsumes(refinement, // concept); propernessCalcReasoningTimeNs += System.nanoTime() - propCalcReasoningStart; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/SubsumptionComparator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/SubsumptionComparator.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/SubsumptionComparator.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -2,16 +2,16 @@ import java.util.Comparator; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.owl.Description; import org.dllearner.utilities.owl.ConceptComparator; public class SubsumptionComparator implements Comparator<Description> { - private ReasoningService rs; + private ReasonerComponent rs; private ConceptComparator cc = new ConceptComparator(); - public SubsumptionComparator(ReasoningService rs) { + public SubsumptionComparator(ReasonerComponent rs) { this.rs = rs; } Modified: trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/algorithms/refinement/ROLearner.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -17,7 +17,8 @@ import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.LearningProblem; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.config.BooleanConfigOption; import org.dllearner.core.config.CommonConfigMappings; @@ -194,9 +195,7 @@ // prefixes private String baseURI; - // soll später einen Operator und eine Heuristik entgegennehmen - // public ROLearner(LearningProblem learningProblem, LearningProblem learningProblem2) { - public ROLearner(PosNegLP learningProblem, ReasoningService reasoningService) { + public ROLearner(PosNegLP learningProblem, ReasonerComponent reasoningService) { super(learningProblem, reasoningService); this.learningProblem = learningProblem; this.configurator = new ROLearnerConfigurator(this); @@ -205,7 +204,7 @@ } - public ROLearner(PosOnlyDefinitionLP learningProblem, ReasoningService reasoningService) { + public ROLearner(PosOnlyDefinitionLP learningProblem, ReasonerComponent reasoningService) { super(learningProblem, reasoningService); this.posOnlyLearningProblem = learningProblem; this.configurator = new ROLearnerConfigurator(this); @@ -346,7 +345,7 @@ } // this.learningProblem2 = learningProblem2; - operator = new RhoDown(reasoningService, applyAllFilter, applyExistsFilter, useAllConstructor, useExistsConstructor, useNegation, useBooleanDatatypes); + operator = new RhoDown(reasoner, applyAllFilter, applyExistsFilter, useAllConstructor, useExistsConstructor, useNegation, useBooleanDatatypes); // candidate sets entsprechend der gewählten Heuristik initialisieren candidates = new TreeSet<Node>(nodeComparator); @@ -354,30 +353,30 @@ if(allowedConcepts != null) { // sanity check to control if no non-existing concepts are in the list - Helper.checkConcepts(reasoningService, allowedConcepts); + Helper.checkConcepts(reasoner, allowedConcepts); usedConcepts = allowedConcepts; } else if(ignoredConcepts != null) { - usedConcepts = Helper.computeConceptsUsingIgnoreList(reasoningService, ignoredConcepts); + usedConcepts = Helper.computeConceptsUsingIgnoreList(reasoner, ignoredConcepts); } else { - usedConcepts = Helper.computeConcepts(reasoningService); + usedConcepts = Helper.computeConcepts(reasoner); } if(allowedRoles != null) { - Helper.checkRoles(reasoningService, allowedRoles); + Helper.checkRoles(reasoner, allowedRoles); usedRoles = allowedRoles; } else if(ignoredRoles != null) { - Helper.checkRoles(reasoningService, ignoredRoles); - usedRoles = Helper.difference(reasoningService.getObjectProperties(), ignoredRoles); + Helper.checkRoles(reasoner, ignoredRoles); + usedRoles = Helper.difference(reasoner.getObjectProperties(), ignoredRoles); } else { - usedRoles = reasoningService.getObjectProperties(); + usedRoles = reasoner.getObjectProperties(); } // prepare subsumption and role hierarchies, because they are needed // during the run of the algorithm - reasoningService.prepareSubsumptionHierarchy(usedConcepts); + reasoner.prepareSubsumptionHierarchy(usedConcepts); if(improveSubsumptionHierarchy) - reasoningService.getSubsumptionHierarchy().improveSubsumptionHierarchy(); - reasoningService.prepareRoleHierarchy(usedRoles); + reasoner.getSubsumptionHierarchy().improveSubsumptionHierarchy(); + reasoner.prepareRoleHierarchy(usedRoles); } public static String getName() { @@ -565,7 +564,7 @@ // solutionsSorted.addAll(solutions); // System.out.println("retrievals:"); - // for(Concept c : ReasoningService.retrievals) { + // for(Concept c : ReasonerComponent.retrievals) { // System.out.println(c); // } @@ -761,9 +760,9 @@ if(toEvaluateConcepts.size()>0) { // Test aller Konzepte auf properness (mit DIG in nur einer Anfrage) long propCalcReasoningStart = System.nanoTime(); - improperConcepts = reasoningService.subsumes(toEvaluateConcepts, concept); + improperConcepts = reasoner.subsumes(toEvaluateConcepts, concept); propernessTestsReasoner+=toEvaluateConcepts.size(); - // boolean isProper = !learningProblem.getReasoningService().subsumes(refinement, concept); + // boolean isProper = !learningProblem.getReasonerComponent().subsumes(refinement, concept); propernessCalcReasoningTimeNs += System.nanoTime() - propCalcReasoningStart; } @@ -880,7 +879,7 @@ if(refinement.getLength()>node.getHorizontalExpansion()) { // Test auf properness long propCalcReasoningStart = System.nanoTime(); - boolean isProper = !learningProblem.getReasoningService().subsumes(refinement, concept); + boolean isProper = !learningProblem.getReasonerComponent().subsumes(refinement, concept); propernessCalcReasoningTimeNs += System.nanoTime() - propCalcReasoningStart; if(isProper) { @@ -986,19 +985,19 @@ // System.out.println("properness max recursion depth: " + maxRecDepth); // System.out.println("max. number of one-step refinements: " + maxNrOfRefinements); // System.out.println("max. number of children of a node: " + maxNrOfChildren); - logger.debug("subsumption time: " + Helper.prettyPrintNanoSeconds(reasoningService.getSubsumptionReasoningTimeNs())); - logger.debug("instance check time: " + Helper.prettyPrintNanoSeconds(reasoningService.getInstanceCheckReasoningTimeNs())); + logger.debug("subsumption time: " + Helper.prettyPrintNanoSeconds(reasoner.getSubsumptionReasoningTimeNs())); + logger.debug("instance check time: " + Helper.prettyPrintNanoSeconds(reasoner.getInstanceCheckReasoningTimeNs())); } if(showBenchmarkInformation) { - long reasoningTime = reasoningService.getOverallReasoningTimeNs(); + long reasoningTime = reasoner.getOverallReasoningTimeNs(); double reasoningPercentage = 100 * reasoningTime/(double)algorithmRuntime; long propWithoutReasoning = propernessCalcTimeNs-propernessCalcReasoningTimeNs; double propPercentage = 100 * propWithoutReasoning/(double)algorithmRuntime; double deletionPercentage = 100 * childConceptsDeletionTimeNs/(double)algorithmRuntime; - long subTime = reasoningService.getSubsumptionReasoningTimeNs(); + long subTime = reasoner.getSubsumptionReasoningTimeNs(); double subPercentage = 100 * subTime/(double)algorithmRuntime; double refinementPercentage = 100 * refinementCalcTimeNs/(double)algorithmRuntime; double redundancyCheckPercentage = 100 * redundancyCheckTimeNs/(double)algorithmRuntime; Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -57,7 +57,7 @@ import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.OntologyFormat; import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; import org.dllearner.core.Score; import org.dllearner.core.config.BooleanConfigOption; import org.dllearner.core.config.ConfigEntry; @@ -112,7 +112,6 @@ private Set<KnowledgeSource> sources; private LearningAlgorithm la; private LearningProblem lp; - private ReasoningService rs; private ReasonerComponent rc; /** @@ -243,7 +242,7 @@ // step 2: detect used reasoner - Monitor rsMonitor = JamonMonitorLogger.getTimeMonitor(Start.class, "initReasoningService").start(); + Monitor rsMonitor = JamonMonitorLogger.getTimeMonitor(Start.class, "initReasonerComponent").start(); ConfFileOption reasonerOption = parser.getConfOptionsByName("reasoner"); Class<? extends ReasonerComponent> rcClass; if(reasonerOption != null) { @@ -257,7 +256,6 @@ rc = cm.reasoner(rcClass, sources); configureComponent(cm, rc, parser); initComponent(cm, rc); - rs = cm.reasoningService(rc); rsMonitor.stop(); // step 3: detect learning problem @@ -272,7 +270,7 @@ } else { lpClass = PosNegDefinitionLP.class; } - lp = cm.learningProblem(lpClass, rs); + lp = cm.learningProblem(lpClass, rc); SortedSet<String> posExamples = parser.getPositiveExamples(); SortedSet<String> negExamples = parser.getNegativeExamples(); cm.applyConfigEntry(lp, "positiveExamples", posExamples); @@ -295,7 +293,7 @@ laClass = ExampleBasedROLComponent.class; } try { - la = cm.learningAlgorithm(laClass, lp, rs); + la = cm.learningAlgorithm(laClass, lp, rc); } catch (LearningProblemUnsupportedException e) { e.printStackTrace(); } @@ -304,22 +302,22 @@ laMonitor.stop(); // perform file exports - performExports(parser, baseDir, sources, rs); + performExports(parser, baseDir, sources, rc); // handle any CLI options - processCLIOptions(cm, parser, rs, lp); + processCLIOptions(cm, parser, rc, lp); } public void start(boolean inQueryMode) { if (inQueryMode) - processQueryMode(lp, rs); + processQueryMode(lp, rc); else { // start algorithm long algStartTime = System.nanoTime(); la.start(); long algDuration = System.nanoTime() - algStartTime; - printConclusions(rs, algDuration); + printConclusions(rc, algDuration); } } @@ -519,7 +517,7 @@ } private static void performExports(ConfParser parser, String baseDir, - Set<KnowledgeSource> sources, ReasoningService rs) { + Set<KnowledgeSource> sources, ReasonerComponent rs) { List<List<String>> exports = parser.getFunctionCalls().get("export"); if (exports == null) @@ -556,7 +554,7 @@ } private static void processCLIOptions(ComponentManager cm, ConfParser parser, - ReasoningService rs, LearningProblem lp) { + ReasonerComponent rs, LearningProblem lp) { // CLI options (i.e. options which are related to the CLI // user interface but not to one of the components) List<ConfFileOption> cliOptions = parser.getConfOptionsByPrefix("cli"); @@ -684,7 +682,7 @@ + Helper.prettyPrintNanoSeconds(initTime, false, false) + ")"); } - private static void printConclusions(ReasoningService rs, long algorithmDuration) { + private static void printConclusions(ReasonerComponent rs, long algorithmDuration) { if (rs.getNrOfRetrievals() > 0) { logger.info("number of retrievals: " + rs.getNrOfRetrievals()); logger.info("retrieval reasoning time: " @@ -731,7 +729,7 @@ } // performs a query - used for debugging learning examples - private static void processQueryMode(LearningProblem lp, ReasoningService rs) { + private static void processQueryMode(LearningProblem lp, ReasonerComponent rs) { logger.info("Entering query mode. Enter a concept for performing " + "retrieval or q to quit. Use brackets for complex expresssions," @@ -859,10 +857,6 @@ public ReasonerComponent getReasonerComponent() { return rc; } - - public ReasoningService getReasoningService() { - return rs; - } /** * @deprecated See ConfMapper. Modified: trunk/src/dl-learner/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/core/ComponentManager.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -354,8 +354,8 @@ } /** - * This method returns an instance of <code>ReasoningService</code>. The - * difference between <code>ReasoningService</code> and <code>ReasonerComponent</code> + * This method returns an instance of <code>ReasonerComponent</code>. The + * difference between <code>ReasonerComponent</code> and <code>ReasonerComponent</code> * is that the former delegates all calls to the latter and collects statistics * while doing this. This means that the reasoning service enables the * collection of query information, while the <code>ReasonerComponent</code> @@ -365,8 +365,8 @@ * @param reasoner A reasoner component. * @return The reasoning service encapsulating the reasoner. */ -// public ReasoningService reasoningService(ReasonerComponent reasoner) { -// return new ReasoningService(reasoner); +// public ReasonerComponent reasoningService(ReasonerComponent reasoner) { +// return new ReasonerComponent(reasoner); // } /** Modified: trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/core/LearningAlgorithm.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -54,7 +54,7 @@ * The reasoning service variable, which must be used by * all learning algorithm implementations. */ - protected ReasoningService reasoningService; + protected ReasonerComponent reasoner; /** * Each learning algorithm gets a learning problem and @@ -63,9 +63,9 @@ * @param reasoningService The reasoner connecting to the * underlying knowledge base. */ - public LearningAlgorithm(LearningProblem learningProblem, ReasoningService reasoningService) { + public LearningAlgorithm(LearningProblem learningProblem, ReasonerComponent reasoningService) { this.learningProblem = learningProblem; - this.reasoningService = reasoningService; + this.reasoner = reasoningService; } /** @@ -90,8 +90,8 @@ * indeed changes the reasoning service. * @param reasoningService The new reasoning service. */ - public void changeReasoningService(ReasoningService reasoningService) { - this.reasoningService = reasoningService; + public void changeReasonerComponent(ReasonerComponent reasoningService) { + this.reasoner = reasoningService; } /** @@ -253,7 +253,7 @@ // be in the search of the learning algorith, which leads to // unpredictable behaviour) Description d = ed.getDescription().clone(); - ConceptTransformation.replaceRange(d, reasoningService); + ConceptTransformation.replaceRange(d, reasoner); ed.setDescription(d); returnList.add(ed); Modified: trunk/src/dl-learner/org/dllearner/core/LearningProblem.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/core/LearningProblem.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -67,7 +67,7 @@ * indeed changes the reasoning service. * @param reasoner New reasoning service. */ - public void changeReasoningService(ReasonerComponent reasoner) { + public void changeReasonerComponent(ReasonerComponent reasoner) { this.reasoner = reasoner; } Modified: trunk/src/dl-learner/org/dllearner/core/ReasonerOld.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/ReasonerOld.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/core/ReasonerOld.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -50,7 +50,7 @@ public ReasonerType getReasonerType(); // Methode, die Subsumptionhierarchie initialisiert (sollte nur einmal - // pro erstelltem ReasoningService bzw. Reasoner aufgerufen werden) + // pro erstelltem ReasonerComponent bzw. Reasoner aufgerufen werden) // => erstellt auch vereinfachte Sichten auf Subsumptionhierarchie // (siehe einfacher Traversal in Diplomarbeit) public void prepareSubsumptionHierarchy(Set<NamedClass> allowedConcepts); Modified: trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/core/configurators/BruteForceLearnerConfigurator.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -24,7 +24,7 @@ import org.dllearner.core.ComponentManager; import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; /** * automatically generated, do not edit manually. @@ -50,7 +50,7 @@ * @throws LearningProblemUnsupportedException see * @return BruteForceLearner **/ -public static BruteForceLearner getBruteForceLearner(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException{ +public static BruteForceLearner getBruteForceLearner(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException{ BruteForceLearner component = ComponentManager.getInstance().learningAlgorithm(BruteForceLearner.class, learningProblem, reasoningService); return component; } Modified: trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java =================================================================== --- trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2008-11-10 11:00:23 UTC (rev 1500) +++ trunk/src/dl-learner/org/dllearner/core/configurators/ComponentFactory.java 2008-11-10 12:44:17 UTC (rev 1501) @@ -32,7 +32,7 @@ import org.dllearner.core.KnowledgeSource; import org.dllearner.core.LearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.ReasoningService; +import org.dllearner.core.ReasonerComponent; import org.dllearner.kb.KBFile; import org.dllearner.kb.OWLAPIOntology; import org.dllearner.kb.OWLFile; @@ -121,118 +121,118 @@ /** * @param positiveExamples positive examples * @param negativeExamples negative examples -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @return a component ready for initialization PosNegDefinitionLP **/ -public static PosNegDefinitionLP getPosNegDefinitionLP(ReasoningService reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +public static PosNegDefinitionLP getPosNegDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { return PosNegDefinitionLPConfigurator.getPosNegDefinitionLP(reasoningService, positiveExamples, negativeExamples); } /** * @param positiveExamples positive examples * @param negativeExamples negative examples -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @return a component ready for initialization PosNegDefinitionLPStrict **/ -public static PosNegDefinitionLPStrict getPosNegDefinitionLPStrict(ReasoningService reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +public static PosNegDefinitionLPStrict getPosNegDefinitionLPStrict(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { return PosNegDefinitionLPStrictConfigurator.getPosNegDefinitionLPStrict(reasoningService, positiveExamples, negativeExamples); } /** * @param positiveExamples positive examples * @param negativeExamples negative examples -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @return a component ready for initialization PosNegInclusionLP **/ -public static PosNegInclusionLP getPosNegInclusionLP(ReasoningService reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { +public static PosNegInclusionLP getPosNegInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples, Set<String> negativeExamples) { return PosNegInclusionLPConfigurator.getPosNegInclusionLP(reasoningService, positiveExamples, negativeExamples); } /** * @param positiveExamples positive examples -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @return a component ready for initialization PosOnlyDefinitionLP **/ -public static PosOnlyDefinitionLP getPosOnlyDefinitionLP(ReasoningService reasoningService, Set<String> positiveExamples) { +public static PosOnlyDefinitionLP getPosOnlyDefinitionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { return PosOnlyDefinitionLPConfigurator.getPosOnlyDefinitionLP(reasoningService, positiveExamples); } /** * @param positiveExamples positive examples -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @return a component ready for initialization PosOnlyInclusionLP **/ -public static PosOnlyInclusionLP getPosOnlyInclusionLP(ReasoningService reasoningService, Set<String> positiveExamples) { +public static PosOnlyInclusionLP getPosOnlyInclusionLP(ReasonerComponent reasoningService, Set<String> positiveExamples) { return PosOnlyInclusionLPConfigurator.getPosOnlyInclusionLP(reasoningService, positiveExamples); } /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @throws LearningProblemUnsupportedException see * @return a component ready for initialization BruteForceLearner **/ -public static BruteForceLearner getBruteForceLearner(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException { +public static BruteForceLearner getBruteForceLearner(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { return BruteForceLearnerConfigurator.getBruteForceLearner(learningProblem, reasoningService); } /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @throws LearningProblemUnsupportedException see * @return a component ready for initialization DBpediaNavigationSuggestor **/ -public static DBpediaNavigationSuggestor getDBpediaNavigationSuggestor(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException { +public static DBpediaNavigationSuggestor getDBpediaNavigationSuggestor(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { return DBpediaNavigationSuggestorConfigurator.getDBpediaNavigationSuggestor(learningProblem, reasoningService); } /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @throws LearningProblemUnsupportedException see * @return a component ready for initialization RandomGuesser **/ -public static RandomGuesser getRandomGuesser(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException { +public static RandomGuesser getRandomGuesser(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { return RandomGuesserConfigurator.getRandomGuesser(learningProblem, reasoningService); } /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @throws LearningProblemUnsupportedException see * @return a component ready for initialization SimpleSuggestionLearningAlgorithm **/ -public static SimpleSuggestionLearningAlgorithm getSimpleSuggestionLearningAlgorithm(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException { +public static SimpleSuggestionLearningAlgorithm getSimpleSuggestionLearningAlgorithm(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { return SimpleSuggestionLearningAlgorithmConfigurator.getSimpleSuggestionLearningAlgorithm(learningProblem, reasoningService); } /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @throws LearningProblemUnsupportedException see * @return a component ready for initialization GP **/ -public static GP getGP(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException { +public static GP getGP(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedException { return GPConfigurator.getGP(learningProblem, reasoningService); } /** * @param learningProblem see LearningProblem -* @param reasoningService see ReasoningService +* @param reasoningService see ReasonerComponent * @throws LearningProblemUnsupportedException see * @return a component ready for initialization ExampleBasedROLComponent **/ -public static ExampleBasedROLComponent getExampleBasedROLComponent(LearningProblem learningProblem, ReasoningService reasoningService) throws LearningProblemUnsupportedException { +public static ExampleBasedROLComponent getExampleBasedROLComponent(LearningProblem learningProblem, ReasonerComponent reasoningService) throws LearningProblemUnsupportedExce... [truncated message content] |