From: <jen...@us...> - 2011-09-02 13:53:15
|
Revision: 3237 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3237&view=rev Author: jenslehmann Date: 2011-09-02 13:53:09 +0000 (Fri, 02 Sep 2011) Log Message: ----------- small CLI improvements + converted arch example Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/kb/KBFile.java trunk/examples/arch/arch.conf trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java Modified: trunk/components-core/src/main/java/org/dllearner/kb/KBFile.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/KBFile.java 2011-09-02 13:41:16 UTC (rev 3236) +++ trunk/components-core/src/main/java/org/dllearner/kb/KBFile.java 2011-09-02 13:53:09 UTC (rev 3237) @@ -46,16 +46,18 @@ * @author Jens Lehmann * */ -@ComponentAnn(name = "KB file", shortName = "kbfile", version = 0.8) +@ComponentAnn(name = "KB File", shortName = "kbfile", version = 0.8) public class KBFile extends AbstractKnowledgeSource { private static Logger logger = Logger.getLogger(KBFile.class); private KB kb; - @ConfigOption(name = "url", description = "URL pointer to the KB file", defaultValue = "", required = false, propertyEditorClass = StringTrimmerEditor.class) + @ConfigOption(name = "url", description = "URL pointer to the KB file") private String url; private String baseDir; + @ConfigOption(name = "fileName", description = "relative or absolute path to KB file") + private String fileName; /** * Default constructor (needed for reflection in ComponentManager). @@ -159,4 +161,12 @@ public void setBaseDir(String baseDir) { this.baseDir = baseDir; } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } } Modified: trunk/examples/arch/arch.conf =================================================================== --- trunk/examples/arch/arch.conf 2011-09-02 13:41:16 UTC (rev 3236) +++ trunk/examples/arch/arch.conf 2011-09-02 13:53:09 UTC (rev 3237) @@ -16,17 +16,22 @@ * Copyright (C) 2007, Sebastian Hellmann */ -algorithm = ocel; -reasoner = fastInstanceChecker; -// comment this out if the search should start from construction -// ocel.startClass = "http://localhost/foo#construction"; -// export("arch.owl"); -import("arch.kb"); +// declare some prefixes to use as abbreviations +prefixes = [ ("ex","http://localhost/foo#") ] -/** examples **/ -+c1 -+c4 --c2 --c3 --c5 +// knowledge source definition +ks.type = "KB File" +ks.url = "arch.kb" + +// reasoner +reasoner.type = "fast instance checker" +reasoner.sources = { ks } + +// learning problem +lp.type = "posNegStandard" +lp.positiveExamples = { "ex:c1", "ex:c4" } +lp.negativeExamples = { "ex:c2", "ex:c3", "ex:c5" } + +// create learning algorithm to run +alg.type = "ocel" Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-09-02 13:41:16 UTC (rev 3236) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-09-02 13:53:09 UTC (rev 3237) @@ -24,10 +24,13 @@ import java.util.ArrayList; import java.util.List; +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.Layout; +import org.apache.log4j.Level; import org.apache.log4j.Logger; +import org.apache.log4j.PatternLayout; import org.apache.xmlbeans.XmlObject; import org.dllearner.Info; -import org.dllearner.algorithms.ocel.OCEL; import org.dllearner.configuration.IConfiguration; import org.dllearner.configuration.spring.ApplicationContextBuilder; import org.dllearner.configuration.spring.DefaultApplicationContextBuilder; @@ -52,6 +55,7 @@ public class CLI { private static Logger logger = Logger.getLogger(CLI.class); + private static Logger rootLogger = Logger.getRootLogger(); private boolean writeSpringConfiguration = false; @@ -80,8 +84,15 @@ */ public static void main(String[] args) throws ParseException, IOException, ReasoningMethodUnsupportedException { - System.out.println("DL-Learner " + Info.build + " [TODO: read pom.version and put it here (make sure that the code for getting the version also works in the release build!)] command line interface"); + Layout layout = new PatternLayout(); + ConsoleAppender consoleAppender = new ConsoleAppender(layout); + rootLogger.removeAllAppenders(); + rootLogger.addAppender(consoleAppender); + rootLogger.setLevel(Level.INFO); +// System.out.println("DL-Learner " + Info.build + " [TODO: read pom.version and put it here (make sure that the code for getting the version also works in the release build!)] command line interface"); + System.out.println("DL-Learner command line interface"); + // currently, CLI has exactly one parameter - the conf file if(args.length == 0) { System.out.println("You need to give a conf file as argument."); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |