From: <sha...@us...> - 2011-08-27 20:51:39
|
Revision: 3143 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3143&view=rev Author: shadowtm Date: 2011-08-27 20:51:32 +0000 (Sat, 27 Aug 2011) Log Message: ----------- Added autowiring support. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java trunk/components-core/src/main/java/org/dllearner/core/AbstractCELA.java trunk/components-core/src/main/java/org/dllearner/core/AbstractLearningProblem.java trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java trunk/examples/family/father_autowired.conf trunk/interfaces/src/main/resources/org/dllearner/configuration/spring/bean-post-processor-configuration.xml Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java 2011-08-27 20:37:40 UTC (rev 3142) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/OCEL.java 2011-08-27 20:51:32 UTC (rev 3143) @@ -55,6 +55,7 @@ import org.dllearner.refinementoperators.RhoDRDown; import org.dllearner.utilities.Files; import org.dllearner.utilities.Helper; +import org.springframework.beans.factory.annotation.Autowired; /** * The DL-Learner learning algorithm component for the example @@ -529,6 +530,7 @@ return operator; } + @Autowired public void setOperator(RhoDRDown operator) { this.operator = operator; } @@ -853,6 +855,7 @@ this.terminateOnNoiseReached = terminateOnNoiseReached; } + @Autowired public void setHeuristic(ExampleBasedHeuristic heuristic) { this.heuristic = heuristic; } Modified: trunk/components-core/src/main/java/org/dllearner/core/AbstractCELA.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AbstractCELA.java 2011-08-27 20:37:40 UTC (rev 3142) +++ trunk/components-core/src/main/java/org/dllearner/core/AbstractCELA.java 2011-08-27 20:51:32 UTC (rev 3143) @@ -27,6 +27,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.utilities.datastructures.DescriptionSubsumptionTree; import org.dllearner.utilities.owl.ConceptTransformation; +import org.springframework.beans.factory.annotation.Autowired; /** * Abstract superclass of all class expression learning algorithm implementations. @@ -286,6 +287,7 @@ return learningProblem; } + @Autowired public void setLearningProblem(AbstractLearningProblem learningProblem) { this.learningProblem = learningProblem; } @@ -298,6 +300,7 @@ return reasoner; } + @Autowired public void setReasoner(AbstractReasonerComponent reasoner) { this.reasoner = reasoner; } Modified: trunk/components-core/src/main/java/org/dllearner/core/AbstractLearningProblem.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AbstractLearningProblem.java 2011-08-27 20:37:40 UTC (rev 3142) +++ trunk/components-core/src/main/java/org/dllearner/core/AbstractLearningProblem.java 2011-08-27 20:51:32 UTC (rev 3143) @@ -20,6 +20,7 @@ package org.dllearner.core; import org.dllearner.core.owl.Description; +import org.springframework.beans.factory.annotation.Autowired; /** * Base class for all learning problems. @@ -118,6 +119,7 @@ return reasoner; } + @Autowired public void setReasoner(AbstractReasonerComponent reasoner) { this.reasoner = reasoner; } Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java 2011-08-27 20:37:40 UTC (rev 3142) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java 2011-08-27 20:51:32 UTC (rev 3143) @@ -67,6 +67,7 @@ import org.dllearner.parser.ParseException; import org.dllearner.utilities.Helper; import org.dllearner.utilities.owl.ConceptTransformation; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.propertyeditors.StringTrimmerEditor; import sun.beans.editors.BoolEditor; @@ -105,6 +106,7 @@ private TreeSet<Individual> individuals; // private ReasonerComponent rs; + private OWLAPIReasoner rc; // we use sorted sets (map indices) here, because they have only log(n) @@ -1033,6 +1035,7 @@ return rc; } + @Autowired public void setReasonerComponent(OWLAPIReasoner rc) { this.rc = rc; } Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java 2011-08-27 20:37:40 UTC (rev 3142) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java 2011-08-27 20:51:32 UTC (rev 3143) @@ -70,6 +70,7 @@ import org.dllearner.utilities.Helper; import org.dllearner.utilities.owl.ConceptComparator; import org.dllearner.utilities.owl.ConceptTransformation; +import org.springframework.beans.factory.annotation.Autowired; /** * A downward refinement operator, which makes use of domains @@ -1640,6 +1641,7 @@ return reasoner; } + @Autowired public void setReasoner(AbstractReasonerComponent reasoner) { this.reasoner = reasoner; } Modified: trunk/examples/family/father_autowired.conf =================================================================== --- trunk/examples/family/father_autowired.conf 2011-08-27 20:37:40 UTC (rev 3142) +++ trunk/examples/family/father_autowired.conf 2011-08-27 20:51:32 UTC (rev 3143) @@ -17,7 +17,6 @@ // reasoner reasoner.type = "fast instance checker" -reasoner.reasonerComponent = embeddedReasoner embeddedReasoner.type = "OWL API Reasoner" embeddedReasoner.sources = { ks } @@ -27,14 +26,9 @@ lp.positiveExamples = {"kb:stefan","kb:markus","kb:bernd"} lp.negativeExamples = {"kb:heinz","kb:anna","kb:gabi","kb:michelle"} -// plug a reasoner into the learning problem -lp.reasoner = reasoner -//lp.reasoner = reasoner - try to remove the component:part in the parser - // create a refinement operator and configure it op.type = "rho" op.useCardinalityRestrictions = true -op.reasoner = reasoner // create a heuristic and configure it h.type = "multiheuristic" @@ -42,8 +36,4 @@ // create learning algorithm to run alg.type = "ocel" -alg.reasoner = reasoner -alg.operator = op -alg.learningProblem = lp -alg.heuristic = h alg.maxExecutionTimeInSeconds = 15 \ No newline at end of file Modified: trunk/interfaces/src/main/resources/org/dllearner/configuration/spring/bean-post-processor-configuration.xml =================================================================== --- trunk/interfaces/src/main/resources/org/dllearner/configuration/spring/bean-post-processor-configuration.xml 2011-08-27 20:37:40 UTC (rev 3142) +++ trunk/interfaces/src/main/resources/org/dllearner/configuration/spring/bean-post-processor-configuration.xml 2011-08-27 20:51:32 UTC (rev 3143) @@ -1,8 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> + <context:annotation-config/> <bean class="org.dllearner.configuration.spring.ComponentInitializationBeanPostProcessor"/> <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |