From: <jen...@us...> - 2007-12-03 21:49:05
|
Revision: 320 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=320&view=rev Author: jenslehmann Date: 2007-12-03 13:48:52 -0800 (Mon, 03 Dec 2007) Log Message: ----------- continued tuple list support Modified Paths: -------------- trunk/examples/sparql/simple.conf trunk/src/dl-learner/org/dllearner/cli/ConfFileOption.java trunk/src/dl-learner/org/dllearner/cli/Start.java trunk/src/dl-learner/org/dllearner/kb/SparqlEndpointRestructured.java Modified: trunk/examples/sparql/simple.conf =================================================================== --- trunk/examples/sparql/simple.conf 2007-12-03 18:29:20 UTC (rev 319) +++ trunk/examples/sparql/simple.conf 2007-12-03 21:48:52 UTC (rev 320) @@ -44,6 +44,8 @@ "http://dbpedia.org/resource/Gerhard_Schr%C3%B6der" }; +// sparql2.example = [(a,b),(c,d)]; + /** examples **/ +"http://dbpedia.org/resource/Angela_Merkel" -"http://dbpedia.org/resource/Gerhard_Schr%C3%B6der" Modified: trunk/src/dl-learner/org/dllearner/cli/ConfFileOption.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/ConfFileOption.java 2007-12-03 18:29:20 UTC (rev 319) +++ trunk/src/dl-learner/org/dllearner/cli/ConfFileOption.java 2007-12-03 21:48:52 UTC (rev 320) @@ -132,6 +132,14 @@ return doubleValue; } + public Set<String> getSetValues() { + return setValues; + } + + public List<StringTuple> getListTuples() { + return listTuples; + } + public Object getValue() { if(isIntegerOption) return intValue; @@ -199,10 +207,6 @@ else return completeOption + "=" + stringValue; } - - public Set<String> getSetValues() { - return setValues; - } public String getFullName() { if(containsSubOption) Modified: trunk/src/dl-learner/org/dllearner/cli/Start.java =================================================================== --- trunk/src/dl-learner/org/dllearner/cli/Start.java 2007-12-03 18:29:20 UTC (rev 319) +++ trunk/src/dl-learner/org/dllearner/cli/Start.java 2007-12-03 21:48:52 UTC (rev 320) @@ -53,6 +53,7 @@ import org.dllearner.core.config.InvalidConfigOptionValueException; import org.dllearner.core.config.StringConfigOption; import org.dllearner.core.config.StringSetConfigOption; +import org.dllearner.core.config.StringTupleListConfigOption; import org.dllearner.core.dl.AtomicConcept; import org.dllearner.core.dl.AtomicRole; import org.dllearner.core.dl.Concept; @@ -73,6 +74,7 @@ import org.dllearner.utilities.Datastructures; import org.dllearner.utilities.Helper; import org.dllearner.utilities.RoleComparator; +import org.dllearner.utilities.StringTuple; /** * Startup file for Command Line Interface. @@ -309,6 +311,12 @@ (StringSetConfigOption) configOption, option.getSetValues()); cm.applyConfigEntry(component, entry); + } else if (configOption instanceof StringTupleListConfigOption && option.isListOption()) { + + ConfigEntry<List<StringTuple>> entry = new ConfigEntry<List<StringTuple>>( + (StringTupleListConfigOption) configOption, option.getListTuples()); + cm.applyConfigEntry(component, entry); + } else { handleError("The type of conf file entry " + option + " is not correct."); } Modified: trunk/src/dl-learner/org/dllearner/kb/SparqlEndpointRestructured.java =================================================================== --- trunk/src/dl-learner/org/dllearner/kb/SparqlEndpointRestructured.java 2007-12-03 18:29:20 UTC (rev 319) +++ trunk/src/dl-learner/org/dllearner/kb/SparqlEndpointRestructured.java 2007-12-03 21:48:52 UTC (rev 320) @@ -41,6 +41,7 @@ import org.dllearner.core.config.InvalidConfigOptionValueException; import org.dllearner.core.config.StringConfigOption; import org.dllearner.core.config.StringSetConfigOption; +import org.dllearner.core.config.StringTupleListConfigOption; import org.dllearner.core.dl.KB; import org.dllearner.kb.sparql.Manager; import org.dllearner.kb.sparql.Manipulator; @@ -155,6 +156,8 @@ options.add(new StringConfigOption("blankNodeIdentifier", "used to identify blanknodes in Tripels")); + options.add(new StringTupleListConfigOption("example", "example")); + return options; } @@ -203,6 +206,8 @@ role = (String) entry.getValue(); } else if (option.equals("blankNodeIdentifier")) { blankNodeIdentifier = (String) entry.getValue(); + } else if (option.equals("example")) { + System.out.println(entry.getValue()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |