From: <jen...@us...> - 2011-08-04 11:14:54
|
Revision: 2989 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=2989&view=rev Author: jenslehmann Date: 2011-08-04 11:14:48 +0000 (Thu, 04 Aug 2011) Log Message: ----------- several smaller changes Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java trunk/components-core/src/main/java/org/dllearner/core/config/ConfigHelper.java trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java Modified: trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2011-08-04 10:52:59 UTC (rev 2988) +++ trunk/components-core/src/main/java/org/dllearner/core/ComponentManager.java 2011-08-04 11:14:48 UTC (rev 2989) @@ -486,7 +486,7 @@ return la; } - public <T extends LearningAlgorithm> T learningAlgorithm(Class<T> laClass, AbstractKnowledgeSource ks) throws LearningProblemUnsupportedException { + public <T extends LearningAlgorithm> T learningAlgorithm(Class<T> laClass, AbstractKnowledgeSource ks) { T la = invokeConstructor(laClass, new Class[] { AbstractKnowledgeSource.class }, new Object[] { ks }); return la; } @@ -742,7 +742,7 @@ * @param component * @return Name of the component. */ - public static String getName(AbstractComponent component){ + public static String getName(Component component){ ComponentAnn ann = component.getClass().getAnnotation(ComponentAnn.class); return ann.name(); } Modified: trunk/components-core/src/main/java/org/dllearner/core/config/ConfigHelper.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/config/ConfigHelper.java 2011-08-04 10:52:59 UTC (rev 2988) +++ trunk/components-core/src/main/java/org/dllearner/core/config/ConfigHelper.java 2011-08-04 11:14:48 UTC (rev 2989) @@ -10,7 +10,7 @@ import java.util.Map; import org.dllearner.algorithms.properties.PropertyDomainAxiomLearner; -import org.dllearner.core.AbstractComponent; +import org.dllearner.core.Component; public class ConfigHelper { @@ -33,7 +33,7 @@ * @param configName the name of the config option * @param configValue the value of the config option */ - public static void configure(AbstractComponent component, String configName, String configValue){ + public static void configure(Component component, String configName, String configValue){ Field[] fields = component.getClass().getDeclaredFields(); for(Field f : fields){ ConfigOption option = f.getAnnotation(ConfigOption.class); @@ -68,7 +68,7 @@ * @param component * @return */ - public static List<ConfigOption> getConfigOptions(AbstractComponent component){ + public static List<ConfigOption> getConfigOptions(Component component){ List<ConfigOption> options = new ArrayList<ConfigOption>(); Field[] fields = component.getClass().getDeclaredFields(); 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-04 10:52:59 UTC (rev 2988) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/EnrichmentEvaluation.java 2011-08-04 11:14:48 UTC (rev 2989) @@ -26,6 +26,7 @@ import org.apache.log4j.Logger; import org.dllearner.algorithms.properties.SubPropertyOfAxiomLearner; +import org.dllearner.core.AxiomLearningAlgorithm; import org.dllearner.core.ComponentManager; import org.dllearner.core.EvaluatedAxiom; import org.dllearner.core.LearningAlgorithm; @@ -59,12 +60,12 @@ private int maxObjectProperties = 3; private int maxDataProperties = 3; private int maxClasses = 3; - private List<Class<? extends LearningAlgorithm>> algorithmsToTest; + private List<Class<? extends AxiomLearningAlgorithm>> objectPropertyAlgorithms; public EnrichmentEvaluation() { - algorithmsToTest = new LinkedList<Class<? extends LearningAlgorithm>>(); - algorithmsToTest.add(SubPropertyOfAxiomLearner.class); + objectPropertyAlgorithms = new LinkedList<Class<? extends AxiomLearningAlgorithm>>(); + objectPropertyAlgorithms.add(SubPropertyOfAxiomLearner.class); } @@ -79,13 +80,13 @@ SparqlEndpointKS ks = new SparqlEndpointKS(se); - /* - for(Class<? extends LearningAlgorithm> algorithmClass : algorithmsToTest) { + for(Class<? extends AxiomLearningAlgorithm> algorithmClass : objectPropertyAlgorithms) { int objectProperties = 0; for(ObjectProperty property : properties) { // SubPropertyOfAxiomLearner learner = new SubPropertyOfAxiomLearner(ks); - LearningAlgorithm learner = cm.learningAlgorithm(algorithmClass, ks); - ConfigHelper.configure(learner, "propertyToDescribe", property); + AxiomLearningAlgorithm learner = cm.learningAlgorithm(algorithmClass, ks); + ConfigHelper.configure(learner, "propertyToDescribe", property.toString()); +// ConfigHelper.configure(learner, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds); // learner.setPropertyToDescribe(property); @@ -102,7 +103,7 @@ break; } } - } */ + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |