From: <jen...@us...> - 2011-09-02 14:04:19
|
Revision: 3238 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3238&view=rev Author: jenslehmann Date: 2011-09-02 14:04:13 +0000 (Fri, 02 Sep 2011) Log Message: ----------- moved some non-working (not converted) examples back to test Modified Paths: -------------- trunk/examples/arch/arch_owl.conf Added Paths: ----------- trunk/test/cross-benchmark/ trunk/test/epc/ trunk/test/family-benchmark/ trunk/test/krk/ trunk/test/nlp2rdf/ Removed Paths: ------------- trunk/examples/cross-benchmark/ trunk/examples/epc/ trunk/examples/family-benchmark/ trunk/examples/krk/ trunk/examples/nlp2rdf/ Modified: trunk/examples/arch/arch_owl.conf =================================================================== --- trunk/examples/arch/arch_owl.conf 2011-09-02 13:53:09 UTC (rev 3237) +++ trunk/examples/arch/arch_owl.conf 2011-09-02 14:04:13 UTC (rev 3238) @@ -16,15 +16,21 @@ * Copyright (C) 2007, Sebastian Hellmann */ -ocel.writeSearchTree = true; -ocel.searchTreeFile = "log/test.txt"; +// declare some prefixes to use as abbreviations +prefixes = [ ("ex","http://localhost/foo#") ] -/** background knowledge **/ -import("arch.owl"); +// knowledge source definition +ks.type = "OWL File" +ks.fileName = "arch.owl" -/** examples **/ -+c1 -+c4 --c2 --c3 --c5 +// 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" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-09-02 14:23:06
|
Revision: 3239 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3239&view=rev Author: jenslehmann Date: 2011-09-02 14:22:59 +0000 (Fri, 02 Sep 2011) Log Message: ----------- some work on SPARQL examples Modified Paths: -------------- trunk/examples/sparql/Actors.conf Added Paths: ----------- trunk/test/sparql/ trunk/test/sparql/AristotlePos.conf Removed Paths: ------------- trunk/examples/sparql/AristotlePos.conf Modified: trunk/examples/sparql/Actors.conf =================================================================== --- trunk/examples/sparql/Actors.conf 2011-09-02 14:04:13 UTC (rev 3238) +++ trunk/examples/sparql/Actors.conf 2011-09-02 14:22:59 UTC (rev 3239) @@ -7,13 +7,13 @@ // SPARQL options sparql.type = "SPARQL endpoint fragment" -sparql.url = "http://dbpedia.openlinksw.com:8890/sparql" +sparql.url = "http://live.dbpedia.org/sparql" sparql.defaultGraphURIs = {"http://dbpedia.org"} sparql.recursionDepth = 1 //TODOREFACTOR check if predefinedFilter works at all //predefined filter (1 = YAGO based learning) // 2 = SKOS, more Options are needed then though. replacePredicate, breakSuperClassRetrievalAfter -sparql.predefinedFilter = "YAGO"; +sparql.predefinedFilter = "YAGO" // the set of objects as starting point for fragment selection // (should be identical to the set of examples) @@ -24,7 +24,7 @@ "http://dbpedia.org/resource/Jason_Mewes", "http://dbpedia.org/resource/Kevin_Smith", "http://dbpedia.org/resource/Trey_Parker", -"http://dbpedia.org/resource/Adam_Sandler"}; +"http://dbpedia.org/resource/Adam_Sandler"} reasoner.type = "fast instance checker" reasoner.sources = {sparql} Deleted: trunk/examples/sparql/AristotlePos.conf =================================================================== --- trunk/examples/sparql/AristotlePos.conf 2011-09-02 14:04:13 UTC (rev 3238) +++ trunk/examples/sparql/AristotlePos.conf 2011-09-02 14:22:59 UTC (rev 3239) @@ -1,46 +0,0 @@ -/** - * Some people from Greece. - * Note: DBpedia is always subject to change, solutions will change over time - - * Possible Solution: - * Theorist OR (Mathematician AND Physicist) - * - * This is the same as AristotlePosNeg.conf, but positives only - */ - -// SPARQL options -sparql.type = "SPARQL endpoint fragment" -sparql.url = "http://dbpedia.openlinksw.com:8890/sparql" -sparql.defaultGraphURIs = {"http://dbpedia.org"} -sparql.recursionDepth = 1 -//TODOREFACTOR check if predefinedFilter works at all -//predefined filter (1 = YAGO based learning) -sparql.predefinedFilter = "YAGO" -sparql.instances = { -"http://dbpedia.org/resource/Democritus", -"http://dbpedia.org/resource/Zeno_of_Elea", -"http://dbpedia.org/resource/Plato", -"http://dbpedia.org/resource/Socrates", -"http://dbpedia.org/resource/Archytas", -"http://dbpedia.org/resource/Pythagoras", -"http://dbpedia.org/resource/Philolaus" -} - -reasoner.type = "fast instance checker" -reasoner.sources = {sparql} - -// we want to learn from positive examples only -lp.type = "positive only learning problem" -lp.positiveExamples = { -"http://dbpedia.org/resource/Archytas", -"http://dbpedia.org/resource/Pythagoras", -"http://dbpedia.org/resource/Philolaus" -} - -lp.reasoner = reasoner - -// we use the OCEL algorithm -alg.type = "ocel" -alg.reasoner = reasoner -alg.learningProblem = lp - Copied: trunk/test/sparql/AristotlePos.conf (from rev 3237, trunk/examples/sparql/AristotlePos.conf) =================================================================== --- trunk/test/sparql/AristotlePos.conf (rev 0) +++ trunk/test/sparql/AristotlePos.conf 2011-09-02 14:22:59 UTC (rev 3239) @@ -0,0 +1,46 @@ +/** + * Some people from Greece. + * Note: DBpedia is always subject to change, solutions will change over time + + * Possible Solution: + * Theorist OR (Mathematician AND Physicist) + * + * This is the same as AristotlePosNeg.conf, but positives only + */ + +// SPARQL options +sparql.type = "SPARQL endpoint fragment" +sparql.url = "http://dbpedia.openlinksw.com:8890/sparql" +sparql.defaultGraphURIs = {"http://dbpedia.org"} +sparql.recursionDepth = 1 +//TODOREFACTOR check if predefinedFilter works at all +//predefined filter (1 = YAGO based learning) +sparql.predefinedFilter = "YAGO" +sparql.instances = { +"http://dbpedia.org/resource/Democritus", +"http://dbpedia.org/resource/Zeno_of_Elea", +"http://dbpedia.org/resource/Plato", +"http://dbpedia.org/resource/Socrates", +"http://dbpedia.org/resource/Archytas", +"http://dbpedia.org/resource/Pythagoras", +"http://dbpedia.org/resource/Philolaus" +} + +reasoner.type = "fast instance checker" +reasoner.sources = {sparql} + +// we want to learn from positive examples only +lp.type = "positive only learning problem" +lp.positiveExamples = { +"http://dbpedia.org/resource/Archytas", +"http://dbpedia.org/resource/Pythagoras", +"http://dbpedia.org/resource/Philolaus" +} + +lp.reasoner = reasoner + +// we use the OCEL algorithm +alg.type = "ocel" +alg.reasoner = reasoner +alg.learningProblem = lp + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sha...@us...> - 2011-09-03 00:08:09
|
Revision: 3241 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3241&view=rev Author: shadowtm Date: 2011-09-03 00:08:03 +0000 (Sat, 03 Sep 2011) Log Message: ----------- Fixed broken test Modified Paths: -------------- trunk/examples/family/father_autowired.conf trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserConfiguration.java Modified: trunk/examples/family/father_autowired.conf =================================================================== --- trunk/examples/family/father_autowired.conf 2011-09-02 14:33:33 UTC (rev 3240) +++ trunk/examples/family/father_autowired.conf 2011-09-03 00:08:03 UTC (rev 3241) @@ -11,7 +11,7 @@ prefixes = [ ("kb","http://localhost/foo#") ] // knowledge source definition -ks.type = "KB file" +ks.type = "KB File" ks.url = "father.kb" // ks.baseDir = "examples/family"; //Assuming running from parent directory of examples. Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserConfiguration.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserConfiguration.java 2011-09-02 14:33:33 UTC (rev 3240) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserConfiguration.java 2011-09-03 00:08:03 UTC (rev 3241) @@ -79,7 +79,7 @@ result = Class.forName(value); } catch (ClassNotFoundException e) { // if all methods fail, throw an exception - throw new RuntimeException("Problem getting class type for bean: " + beanName + " - trying to instantiate class: " + value); + throw new RuntimeException("Problem getting class type for bean: " + beanName + " - trying to instantiate class: " + value,e); } return result; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lor...@us...> - 2011-09-08 09:30:00
|
Revision: 3245 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3245&view=rev Author: lorenz_b Date: 2011-09-08 09:29:51 +0000 (Thu, 08 Sep 2011) Log Message: ----------- Provided support for inference. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java 2011-09-07 17:09:48 UTC (rev 3244) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/SPARQLReasoner.java 2011-09-08 09:29:51 UTC (rev 3245) @@ -78,6 +78,7 @@ private static final Logger logger = LoggerFactory.getLogger(SPARQLReasoner.class); private SparqlEndpointKS ks; + private ClassHierarchy hierarchy; public SPARQLReasoner(SparqlEndpointKS ks) { this.ks = ks; @@ -120,7 +121,8 @@ subsumptionHierarchyUp.put(atom, tmp); } logger.info("... done in {}ms", (System.currentTimeMillis()-startTime)); - return new ClassHierarchy(subsumptionHierarchyUp, subsumptionHierarchyDown); + hierarchy = new ClassHierarchy(subsumptionHierarchyUp, subsumptionHierarchyDown); + return hierarchy; } public Model loadSchema(){ Modified: trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2011-09-07 17:09:48 UTC (rev 3244) +++ trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2011-09-08 09:29:51 UTC (rev 3245) @@ -73,6 +73,7 @@ import org.dllearner.algorithms.properties.SubObjectPropertyOfAxiomLearner; import org.dllearner.algorithms.properties.SymmetricObjectPropertyAxiomLearner; import org.dllearner.algorithms.properties.TransitiveObjectPropertyAxiomLearner; +import org.dllearner.core.AbstractAxiomLearningAlgorithm; import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.AnnComponentManager; import org.dllearner.core.AxiomLearningAlgorithm; @@ -189,6 +190,9 @@ private int nrOfAxiomsToLearn = 10; private double threshold = 0.7; + private boolean useInference; + private SPARQLReasoner reasoner; + // lists of algorithms to apply private List<Class<? extends AxiomLearningAlgorithm>> objectPropertyAlgorithms; private List<Class<? extends AxiomLearningAlgorithm>> dataPropertyAlgorithms; @@ -203,11 +207,12 @@ SparqlKnowledgeSource ksCached; AbstractReasonerComponent rcCached; - public Enrichment(SparqlEndpoint se, Entity resource, double threshold, boolean verbose) { + public Enrichment(SparqlEndpoint se, Entity resource, double threshold, boolean useInference, boolean verbose) { this.se = se; this.resource = resource; this.verbose = verbose; this.threshold = threshold; + this.useInference = useInference; objectPropertyAlgorithms = new LinkedList<Class<? extends AxiomLearningAlgorithm>>(); objectPropertyAlgorithms.add(DisjointObjectPropertyAxiomLearner.class); @@ -251,6 +256,14 @@ SparqlEndpointKS ks = new SparqlEndpointKS(se); ks.init(); + if(useInference){ + reasoner = new SPARQLReasoner(ks); + System.out.print("Precomputing subsumption hierarchy ... "); + long startTime = System.currentTimeMillis(); + reasoner.prepareSubsumptionHierarchy(); + System.out.println("done in " + (System.currentTimeMillis() - startTime) + " ms"); + } + // common helper objects SPARQLTasks st = new SPARQLTasks(se); @@ -424,16 +437,20 @@ ConfigHelper.configure(learner, "maxExecutionTimeInSeconds", maxExecutionTimeInSeconds); learner.init(); + if(reasoner != null){ + ((AbstractAxiomLearningAlgorithm)learner).setReasoner(reasoner); + } String algName = AnnComponentManager.getName(learner); System.out.print("Applying " + algName + " on " + entity + " ... "); long startTime = System.currentTimeMillis(); try { learner.start(); } catch (Exception e) { - e.printStackTrace(); if(e.getCause() instanceof SocketTimeoutException){ System.out.println("Query timed out (endpoint possibly too slow)."); - } + } else { + e.printStackTrace(); + } } long runtime = System.currentTimeMillis() - startTime; System.out.println("done in " + runtime + " ms"); @@ -727,6 +744,7 @@ System.exit(0); } + boolean useInference = (Boolean) options.valueOf("i"); // boolean verbose = (Boolean) options.valueOf("v"); double threshold = (Double) options.valueOf("t"); @@ -739,7 +757,7 @@ System.setOut(printStream); } - Enrichment e = new Enrichment(se, resource, threshold, false); + Enrichment e = new Enrichment(se, resource, threshold, useInference, false); e.start(); SparqlEndpointKS ks = new SparqlEndpointKS(se); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-09-13 09:08:59
|
Revision: 3249 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3249&view=rev Author: jenslehmann Date: 2011-09-13 09:08:47 +0000 (Tue, 13 Sep 2011) Log Message: ----------- made type names case insensitive in conf files Modified Paths: -------------- trunk/examples/family/father.conf trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserConfiguration.java Modified: trunk/examples/family/father.conf =================================================================== --- trunk/examples/family/father.conf 2011-09-08 11:21:19 UTC (rev 3248) +++ trunk/examples/family/father.conf 2011-09-13 09:08:47 UTC (rev 3249) @@ -46,4 +46,5 @@ alg.operator = op alg.learningProblem = lp alg.heuristic = h -alg.maxExecutionTimeInSeconds = 15 \ No newline at end of file +alg.maxExecutionTimeInSeconds = 15 + Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserConfiguration.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserConfiguration.java 2011-09-08 11:21:19 UTC (rev 3248) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParserConfiguration.java 2011-09-13 09:08:47 UTC (rev 3249) @@ -1,5 +1,6 @@ package org.dllearner.confparser3; +import org.apache.commons.collections15.BidiMap; import org.dllearner.cli.ConfFileOption2; import org.dllearner.configuration.IConfiguration; import org.dllearner.configuration.IConfigurationProperty; @@ -9,6 +10,7 @@ import java.io.IOException; import java.util.*; +import java.util.Map.Entry; /** * Created by IntelliJ IDEA. @@ -64,15 +66,20 @@ Class<?> result = null; String value = (String) option.getValue(); - // first option: use long name of @ComponentAnn annotation - Class<? extends Component> classFromName = AnnComponentManager.getInstance().getComponentsNamed().getKey(value); - if(classFromName != null) { - return classFromName; + // first option: use long name of @ComponentAnn annotation (case insensitive) + BidiMap<Class<? extends Component>, String> componentsNamed = AnnComponentManager.getInstance().getComponentsNamed(); + for(Entry<Class<? extends Component>, String> entry : componentsNamed.entrySet()) { + if(entry.getValue().equalsIgnoreCase(value)) { + return entry.getKey(); + } } - // second option: use short name of @ComponentAnn annotation - Class<? extends Component> classFromShortName = AnnComponentManager.getInstance().getComponentsNamedShort().getKey(value); - if(classFromShortName != null) { - return classFromShortName; + // second option: use short name of @ComponentAnn annotation + // by convention, short names should always be lower case, but we still do it case insensitive + BidiMap<Class<? extends Component>, String> componentsNamedShort = AnnComponentManager.getInstance().getComponentsNamedShort(); + for(Entry<Class<? extends Component>, String> entry : componentsNamedShort.entrySet()) { + if(entry.getValue().equalsIgnoreCase(value)) { + return entry.getKey(); + } } // third option: use specified class name try { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hee...@us...> - 2011-09-22 08:12:16
|
Revision: 3282 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3282&view=rev Author: heeroyuy Date: 2011-09-22 08:12:08 +0000 (Thu, 22 Sep 2011) Log Message: ----------- -debian paket zeug Added Paths: ----------- trunk/components-core/src/deb-package/ trunk/components-core/src/deb-package/build_debpkg.sh trunk/components-core/src/deb-package/debian/ trunk/components-core/src/deb-package/debian/README trunk/components-core/src/deb-package/debian/README.Debian trunk/components-core/src/deb-package/debian/README.source trunk/components-core/src/deb-package/debian/changelog trunk/components-core/src/deb-package/debian/compat trunk/components-core/src/deb-package/debian/components-core.substvars trunk/components-core/src/deb-package/debian/control trunk/components-core/src/deb-package/debian/copyright trunk/components-core/src/deb-package/debian/dl-learner-components-core.install trunk/components-core/src/deb-package/debian/docs trunk/components-core/src/deb-package/debian/files trunk/components-core/src/deb-package/debian/rules trunk/components-core/src/deb-package/debian/source/ trunk/components-core/src/deb-package/debian/source/format trunk/interfaces/src/deb-package/ trunk/interfaces/src/deb-package/build_debpkg.sh trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README.Debian trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README.source trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/changelog trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/compat trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/control trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/copyright trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/dl-learner-interfaces.install trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/dl-learner-interfaces.substvars trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/docs trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/files trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/rules trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/source/ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/source/format trunk/interfaces/src/deb-package/dllearner-CLI.sh trunk/interfaces/src/deb-package/dllearner-GUI.sh trunk/interfaces/src/deb-package/dllearner-cli trunk/interfaces/src/deb-package/dllearner-gui Added: trunk/components-core/src/deb-package/build_debpkg.sh =================================================================== --- trunk/components-core/src/deb-package/build_debpkg.sh (rev 0) +++ trunk/components-core/src/deb-package/build_debpkg.sh 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,17 @@ +#!/bin/sh +MODULE_NAME=components-core-0.5-SNAPSHOT +echo "Building Debian package for ${MODULE_NAME}" +echo +rm -rf ../../target/dl-learner-components-core-0.5 +mkdir -p ../../target/dl-learner-components-core-0.5/usr/share/dllearner +# Extract the tarball to the package workspace +#tar xfz data.tar.gz --directory ../../target/deb-pkg +# copy war file to package workspace +cp ../../target/components-core-1.0-SNAPSHOT-jar-with-dependencies.jar ../../target/dl-learner-components-core-0.5/usr/share/dllearner +# Add the Debian control files +cp -r debian ../../target/dl-learner-components-core-0.5 +cd ../../target/dl-learner-components-core-0.5/debian +dch -i +# Build the package and sign it. +cd ../../target/dl-learner-components-core-0.5 +debuild --check-dirname-level 0 Added: trunk/components-core/src/deb-package/debian/README =================================================================== --- trunk/components-core/src/deb-package/debian/README (rev 0) +++ trunk/components-core/src/deb-package/debian/README 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,6 @@ +The Debian Package components-core +---------------------------- + +Comments regarding the Package + + -- Heero Yuy <chr...@ya...> Mon, 04 Jul 2011 19:27:59 +0200 Added: trunk/components-core/src/deb-package/debian/README.Debian =================================================================== --- trunk/components-core/src/deb-package/debian/README.Debian (rev 0) +++ trunk/components-core/src/deb-package/debian/README.Debian 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,6 @@ +components-core for Debian +-------------------------- + +<possible notes regarding this package - if none, delete this file> + + -- Heero Yuy <chr...@ya...> Mon, 04 Jul 2011 19:27:59 +0200 Added: trunk/components-core/src/deb-package/debian/README.source =================================================================== --- trunk/components-core/src/deb-package/debian/README.source (rev 0) +++ trunk/components-core/src/deb-package/debian/README.source 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,9 @@ +components-core for Debian +-------------------------- + +<this file describes information about the source package, see Debian policy +manual section 4.14. You WILL either need to modify or delete this file> + + + + Added: trunk/components-core/src/deb-package/debian/changelog =================================================================== --- trunk/components-core/src/deb-package/debian/changelog (rev 0) +++ trunk/components-core/src/deb-package/debian/changelog 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,5 @@ +dl-learner-components-core (0.5-1) lod2; urgency=low + + * Initial Release. + + -- Christian Kötteritzsch (Der Student) <chr...@ya...> Mon, 04 Jul 2011 19:27:59 +0200 Added: trunk/components-core/src/deb-package/debian/compat =================================================================== --- trunk/components-core/src/deb-package/debian/compat (rev 0) +++ trunk/components-core/src/deb-package/debian/compat 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1 @@ +7 Added: trunk/components-core/src/deb-package/debian/components-core.substvars =================================================================== --- trunk/components-core/src/deb-package/debian/components-core.substvars (rev 0) +++ trunk/components-core/src/deb-package/debian/components-core.substvars 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1 @@ +misc:Depends= Added: trunk/components-core/src/deb-package/debian/control =================================================================== --- trunk/components-core/src/deb-package/debian/control (rev 0) +++ trunk/components-core/src/deb-package/debian/control 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,14 @@ +Source: dl-learner-components-core +Section: misc +Priority: extra +Maintainer: Jens Lehmann <le...@in...> +Build-Depends: debhelper (>= 7.0.50~) +Standards-Version: 3.9.1 +Homepage: http://dl-learner.org +#Vcs-Git: git://git.debian.org/collab-maint/components-core.git +#Vcs-Browser: http://git.debian.org/?p=collab-maint/components-core.git;a=summary + +Package: dl-learner-components-core +Architecture: all +Depends: openjdk-6-jre | sun-java6-jre +Description: This is a package that contains the core components of the dl-learner. Added: trunk/components-core/src/deb-package/debian/copyright =================================================================== --- trunk/components-core/src/deb-package/debian/copyright (rev 0) +++ trunk/components-core/src/deb-package/debian/copyright 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,31 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: components-core +Source: <url://example.com> + +Files: * +Copyright: <years> <put author's name and email here> + <years> <likewise for another author> +License: Apache-2.0 + +Files: debian/* +Copyright: 2011 Heero Yuy <chr...@ya...> +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. Added: trunk/components-core/src/deb-package/debian/dl-learner-components-core.install =================================================================== --- trunk/components-core/src/deb-package/debian/dl-learner-components-core.install (rev 0) +++ trunk/components-core/src/deb-package/debian/dl-learner-components-core.install 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1 @@ +../components-core-1.0-SNAPSHOT-jar-with-dependencies.jar /usr/share/dllearner \ No newline at end of file Added: trunk/components-core/src/deb-package/debian/docs =================================================================== Added: trunk/components-core/src/deb-package/debian/files =================================================================== --- trunk/components-core/src/deb-package/debian/files (rev 0) +++ trunk/components-core/src/deb-package/debian/files 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1 @@ +components-core_0.5_all.deb misc extra Added: trunk/components-core/src/deb-package/debian/rules =================================================================== --- trunk/components-core/src/deb-package/debian/rules (rev 0) +++ trunk/components-core/src/deb-package/debian/rules 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ Added: trunk/components-core/src/deb-package/debian/source/format =================================================================== --- trunk/components-core/src/deb-package/debian/source/format (rev 0) +++ trunk/components-core/src/deb-package/debian/source/format 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1 @@ +3.0 (native) Added: trunk/interfaces/src/deb-package/build_debpkg.sh =================================================================== --- trunk/interfaces/src/deb-package/build_debpkg.sh (rev 0) +++ trunk/interfaces/src/deb-package/build_debpkg.sh 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,31 @@ +#!/bin/sh +MODULE_NAME=interfaces-0.5-SNAPSHOT +echo "Building Debian package for ${MODULE_NAME}" +echo +rm -rf ../../target/dl-learner-interfaces-0.5 +mkdir -p ../../target/dl-learner-interfaces-0.5/usr/share/dllearner +mkdir -p ../../target/dl-learner-interfaces-0.5/usr/share/pixmaps +mkdir -p ../../target/dl-learner-interfaces-0.5/usr/share/applications +# Extract the tarball to the package workspace +#tar xfz data.tar.gz --directory ../../target/deb-pkg +# copy war file to package workspace +cp ../../target/interfaces-jar-with-dependencies.jar ../../target/dl-learner-interfaces-0.5/usr/share/dllearner +cp dllearner-gui dllearner-gui.desktop +cp dllearner-cli dllearner-cli.desktop +mv -v dllearner-gui.desktop ../../target/dl-learner-interfaces-0.5/usr/share/applications +mv -v dllearner-cli.desktop ../../target/dl-learner-interfaces-0.5/usr/share/applications +cp ../../target/appassembler/bin/StartCLI ../../target/appassembler/bin/dllearner-CLI.sh +cp ../../target/appassembler/bin/StartGUI ../../target/appassembler/bin/dllearner-GUI.sh +mv ../../target/appassembler/bin/dllearner-CLI.sh ../../target/dl-learner-interfaces-0.5/usr/share/dllearner +mv ../../target/appassembler/bin/dllearner-GUI.sh ../../target/dl-learner-interfaces-0.5/usr/share/dllearner +cp ../../../images/logos/dllearner_small.png ../../target/dl-learner-interfaces-0.5/usr/share/pixmaps +# Add the Debian control files +cd dl-learner-interfaces-0.5/debian +dch -n +cd .. +cp -r debian ../../../target/dl-learner-interfaces-0.5 +cd ../../../target/dl-learner-interfaces-0.5/debian +# Build the package and sign it. +cd ../../../target/dl-learner-interfaces-0.5 +debuild --check-dirname-level 0 + Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,6 @@ +The Debian Package dl-learner-interfaces +---------------------------- + +Comments regarding the Package + + -- Heero Yuy <chr...@ya...> Thu, 07 Jul 2011 20:16:12 +0200 Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README.Debian =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README.Debian (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README.Debian 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,6 @@ +dl-learner-interfaces for Debian +-------------------------------- + +<possible notes regarding this package - if none, delete this file> + + -- Heero Yuy <chr...@ya...> Thu, 07 Jul 2011 20:16:12 +0200 Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README.source =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README.source (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/README.source 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,9 @@ +dl-learner-interfaces for Debian +-------------------------------- + +<this file describes information about the source package, see Debian policy +manual section 4.14. You WILL either need to modify or delete this file> + + + + Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/changelog =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/changelog (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/changelog 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,11 @@ +dl-learner-interfaces (0.5-2) lod2; urgency=low + + * Added start scripts for the interfaces + + -- Christian Kötteritzsch (Der Student) <chr...@ya...> Thu, 14 Jul 2011 12:36:41 +0200 + +dl-learner-interfaces (0.5-1) lod2; urgency=low + + * Initial Release. + + -- Christian Kötteritzsch (Der Student) <chr...@ya...> Thu, 07 Jul 2011 20:16:12 +0200 Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/compat =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/compat (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/compat 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1 @@ +7 Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/control =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/control (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/control 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,15 @@ +Source: dl-learner-interfaces +Section: misc +Priority: extra +Maintainer: Jens Lehmann <le...@in...> +Build-Depends: debhelper (>= 7.0.50~) +Standards-Version: 3.9.1 +Homepage: http://dl-learner.org +#Vcs-Git: git://git.debian.org/collab-maint/dl-learner-interfaces.git +#Vcs-Browser: http://git.debian.org/?p=collab-maint/dl-learner-interfaces.git;a=summary + +Package: dl-learner-interfaces +Architecture: all +Depends: openjdk-6-jre | sun-java6-jre, dl-learner-components-core +Description: This package provides interfaces to use DL-Learner: + a commandline interface, a graphical user interface and a web service. You can start them using the commands dl-learner-cli, dl-learner-gui and dl-learner-ws. Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/copyright =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/copyright (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/copyright 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,31 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: dl-learner-interfaces +Source: <url://example.com> + +Files: * +Copyright: <years> <put author's name and email here> + <years> <likewise for another author> +License: Apache-2.0 + +Files: debian/* +Copyright: 2011 Heero Yuy <chr...@ya...> +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". + +# Please also look if there are files or directories which have a +# different copyright/license attached and list them here. Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/dl-learner-interfaces.install =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/dl-learner-interfaces.install (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/dl-learner-interfaces.install 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,6 @@ +../interfaces-jar-with-dependencies.jar /usr/share/dllearner +../dllearner-gui.desktop /usr/share/applications +../dllearner-cli dllearner-cli.desktop /usr/share/applications +../dllearner_small.png /usr/share/pixmaps +../dllearner-CLI.sh /usr/share/dllearner +../dllearner-GUI.sh /usr/share/dllearner \ No newline at end of file Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/dl-learner-interfaces.substvars =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/dl-learner-interfaces.substvars (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/dl-learner-interfaces.substvars 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1 @@ +misc:Depends= Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/docs =================================================================== Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/files =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/files (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/files 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,2 @@ +dl-learner-interfaces_0.5-2.1_all.deb misc extra +dl-learner-interfaces_0.5-2.tar.gz Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/rules =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/rules (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/rules 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,13 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ Added: trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/source/format =================================================================== --- trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/source/format (rev 0) +++ trunk/interfaces/src/deb-package/dl-learner-interfaces-0.5/debian/source/format 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1 @@ +3.0 (native) Added: trunk/interfaces/src/deb-package/dllearner-CLI.sh =================================================================== --- trunk/interfaces/src/deb-package/dllearner-CLI.sh (rev 0) +++ trunk/interfaces/src/deb-package/dllearner-CLI.sh 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,100 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Copyright 2001-2006 The Apache Software Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------- + +# Copyright (c) 2001-2002 The Apache Software Foundation. All rights +# reserved. + +BASEDIR=`dirname $0`/.. +BASEDIR=`(cd "$BASEDIR"; pwd)` + + + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) cygwin=true ;; + Darwin*) darwin=true + if [ -z "$JAVA_VERSION" ] ; then + JAVA_VERSION="CurrentJDK" + else + echo "Using Java version: $JAVA_VERSION" + fi + if [ -z "$JAVA_HOME" ] ; then + JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# If a specific java binary isn't specified search for the standard 'java' binary +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD=`which java` + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." + echo " We cannot execute $JAVACMD" + exit 1 +fi + +if [ -z "$REPO" ] +then + REPO="$BASEDIR"/repo +fi + +CLASSPATH=$CLASSPATH_PREFIX:"$BASEDIR"/etc:"$REPO"/org/dllearner/components-core/1.0-SNAPSHOT/components-core-1.0-SNAPSHOT-jar-with-dependencies.jar:"$REPO"/com/jamonapi/jamon/2.7/jamon-2.7.jar:"$REPO"/org/aksw/commons/sparql/0.2-SNAPSHOT/sparql-0.2-20110917.162637-14.jar:"$REPO"/org/aksw/commons/util/0.2-SNAPSHOT/util-0.2-20110920.143923-15.jar:"$REPO"/org/aksw/commons/collections/0.2-SNAPSHOT/collections-0.2-20110920.143941-14.jar:"$REPO"/org/aksw/commons/collections-scala/0.2-SNAPSHOT/collections-scala-0.2-20110917.162637-13.jar:"$REPO"/com/hp/hpl/jena/jena/2.6.4/jena-2.6.4.jar:"$REPO"/com/hp/hpl/jena/iri/0.8/iri-0.8.jar:"$REPO"/com/ibm/icu/icu4j/3.4.4/icu4j-3.4.4.jar:"$REPO"/xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar:"$REPO"/org/slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar:"$REPO"/log4j/log4j/1.2.16/log4j-1.2.16.jar:"$REPO"/com/hp/hpl/jena/arq/2.8.8/arq-2.8.8.jar:"$REPO"/org/codehaus/woodstox/wstx-asl/3.2.9/wstx-asl-3.2.9.jar:"$REPO"/stax/stax-api/1.0.1/stax-api-1.0.1.jar:"$REPO"/org/apache/lucene/lucene-core/2.9.3/lucene-core-2.9.3.jar:"$REPO"/com/owldl/pellet/2.2.2/pellet-2.2.2.jar:"$REPO"/aterm/aterm-java/1.6/aterm-java-1.6.jar:"$REPO"/xsdlib/xsdlib/20030225/xsdlib-20030225.jar:"$REPO"/relaxngDatatype/relaxngDatatype/20020414/relaxngDatatype-20020414.jar:"$REPO"/org/jgrapht/jgrapht-jdk1.5/0.7.3/jgrapht-jdk1.5-0.7.3.jar:"$REPO"/net/sourceforge/owlapi/owlapi/3.1.0/owlapi-3.1.0.jar:"$REPO"/com/openlink/virtuoso/virtjdbc3/6.1.2/virtjdbc3-6.1.2.jar:"$REPO"/com/openlink/virtuoso/virt_jena/6.1.2/virt_jena-6.1.2.jar:"$REPO"/com/google/guava/guava/r07/guava-r07.jar:"$REPO"/net/sourceforge/collections/collections-generic/4.01/collections-generic-4.01.jar:"$REPO"/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar:"$REPO"/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:"$REPO"/com/hp/hpl/jena/sdb/1.3.4/sdb-1.3.4.jar:"$REPO"/com/hp/hpl/jena/tdb/0.8.9/tdb-0.8.9.jar:"$REPO"/com/hp/hpl/jena/arq-extra/2.7.0/arq-extra-2.7.0.jar:"$REPO"/velocity/velocity/1.5/velocity-1.5.jar:"$REPO"/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:"$REPO"/commons-lang/commons-lang/2.4/commons-lang-2.4.jar:"$REPO"/oro/oro/2.0.8/oro-2.0.8.jar:"$REPO"/com/h2database/h2/1.2.143/h2-1.2.143.jar:"$REPO"/org/apache/solr/solr-core/3.3.0/solr-core-3.3.0.jar:"$REPO"/org/apache/solr/solr-solrj/3.3.0/solr-solrj-3.3.0.jar:"$REPO"/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar:"$REPO"/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar:"$REPO"/commons-codec/commons-codec/1.4/commons-codec-1.4.jar:"$REPO"/commons-io/commons-io/1.4/commons-io-1.4.jar:"$REPO"/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar:"$REPO"/org/apache/zookeeper/zookeeper/3.3.1/zookeeper-3.3.1.jar:"$REPO"/jline/jline/0.9.94/jline-0.9.94.jar:"$REPO"/org/apache/solr/solr-noggit/3.3.0/solr-noggit-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-analyzers/3.3.0/lucene-analyzers-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-highlighter/3.3.0/lucene-highlighter-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-memory/3.3.0/lucene-memory-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-queries/3.3.0/lucene-queries-3.3.0.jar:"$REPO"/jakarta-regexp/jakarta-regexp/1.4/jakarta-regexp-1.4.jar:"$REPO"/org/apache/lucene/lucene-misc/3.3.0/lucene-misc-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-spatial/3.3.0/lucene-spatial-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-spellchecker/3.3.0/lucene-spellchecker-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-grouping/3.3.0/lucene-grouping-3.3.0.jar:"$REPO"/org/apache/solr/solr-commons-csv/3.3.0/solr-commons-csv-3.3.0.jar:"$REPO"/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar:"$REPO"/org/apache/velocity/velocity/1.6.4/velocity-1.6.4.jar:"$REPO"/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar:"$REPO"/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar:"$REPO"/commons-digester/commons-digester/1.8/commons-digester-1.8.jar:"$REPO"/commons-chain/commons-chain/1.1/commons-chain-1.1.jar:"$REPO"/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar:"$REPO"/dom4j/dom4j/1.1/dom4j-1.1.jar:"$REPO"/sslext/sslext/1.2-0/sslext-1.2-0.jar:"$REPO"/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar:"$REPO"/antlr/antlr/2.7.2/antlr-2.7.2.jar:"$REPO"/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar:"$REPO"/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar:"$REPO"/org/slf4j/slf4j-jdk14/1.6.1/slf4j-jdk14-1.6.1.jar:"$REPO"/edu/stanford/postagger/3.0.2/postagger-3.0.2.jar:"$REPO"/lbj/library/1.0/library-1.0.jar:"$REPO"/lbj/core/1.0/core-1.0.jar:"$REPO"/lbj/ner/1.0/ner-1.0.jar:"$REPO"/jaws/core/1.0/core-1.0.jar:"$REPO"/uk/ac/shef/wit/simmetrics/1.6.2/simmetrics-1.6.2.jar:"$REPO"/woodstox/wstx-api/3.2.0/wstx-api-3.2.0.jar:"$REPO"/org/apache/opennlp/opennlp-tools/1.5.1-incubating/opennlp-tools-1.5.1-incubating.jar:"$REPO"/org/apache/opennlp/opennlp-maxent/3.0.1-incubating/opennlp-maxent-3.0.1-incubating.jar:"$REPO"/jwnl/jwnl/1.3.3/jwnl-1.3.3.jar:"$REPO"/com/aliasi/lingpipe/4.0.1/lingpipe-4.0.1.jar:"$REPO"/org/annolab/tt4j/org.annolab.tt4j/1.0.14/org.annolab.tt4j-1.0.14.jar:"$REPO"/org/ini4j/ini4j/0.5.2/ini4j-0.5.2.jar:"$REPO"/net/didion/jwnl/jwnl/1.4.1.RC2/jwnl-1.4.1.RC2.jar:"$REPO"/org/aksw/commons/model/0.2-SNAPSHOT/model-0.2-20110917.162637-16.jar:"$REPO"/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.jar:"$REPO"/org/dllearner/interfaces/1.0-SNAPSHOT/interfaces-1.0-SNAPSHOT.jar +EXTRA_JVM_ARGUMENTS="" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"` + [ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"` + [ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"` +fi + +exec "$JAVACMD" $JAVA_OPTS \ + $EXTRA_JVM_ARGUMENTS \ + -classpath "$CLASSPATH" \ + -Dapp.name="CLI-Start" \ + -Dapp.pid="$$" \ + -Dapp.repo="$REPO" \ + -Dbasedir="$BASEDIR" \ + org.dllearner.cli.Start \ + "$@" Added: trunk/interfaces/src/deb-package/dllearner-GUI.sh =================================================================== --- trunk/interfaces/src/deb-package/dllearner-GUI.sh (rev 0) +++ trunk/interfaces/src/deb-package/dllearner-GUI.sh 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,100 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Copyright 2001-2006 The Apache Software Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------- + +# Copyright (c) 2001-2002 The Apache Software Foundation. All rights +# reserved. + +BASEDIR=`dirname $0`/.. +BASEDIR=`(cd "$BASEDIR"; pwd)` + + + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) cygwin=true ;; + Darwin*) darwin=true + if [ -z "$JAVA_VERSION" ] ; then + JAVA_VERSION="CurrentJDK" + else + echo "Using Java version: $JAVA_VERSION" + fi + if [ -z "$JAVA_HOME" ] ; then + JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# If a specific java binary isn't specified search for the standard 'java' binary +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD=`which java` + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." + echo " We cannot execute $JAVACMD" + exit 1 +fi + +if [ -z "$REPO" ] +then + REPO="$BASEDIR"/repo +fi + +CLASSPATH=$CLASSPATH_PREFIX:"$BASEDIR"/etc:"$REPO"/org/dllearner/components-core/1.0-SNAPSHOT/components-core-1.0-SNAPSHOT-jar-with-dependencies.jar:"$REPO"/com/jamonapi/jamon/2.7/jamon-2.7.jar:"$REPO"/org/aksw/commons/sparql/0.2-SNAPSHOT/sparql-0.2-20110917.162637-14.jar:"$REPO"/org/aksw/commons/util/0.2-SNAPSHOT/util-0.2-20110920.143923-15.jar:"$REPO"/org/aksw/commons/collections/0.2-SNAPSHOT/collections-0.2-20110920.143941-14.jar:"$REPO"/org/aksw/commons/collections-scala/0.2-SNAPSHOT/collections-scala-0.2-20110917.162637-13.jar:"$REPO"/com/hp/hpl/jena/jena/2.6.4/jena-2.6.4.jar:"$REPO"/com/hp/hpl/jena/iri/0.8/iri-0.8.jar:"$REPO"/com/ibm/icu/icu4j/3.4.4/icu4j-3.4.4.jar:"$REPO"/xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar:"$REPO"/org/slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar:"$REPO"/log4j/log4j/1.2.16/log4j-1.2.16.jar:"$REPO"/com/hp/hpl/jena/arq/2.8.8/arq-2.8.8.jar:"$REPO"/org/codehaus/woodstox/wstx-asl/3.2.9/wstx-asl-3.2.9.jar:"$REPO"/stax/stax-api/1.0.1/stax-api-1.0.1.jar:"$REPO"/org/apache/lucene/lucene-core/2.9.3/lucene-core-2.9.3.jar:"$REPO"/com/owldl/pellet/2.2.2/pellet-2.2.2.jar:"$REPO"/aterm/aterm-java/1.6/aterm-java-1.6.jar:"$REPO"/xsdlib/xsdlib/20030225/xsdlib-20030225.jar:"$REPO"/relaxngDatatype/relaxngDatatype/20020414/relaxngDatatype-20020414.jar:"$REPO"/org/jgrapht/jgrapht-jdk1.5/0.7.3/jgrapht-jdk1.5-0.7.3.jar:"$REPO"/net/sourceforge/owlapi/owlapi/3.1.0/owlapi-3.1.0.jar:"$REPO"/com/openlink/virtuoso/virtjdbc3/6.1.2/virtjdbc3-6.1.2.jar:"$REPO"/com/openlink/virtuoso/virt_jena/6.1.2/virt_jena-6.1.2.jar:"$REPO"/com/google/guava/guava/r07/guava-r07.jar:"$REPO"/net/sourceforge/collections/collections-generic/4.01/collections-generic-4.01.jar:"$REPO"/com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar:"$REPO"/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar:"$REPO"/com/hp/hpl/jena/sdb/1.3.4/sdb-1.3.4.jar:"$REPO"/com/hp/hpl/jena/tdb/0.8.9/tdb-0.8.9.jar:"$REPO"/com/hp/hpl/jena/arq-extra/2.7.0/arq-extra-2.7.0.jar:"$REPO"/velocity/velocity/1.5/velocity-1.5.jar:"$REPO"/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:"$REPO"/commons-lang/commons-lang/2.4/commons-lang-2.4.jar:"$REPO"/oro/oro/2.0.8/oro-2.0.8.jar:"$REPO"/com/h2database/h2/1.2.143/h2-1.2.143.jar:"$REPO"/org/apache/solr/solr-core/3.3.0/solr-core-3.3.0.jar:"$REPO"/org/apache/solr/solr-solrj/3.3.0/solr-solrj-3.3.0.jar:"$REPO"/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar:"$REPO"/commons-logging/commons-logging/1.0.4/commons-logging-1.0.4.jar:"$REPO"/commons-codec/commons-codec/1.4/commons-codec-1.4.jar:"$REPO"/commons-io/commons-io/1.4/commons-io-1.4.jar:"$REPO"/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar:"$REPO"/org/apache/zookeeper/zookeeper/3.3.1/zookeeper-3.3.1.jar:"$REPO"/jline/jline/0.9.94/jline-0.9.94.jar:"$REPO"/org/apache/solr/solr-noggit/3.3.0/solr-noggit-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-analyzers/3.3.0/lucene-analyzers-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-highlighter/3.3.0/lucene-highlighter-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-memory/3.3.0/lucene-memory-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-queries/3.3.0/lucene-queries-3.3.0.jar:"$REPO"/jakarta-regexp/jakarta-regexp/1.4/jakarta-regexp-1.4.jar:"$REPO"/org/apache/lucene/lucene-misc/3.3.0/lucene-misc-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-spatial/3.3.0/lucene-spatial-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-spellchecker/3.3.0/lucene-spellchecker-3.3.0.jar:"$REPO"/org/apache/lucene/lucene-grouping/3.3.0/lucene-grouping-3.3.0.jar:"$REPO"/org/apache/solr/solr-commons-csv/3.3.0/solr-commons-csv-3.3.0.jar:"$REPO"/commons-fileupload/commons-fileupload/1.2.1/commons-fileupload-1.2.1.jar:"$REPO"/org/apache/velocity/velocity/1.6.4/velocity-1.6.4.jar:"$REPO"/org/apache/velocity/velocity-tools/2.0/velocity-tools-2.0.jar:"$REPO"/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar:"$REPO"/commons-digester/commons-digester/1.8/commons-digester-1.8.jar:"$REPO"/commons-chain/commons-chain/1.1/commons-chain-1.1.jar:"$REPO"/commons-validator/commons-validator/1.3.1/commons-validator-1.3.1.jar:"$REPO"/dom4j/dom4j/1.1/dom4j-1.1.jar:"$REPO"/sslext/sslext/1.2-0/sslext-1.2-0.jar:"$REPO"/org/apache/struts/struts-core/1.3.8/struts-core-1.3.8.jar:"$REPO"/antlr/antlr/2.7.2/antlr-2.7.2.jar:"$REPO"/org/apache/struts/struts-taglib/1.3.8/struts-taglib-1.3.8.jar:"$REPO"/org/apache/struts/struts-tiles/1.3.8/struts-tiles-1.3.8.jar:"$REPO"/org/slf4j/slf4j-jdk14/1.6.1/slf4j-jdk14-1.6.1.jar:"$REPO"/edu/stanford/postagger/3.0.2/postagger-3.0.2.jar:"$REPO"/lbj/library/1.0/library-1.0.jar:"$REPO"/lbj/core/1.0/core-1.0.jar:"$REPO"/lbj/ner/1.0/ner-1.0.jar:"$REPO"/jaws/core/1.0/core-1.0.jar:"$REPO"/uk/ac/shef/wit/simmetrics/1.6.2/simmetrics-1.6.2.jar:"$REPO"/woodstox/wstx-api/3.2.0/wstx-api-3.2.0.jar:"$REPO"/org/apache/opennlp/opennlp-tools/1.5.1-incubating/opennlp-tools-1.5.1-incubating.jar:"$REPO"/org/apache/opennlp/opennlp-maxent/3.0.1-incubating/opennlp-maxent-3.0.1-incubating.jar:"$REPO"/jwnl/jwnl/1.3.3/jwnl-1.3.3.jar:"$REPO"/com/aliasi/lingpipe/4.0.1/lingpipe-4.0.1.jar:"$REPO"/org/annolab/tt4j/org.annolab.tt4j/1.0.14/org.annolab.tt4j-1.0.14.jar:"$REPO"/org/ini4j/ini4j/0.5.2/ini4j-0.5.2.jar:"$REPO"/net/didion/jwnl/jwnl/1.4.1.RC2/jwnl-1.4.1.RC2.jar:"$REPO"/org/aksw/commons/model/0.2-SNAPSHOT/model-0.2-20110917.162637-16.jar:"$REPO"/com/googlecode/json-simple/json-simple/1.1/json-simple-1.1.jar:"$REPO"/org/dllearner/interfaces/1.0-SNAPSHOT/interfaces-1.0-SNAPSHOT.jar +EXTRA_JVM_ARGUMENTS="" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"` + [ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"` + [ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"` +fi + +exec "$JAVACMD" $JAVA_OPTS \ + $EXTRA_JVM_ARGUMENTS \ + -classpath "$CLASSPATH" \ + -Dapp.name="GUI-Start" \ + -Dapp.pid="$$" \ + -Dapp.repo="$REPO" \ + -Dbasedir="$BASEDIR" \ + org.dllearner.gui.StartGUI \ + "$@" Added: trunk/interfaces/src/deb-package/dllearner-cli =================================================================== --- trunk/interfaces/src/deb-package/dllearner-cli (rev 0) +++ trunk/interfaces/src/deb-package/dllearner-cli 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=DL-Learner CLI Start +Name[de]=DL-Learner CLI Start +Comment=This is the start button for the DL-Learner CLI interface +Comment[de]=Das ist die Startdatei für das DL-Learner CLI Interface +Exec=/usr/share/dllearner/dllearner-cli.sh +Icon=dllearner_small +Terminal=true +Type=Application +Categories=Development; +StartupNotify=false Added: trunk/interfaces/src/deb-package/dllearner-gui =================================================================== --- trunk/interfaces/src/deb-package/dllearner-gui (rev 0) +++ trunk/interfaces/src/deb-package/dllearner-gui 2011-09-22 08:12:08 UTC (rev 3282) @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=DL-Learner GUI Start +Name[de]=DL-Learner GUI Start +Comment=This is the start button for the DL-Learner GUI interface +Comment[de]=Das ist die Startdatei für das DL-Learner GUI Interface +Exec=/usr/share/dllearner/dllearner-gui.sh +Icon=dllearner_small +Terminal=true +Type=Application +Categories=Development; +StartupNotify=false This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-10-14 09:40:18
|
Revision: 3304 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3304&view=rev Author: jenslehmann Date: 2011-10-14 09:40:06 +0000 (Fri, 14 Oct 2011) Log Message: ----------- - changed CLI to be more usable programmatically - new sample script Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/AbstractReasonerComponent.java trunk/components-core/src/main/java/org/dllearner/kb/OWLFile.java trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java trunk/scripts/src/main/java/org/dllearner/scripts/Sample.java Modified: trunk/components-core/src/main/java/org/dllearner/core/AbstractReasonerComponent.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AbstractReasonerComponent.java 2011-10-13 20:49:34 UTC (rev 3303) +++ trunk/components-core/src/main/java/org/dllearner/core/AbstractReasonerComponent.java 2011-10-14 09:40:06 UTC (rev 3304) @@ -19,6 +19,7 @@ package org.dllearner.core; +import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.List; @@ -147,6 +148,10 @@ public void setSources(Set<AbstractKnowledgeSource> sources){ this.sources = sources; } + + public void setSources(AbstractKnowledgeSource... sources) { + this.sources = new HashSet<AbstractKnowledgeSource>(Arrays.asList(sources)); + } /** * Method to exchange the reasoner underlying the learning problem. Modified: trunk/components-core/src/main/java/org/dllearner/kb/OWLFile.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/kb/OWLFile.java 2011-10-13 20:49:34 UTC (rev 3303) +++ trunk/components-core/src/main/java/org/dllearner/kb/OWLFile.java 2011-10-14 09:40:06 UTC (rev 3304) @@ -71,6 +71,14 @@ this.url = url; } + public OWLFile(String filename) { + try { + url = new File(filename).toURI().toURL(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } + } + public static Collection<ConfigOption<?>> createConfigOptions() { Collection<ConfigOption<?>> options = new LinkedList<ConfigOption<?>>(); URLConfigOption urlOption = new URLConfigOption("url", "URL pointing to the OWL file", null, true, true); Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-10-13 20:49:34 UTC (rev 3303) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-10-14 09:40:06 UTC (rev 3304) @@ -58,13 +58,57 @@ private static Logger rootLogger = Logger.getRootLogger(); private boolean writeSpringConfiguration = false; + private ApplicationContext context; + + public CLI(File file) throws IOException{ + Resource confFile = new FileSystemResource(file); + + List<Resource> springConfigResources = new ArrayList<Resource>(); - public CLI(){ + //DL-Learner Configuration Object + IConfiguration configuration = new ConfParserConfiguration(confFile); + ApplicationContextBuilder builder = new DefaultApplicationContextBuilder(); + context = builder.buildApplicationContext(configuration,springConfigResources); + + // a lot of debugging stuff +// FastInstanceChecker fi = context.getBean("reasoner", FastInstanceChecker.class); +// System.out.println(fi.getClassHierarchy()); +// NamedClass male = new NamedClass("http://localhost/foo#male"); +// System.out.println(fi.getIndividuals(new NamedClass("http://localhost/foo#male"))); +// System.out.println(fi.getIndividuals().size()); +// System.out.println("has type: " + fi.hasTypeImpl(male, new Individual("http://localhost/foo#bernd"))); +// +// PosNegLPStandard lp = context.getBean("lp", PosNegLPStandard.class); +// System.out.println(lp.getPositiveExamples()); +// System.out.println(lp.getNegativeExamples()); +// System.out.println(lp.getAccuracy(new NamedClass("http://localhost/foo#male"))); + + // get a CLI bean if it exists + CLI cli = null; + if(context.getBeansOfType(CLI.class).size()>0) { + System.out.println(); + cli = context.getBean(CLI.class); + SpringConfigurationXMLBeanConverter converter = new SpringConfigurationXMLBeanConverter(); + XmlObject xml = converter.convert(configuration); + String springFilename = file.getCanonicalPath().replace(".conf", ".xml"); + File springFile = new File(springFilename); + if(springFile.exists()) { + logger.warn("Cannot write Spring configuration, because " + springFilename + " already exists."); + } else { + Files.createFile(springFile, xml.toString()); + } +// SpringConfigurationXMLBeanConverter converter; + } + + // start algorithm in conf file +// LearningAlgorithm algorithm = context.getBean("alg",LearningAlgorithm.class); +// algorithm.start(); } - public void run(ApplicationContext context, String algorithmBeanName){ - AbstractCELA algorithm = context.getBean(algorithmBeanName, AbstractCELA.class); + public void run() { // ApplicationContext context, String algorithmBeanName){ + LearningAlgorithm algorithm = context.getBean(LearningAlgorithm.class); +// LearningAlgorithm algorithm = context.getBean(algorithmBeanName, LearningAlgorithm.class); algorithm.start(); } @@ -101,54 +145,17 @@ // read file and print and print a message if it does not exist File file = new File(args[args.length - 1]); - Resource confFile = new FileSystemResource(args[args.length - 1]); if(!file.exists()) { System.out.println("File \"" + file + "\" does not exist."); System.exit(0); } - List<Resource> springConfigResources = new ArrayList<Resource>(); + CLI cli = new CLI(file); + cli.run(); + } - //DL-Learner Configuration Object - IConfiguration configuration = new ConfParserConfiguration(confFile); - - ApplicationContextBuilder builder = new DefaultApplicationContextBuilder(); - ApplicationContext context = builder.buildApplicationContext(configuration,springConfigResources); - - // a lot of debugging stuff -// FastInstanceChecker fi = context.getBean("reasoner", FastInstanceChecker.class); -// System.out.println(fi.getClassHierarchy()); -// NamedClass male = new NamedClass("http://localhost/foo#male"); -// System.out.println(fi.getIndividuals(new NamedClass("http://localhost/foo#male"))); -// System.out.println(fi.getIndividuals().size()); -// System.out.println("has type: " + fi.hasTypeImpl(male, new Individual("http://localhost/foo#bernd"))); -// -// PosNegLPStandard lp = context.getBean("lp", PosNegLPStandard.class); -// System.out.println(lp.getPositiveExamples()); -// System.out.println(lp.getNegativeExamples()); -// System.out.println(lp.getAccuracy(new NamedClass("http://localhost/foo#male"))); - - // get a CLI bean if it exists - CLI cli = null; - if(context.getBeansOfType(CLI.class).size()>0) { - System.out.println(); - cli = context.getBean(CLI.class); - SpringConfigurationXMLBeanConverter converter = new SpringConfigurationXMLBeanConverter(); - XmlObject xml = converter.convert(configuration); - String springFilename = file.getCanonicalPath().replace(".conf", ".xml"); - File springFile = new File(springFilename); - if(springFile.exists()) { - logger.warn("Cannot write Spring configuration, because " + springFilename + " already exists."); - } else { - Files.createFile(springFile, xml.toString()); - } -// SpringConfigurationXMLBeanConverter converter; - } - - // start algorithm in conf file - LearningAlgorithm algorithm = context.getBean("alg",LearningAlgorithm.class); - algorithm.start(); - + public ApplicationContext getContext() { + return context; } } Modified: trunk/scripts/src/main/java/org/dllearner/scripts/Sample.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/Sample.java 2011-10-13 20:49:34 UTC (rev 3303) +++ trunk/scripts/src/main/java/org/dllearner/scripts/Sample.java 2011-10-14 09:40:06 UTC (rev 3304) @@ -1,5 +1,5 @@ /** - * Copyright (C) 2007-2008, Jens Lehmann + * Copyright (C) 2007-2011, Jens Lehmann * * This file is part of DL-Learner. * @@ -29,18 +29,16 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.SimpleLayout; -import org.dllearner.algorithms.ocel.OCEL; +import org.dllearner.algorithms.celoe.CELOE; import org.dllearner.core.ComponentInitException; -import org.dllearner.core.ComponentManager; import org.dllearner.core.EvaluatedDescription; -import org.dllearner.core.AbstractCELA; -import org.dllearner.core.AbstractLearningProblem; import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.owl.Individual; import org.dllearner.kb.OWLFile; import org.dllearner.learningproblems.EvaluatedDescriptionPosNeg; import org.dllearner.learningproblems.PosNegLPStandard; import org.dllearner.reasoning.FastInstanceChecker; +import org.dllearner.refinementoperators.RhoDRDown; import org.dllearner.utilities.Files; import com.jamonapi.MonitorFactory; @@ -72,22 +70,22 @@ logger.setLevel(Level.DEBUG); // OWL file containing background knowledge - String owlFile = "examples/trains/trains.owl"; + String owlFile = "../examples/trains/trains.owl"; // examples - SortedSet<String> posExamples = new TreeSet<String>(); - posExamples.add("http://example.com/foo#east1"); - posExamples.add("http://example.com/foo#east2"); - posExamples.add("http://example.com/foo#east3"); - posExamples.add("http://example.com/foo#east4"); - posExamples.add("http://example.com/foo#east5"); + SortedSet<Individual> posExamples = new TreeSet<Individual>(); + posExamples.add(new Individual("http://example.com/foo#east1")); + posExamples.add(new Individual("http://example.com/foo#east2")); + posExamples.add(new Individual("http://example.com/foo#east3")); + posExamples.add(new Individual("http://example.com/foo#east4")); + posExamples.add(new Individual("http://example.com/foo#east5")); - SortedSet<String> negExamples = new TreeSet<String>(); - negExamples.add("http://example.com/foo#west6"); - negExamples.add("http://example.com/foo#west7"); - negExamples.add("http://example.com/foo#west8"); - negExamples.add("http://example.com/foo#west9"); - negExamples.add("http://example.com/foo#west10"); + SortedSet<Individual> negExamples = new TreeSet<Individual>(); + negExamples.add(new Individual("http://example.com/foo#west6")); + negExamples.add(new Individual("http://example.com/foo#west7")); + negExamples.add(new Individual("http://example.com/foo#west8")); + negExamples.add(new Individual("http://example.com/foo#west9")); + negExamples.add(new Individual("http://example.com/foo#west10")); List<? extends EvaluatedDescription> results = learn(owlFile, posExamples, negExamples, 5); int x = 0; @@ -103,51 +101,50 @@ Files.createFile(new File("log/jamon_sample.html"), MonitorFactory.getReport()); } - public static List<? extends EvaluatedDescription> learn(String owlFile, SortedSet<String> posExamples, - SortedSet<String> negExamples, int maxNrOfResults) throws ComponentInitException, + public static List<? extends EvaluatedDescription> learn(String owlFile, SortedSet<Individual> posExamples, + SortedSet<Individual> negExamples, int maxNrOfResults) throws ComponentInitException, LearningProblemUnsupportedException { logger.info("Start Learning with"); logger.info("positive examples: \t" + posExamples.size()); logger.info("negative examples: \t" + negExamples.size()); - // the component manager is the central object to create - // and configure components - ComponentManager cm = ComponentManager.getInstance(); - - // knowledge source - //KnowledgeSource ks = cm.knowledgeSource(OWLFile.class); + // use the specified OWL file + OWLFile ks = new OWLFile(owlFile); + ks.init(); - String fileURL = new File(owlFile).toURI().toString(); - OWLFile ks = cm.knowledgeSource(OWLFile.class); - cm.applyConfigEntry(ks, "url", fileURL); + // load file into reasoner + FastInstanceChecker r = new FastInstanceChecker(); + r.setSources(ks); + r.init(); - - // reasoner - AbstractReasonerComponent r = cm.reasoner(FastInstanceChecker.class, ks); - - // learning problem - AbstractLearningProblem lp = cm.learningProblem(PosNegLPStandard.class, r); - cm.applyConfigEntry(lp, "positiveExamples", posExamples); - cm.applyConfigEntry(lp, "negativeExamples", negExamples); - - // learning algorithm - AbstractCELA la = cm.learningAlgorithm(OCEL.class, lp, r); - cm.applyConfigEntry(la, "useAllConstructor", false); - cm.applyConfigEntry(la, "useExistsConstructor", true); - cm.applyConfigEntry(la, "useCardinalityRestrictions", false); - cm.applyConfigEntry(la, "useNegation", false); - cm.applyConfigEntry(la, "writeSearchTree", false); - cm.applyConfigEntry(la, "searchTreeFile", "log/searchTree.txt"); - cm.applyConfigEntry(la, "replaceSearchTree", true); - cm.applyConfigEntry(la, "noisePercentage", 0.0); - - // all components need to be initialised before they can be used - ks.init(); - r.init(); + // configure learning problem + PosNegLPStandard lp = new PosNegLPStandard(); + lp.setReasoner(r); + lp.setPositiveExamples(posExamples); + lp.setNegativeExamples(negExamples); lp.init(); + + // configure target language + RhoDRDown rho = new RhoDRDown(); + rho.setReasoner(r); + rho.setUseAllConstructor(false); + rho.setUseExistsConstructor(true); + rho.setUseNegation(false); + rho.setUseCardinalityRestrictions(false); + rho.init(); + + // configure learning algorithm + CELOE la = new CELOE(); + la.setReasoner(r); + la.setLearningProblem(lp); + la.setWriteSearchTree(false); + la.setSearchTreeFile("log/searchTree.txt"); + la.setReplaceSearchTree(true); + la.setNoisePercentage(20.0); + la.setMaxExecutionTimeInSeconds(2); la.init(); - + // start learning algorithm logger.debug("start learning"); la.start(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-10-20 13:41:57
|
Revision: 3311 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3311&view=rev Author: jenslehmann Date: 2011-10-20 13:41:50 +0000 (Thu, 20 Oct 2011) Log Message: ----------- bug fix Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java trunk/examples/datatypes/stringtyped.conf trunk/examples/nlp2rdf/sample/sample1.conf Added Paths: ----------- trunk/interfaces/src/test/java/org/dllearner/cli/NLP2RDFCLITest.java Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-10-20 05:14:20 UTC (rev 3310) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-10-20 13:41:50 UTC (rev 3311) @@ -30,6 +30,8 @@ import java.util.SortedSet; import java.util.TreeSet; +import javax.sound.midi.SysexMessage; + import org.apache.log4j.Logger; import org.dllearner.core.AbstractCELA; import org.dllearner.core.AbstractLearningProblem; @@ -271,6 +273,8 @@ ((RhoDRDown)operator).setSubHierarchy(classHierarchy); ((RhoDRDown)operator).setReasoner(reasoner); ((RhoDRDown)operator).init(); + } else { + ((RhoDRDown)operator).setSubHierarchy(classHierarchy); } // operator = new RhoDRDown(reasoner, classHierarchy, startClass, configurator); baseURI = reasoner.getBaseURI(); @@ -444,7 +448,8 @@ // for(Description refinement : refinements) { // System.out.println("refinement: " + refinement); // } -// if(loop > 10) { +// if(loop % 100 == 0) { +// System.out.println(getMinimumHorizontalExpansion() + " - " + getMaximumHorizontalExpansion()); // System.exit(0); // } Modified: trunk/examples/datatypes/stringtyped.conf =================================================================== --- trunk/examples/datatypes/stringtyped.conf 2011-10-20 05:14:20 UTC (rev 3310) +++ trunk/examples/datatypes/stringtyped.conf 2011-10-20 13:41:50 UTC (rev 3311) @@ -32,4 +32,5 @@ alg.type = "ocel" alg.searchTreeFile = "log/stringTypedTree.txt" -//alg.writeSearchTree = true; \ No newline at end of file +alg.writeSearchTree = true + Modified: trunk/examples/nlp2rdf/sample/sample1.conf =================================================================== --- trunk/examples/nlp2rdf/sample/sample1.conf 2011-10-20 05:14:20 UTC (rev 3310) +++ trunk/examples/nlp2rdf/sample/sample1.conf 2011-10-20 13:41:50 UTC (rev 3311) @@ -29,7 +29,14 @@ op.useAllConstructor = false op.useCardinalityRestrictions = false op.useHasValueConstructor = true +op.useDataHasValueConstructor = true op.reasoner = reasoner +op.useStringDatatypes = true +op.frequencyThreshold = 1 -alg.type = "ocel" -alg.maxExecutionTimeInSeconds = 500 +alg.type = "celoe" +// alg.maxExecutionTimeInSeconds = 500 +// alg.startClass = "http://nlp2rdf.lod2.eu/schema/sso/Sentence" // does not work => have to tell Spring how it should convert strings to class expressions +alg.writeSearchTree = true +alg.replaceSearchTree = true + Added: trunk/interfaces/src/test/java/org/dllearner/cli/NLP2RDFCLITest.java =================================================================== --- trunk/interfaces/src/test/java/org/dllearner/cli/NLP2RDFCLITest.java (rev 0) +++ trunk/interfaces/src/test/java/org/dllearner/cli/NLP2RDFCLITest.java 2011-10-20 13:41:50 UTC (rev 3311) @@ -0,0 +1,21 @@ +package org.dllearner.cli; + +import java.io.File; +import java.io.IOException; + +import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.ReasonerComponent; +import org.junit.Test; +import org.springframework.context.ApplicationContext; + +public class NLP2RDFCLITest { + + @Test + public void sampleTest() throws IOException { + File f = new File("../examples/nlp2rdf/sample/sample1.conf"); + CLI cli = new CLI(f); + cli.run(); + ApplicationContext context = cli.getContext(); + AbstractReasonerComponent rc = context.getBean(AbstractReasonerComponent.class); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <km...@us...> - 2011-10-26 11:38:22
|
Revision: 3324 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3324&view=rev Author: kmpf Date: 2011-10-26 11:38:13 +0000 (Wed, 26 Oct 2011) Log Message: ----------- Modified Paths: -------------- trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java Added Paths: ----------- trunk/test/pdb/1XFF/ trunk/test/pdb/1XFF/1XFF.A.Alanine.conf trunk/test/pdb/1XFF/1XFF.A.Alanine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Alanine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Arginine.conf trunk/test/pdb/1XFF/1XFF.A.Arginine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Arginine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Asparagine.conf trunk/test/pdb/1XFF/1XFF.A.Asparagine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Asparagine.dll.sol trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.conf trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.dll.sol trunk/test/pdb/1XFF/1XFF.A.Cysteine.conf trunk/test/pdb/1XFF/1XFF.A.Cysteine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Cysteine.dll.sol trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.conf trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.dll.sol trunk/test/pdb/1XFF/1XFF.A.Glutamine.conf trunk/test/pdb/1XFF/1XFF.A.Glutamine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Glutamine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Glycine.conf trunk/test/pdb/1XFF/1XFF.A.Glycine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Glycine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Histidine.conf trunk/test/pdb/1XFF/1XFF.A.Histidine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Histidine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Isoleucine.conf trunk/test/pdb/1XFF/1XFF.A.Isoleucine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Isoleucine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Leucine.conf trunk/test/pdb/1XFF/1XFF.A.Leucine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Leucine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Lysine.conf trunk/test/pdb/1XFF/1XFF.A.Lysine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Lysine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Methionine.conf trunk/test/pdb/1XFF/1XFF.A.Methionine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Methionine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.conf trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Proline.conf trunk/test/pdb/1XFF/1XFF.A.Proline.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Proline.dll.sol trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.conf trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Serine.conf trunk/test/pdb/1XFF/1XFF.A.Serine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Serine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Threonine.conf trunk/test/pdb/1XFF/1XFF.A.Threonine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Threonine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Tryptophan.conf trunk/test/pdb/1XFF/1XFF.A.Tryptophan.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Tryptophan.dll.sol trunk/test/pdb/1XFF/1XFF.A.Tyrosine.conf trunk/test/pdb/1XFF/1XFF.A.Tyrosine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Tyrosine.dll.sol trunk/test/pdb/1XFF/1XFF.A.Valine.conf trunk/test/pdb/1XFF/1XFF.A.Valine.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.Valine.dll.sol trunk/test/pdb/1XFF/1XFF.A.arff trunk/test/pdb/1XFF/1XFF.A.conf trunk/test/pdb/1XFF/1XFF.A.conf.jamon.log.html trunk/test/pdb/1XFF/1XFF.A.dll.sol trunk/test/pdb/1XFF/1XFF.A.fasta trunk/test/pdb/1XFF/1XFF.A.rdf trunk/test/pdb/1XFF.rdf trunk/test/pdb/Escherichia coli.pos Removed Paths: ------------- trunk/test/pdb/1BGP/ trunk/test/pdb/1BTK/ trunk/test/pdb/1BV1/ trunk/test/pdb/1CPC/ trunk/test/pdb/1DKZ/ trunk/test/pdb/1DOK/ trunk/test/pdb/1DOR/ trunk/test/pdb/1DOS/ trunk/test/pdb/1DUP/ trunk/test/pdb/1ECA/ trunk/test/pdb/1ECP/ trunk/test/pdb/1EDM/ trunk/test/pdb/1FMT/ trunk/test/pdb/1FNA/ trunk/test/pdb/1FUA/ trunk/test/pdb/1FUR/ trunk/test/pdb/1FVK/ trunk/test/pdb/1FWC/ trunk/test/pdb/1G3P/ trunk/test/pdb/1GIF/ trunk/test/pdb/1GOT/ trunk/test/pdb/1GSA/ trunk/test/pdb/1GVP/ trunk/test/pdb/1HA1/ trunk/test/pdb/1HAV/ trunk/test/pdb/1HCR/ trunk/test/pdb/1HGX/ trunk/test/pdb/1HSB/ trunk/test/pdb/1IAK/ trunk/test/pdb/1IDA/ trunk/test/pdb/1IIB/ trunk/test/pdb/1ISU/ trunk/test/pdb/1JET/ trunk/test/pdb/1JFR/ trunk/test/pdb/1KPT/ trunk/test/pdb/1KVE/ trunk/test/pdb/1KWA/ trunk/test/pdb/1LAT/ trunk/test/pdb/1LKK/ trunk/test/pdb/1LMB/ trunk/test/pdb/1LTS/ trunk/test/pdb/1LUC/ trunk/test/pdb/1MKA/ trunk/test/pdb/1MLD/ trunk/test/pdb/1MOL/ trunk/test/pdb/1MPG/ trunk/test/pdb/1MRP/ trunk/test/pdb/1MTY/ trunk/test/pdb/1MUC/ trunk/test/pdb/1MUG/ trunk/test/pdb/1NBA/ trunk/test/pdb/1NBC/ trunk/test/pdb/1NCI/ trunk/test/pdb/1NP1/ trunk/test/pdb/1ONR/ trunk/test/pdb/1PNK/ trunk/test/pdb/1POA/ trunk/test/pdb/1QBA/ trunk/test/pdb/1RYP/ trunk/test/pdb/1TCA/ trunk/test/pdb/1VWL/ trunk/test/pdb/1WBA/ trunk/test/pdb/1WPO/ trunk/test/pdb/2BAA/ trunk/test/pdb/2CYP/ trunk/test/pdb/2KIN/ trunk/test/pdb/3CLA/ trunk/test/pdb/3LQH/ trunk/test/pdb/5HPG/ trunk/test/pdb/5P21/ trunk/test/pdb/8ABP/ Modified: trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java 2011-10-26 09:43:32 UTC (rev 3323) +++ trunk/scripts/src/main/java/org/dllearner/examples/pdb/HelixRDFCreator.java 2011-10-26 11:38:13 UTC (rev 3324) @@ -17,14 +17,10 @@ import org.apache.log4j.Level; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; -import org.dllearner.cli.Start; import org.dllearner.core.ComponentInitException; -import org.dllearner.core.ComponentManager; import org.dllearner.core.LearningProblemUnsupportedException; -import org.dllearner.core.ReasonerComponent; -import org.dllearner.core.owl.Description; -import org.dllearner.reasoning.FastInstanceChecker; + import com.hp.hpl.jena.rdf.model.NodeIterator; import com.hp.hpl.jena.rdf.model.Property; import com.hp.hpl.jena.rdf.model.ResIterator; @@ -32,8 +28,6 @@ import com.hp.hpl.jena.rdf.model.ResourceFactory; import com.hp.hpl.jena.rdf.model.Statement; -import com.dumontierlab.pdb2rdf.model.PdbRdfModel; - public class HelixRDFCreator { private static Logger _logger = Logger.getLogger(HelixRDFCreator.class); @@ -107,7 +101,6 @@ * load = true -> load alle .rdf, .conf and .arff Files that can be found within the directory dataDir * load = false -> don't load anything */ - Boolean load = false; Boolean dlLearn = true; Boolean wekaLearn = true; Added: trunk/test/pdb/1XFF/1XFF.A.Alanine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Alanine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Alanine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,26 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A13" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A55" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A57" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A58" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A113" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A128" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A144" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A148" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A195" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A6" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A8" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A31" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A34" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A38" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A70" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A75" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A85" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A155" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A171" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A172" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A190" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A212" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A227" Added: trunk/test/pdb/1XFF/1XFF.A.Alanine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Alanine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Alanine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>124714.0</td><td>0.03969883092515676</td><td>4951.0</td><td>0.3026117352194724</td><td>0.0</td><td>0.0</td><td>45.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:32 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>25268.0</td><td>0.7957891404147538</td><td>20108.0</td><td>10.65673523811086</td><td>0.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:32 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Alanine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Alanine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Alanine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 39.13% + +solution: 1 + description: http://bio2rdf.org/pdb:Alanine + accuracy: 39.13% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Histidine) + accuracy: 39.13% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 39.13% + +solution: 4 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 39.13% + Added: trunk/test/pdb/1XFF/1XFF.A.Arginine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Arginine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Arginine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,23 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A21" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A22" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A26" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A108" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A142" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A147" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A10" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A44" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A46" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A47" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A73" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A114" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A153" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A164" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A173" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A201" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A202" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A216" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A217" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A231" Added: trunk/test/pdb/1XFF/1XFF.A.Arginine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Arginine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Arginine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>68868.0</td><td>0.0421676250217808</td><td>2904.0</td><td>0.3445925586755652</td><td>0.0</td><td>0.0</td><td>45.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:15 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>13942.0</td><td>0.4589011619566777</td><td>6398.0</td><td>7.715718449680175</td><td>0.0</td><td>0.0</td><td>401.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:15 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Arginine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Arginine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Arginine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 30% + +solution: 1 + description: http://bio2rdf.org/pdb:Arginine + accuracy: 30% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Histidine) + accuracy: 30% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 30% + +solution: 4 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 30% + Added: trunk/test/pdb/1XFF/1XFF.A.Asparagine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Asparagine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Asparagine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,10 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A103" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A132" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A84" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A98" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A187" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A220" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A237" Added: trunk/test/pdb/1XFF/1XFF.A.Asparagine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Asparagine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Asparagine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>488921.0</td><td>0.03930082774108701</td><td>19215.0</td><td>0.32167796497955703</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:35 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>106249.0</td><td>0.5368991708157254</td><td>57045.0</td><td>8.729401295659214</td><td>1.0</td><td>0.0</td><td>529.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:35 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Asparagine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Asparagine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Asparagine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 28.571% + +solution: 1 + description: http://bio2rdf.org/pdb:Asparagine + accuracy: 28.571% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Histidine) + accuracy: 28.571% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 28.571% + +solution: 4 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 28.571% + Added: trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,13 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A123" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A192" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A11" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A29" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A37" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A162" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A167" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A210" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A223" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A233" Added: trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>155838.0</td><td>0.03821917632413147</td><td>5956.0</td><td>0.31010794022520033</td><td>0.0</td><td>0.0</td><td>51.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:34 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>30686.0</td><td>0.6794303591214235</td><td>20849.0</td><td>9.799920449479227</td><td>1.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:34 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.AsparticAcid.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 20% + +solution: 1 + description: http://bio2rdf.org/pdb:AsparticAcid + accuracy: 20% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Histidine) + accuracy: 20% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 20% + +solution: 4 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 20% + Added: trunk/test/pdb/1XFF/1XFF.A.Cysteine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Cysteine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Cysteine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,4 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A1" Added: trunk/test/pdb/1XFF/1XFF.A.Cysteine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Cysteine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Cysteine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>369090.0</td><td>0.04132054512449538</td><td>15251.0</td><td>0.3512727089839151</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:15 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>80204.0</td><td>0.5631888683856167</td><td>45170.0</td><td>8.821118760656532</td><td>0.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:15 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Cysteine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Cysteine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Cysteine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: http://bio2rdf.org/pdb:Leucine + accuracy: 100% + +solution: 1 + description: http://bio2rdf.org/pdb:Isoleucine + accuracy: 100% + +solution: 2 + description: http://bio2rdf.org/pdb:Histidine + accuracy: 100% + +solution: 3 + description: http://bio2rdf.org/pdb:Glycine + accuracy: 100% + +solution: 4 + description: http://bio2rdf.org/pdb:Glutamine + accuracy: 100% + Added: trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,26 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A14" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A18" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A59" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A60" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A105" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A109" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A110" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A125" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A134" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A143" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A24" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A39" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A79" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A82" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A91" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A102" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A121" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A186" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A207" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A208" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A213" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A228" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A235" Added: trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>421411.0</td><td>0.04067050931276118</td><td>17139.0</td><td>0.33925571539518223</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:19 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>90407.0</td><td>0.5150043691307089</td><td>46560.0</td><td>8.438411803116043</td><td>3.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:19 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.GlutamicAcid.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 43.478% + +solution: 1 + description: http://bio2rdf.org/pdb:GlutamicAcid + accuracy: 43.478% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Histidine) + accuracy: 43.478% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 43.478% + +solution: 4 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 43.478% + Added: trunk/test/pdb/1XFF/1XFF.A.Glutamine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Glutamine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Glutamine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,10 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A52" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A56" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A151" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A193" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A9" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A137" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A232" Added: trunk/test/pdb/1XFF/1XFF.A.Glutamine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Glutamine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Glutamine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>452706.0</td><td>0.03980508321073721</td><td>18020.0</td><td>0.33037844252946563</td><td>1.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:22 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>95853.0</td><td>0.4950497115374584</td><td>47452.0</td><td>8.269894442023512</td><td>1.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:22 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Glutamine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Glutamine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Glutamine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 57.143% + +solution: 1 + description: http://bio2rdf.org/pdb:Glutamine + accuracy: 57.143% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Histidine) + accuracy: 57.143% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 57.143% + +solution: 4 + description: (not http://bio2rdf.org/pdb:GlutamicAcid) + accuracy: 57.143% + Added: trunk/test/pdb/1XFF/1XFF.A.Glycine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Glycine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Glycine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,26 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A19" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A2" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A5" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A27" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A32" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A40" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A49" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A65" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A66" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A68" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A78" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A99" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A115" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A138" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A139" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A154" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A157" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A175" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A181" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A183" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A185" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A209" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A226" Added: trunk/test/pdb/1XFF/1XFF.A.Glycine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Glycine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Glycine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>47346.0</td><td>0.04076373928103747</td><td>1930.0</td><td>0.3512518830942915</td><td>0.0</td><td>0.0</td><td>45.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:09 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>9850.0</td><td>0.1565482233502538</td><td>1542.0</td><td>4.7821948959769855</td><td>1.0</td><td>0.0</td><td>344.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:09 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Glycine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Glycine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Glycine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 4.348% + +solution: 1 + description: http://bio2rdf.org/pdb:Glycine + accuracy: 4.348% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Histidine) + accuracy: 4.348% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 4.348% + +solution: 4 + description: (not http://bio2rdf.org/pdb:GlutamicAcid) + accuracy: 4.348% + Added: trunk/test/pdb/1XFF/1XFF.A.Histidine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Histidine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Histidine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,15 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A104" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A129" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A41" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A61" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A64" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A71" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A77" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A86" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A88" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A92" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A97" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A165" Added: trunk/test/pdb/1XFF/1XFF.A.Histidine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Histidine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Histidine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>303294.0</td><td>0.03681246579226757</td><td>11165.0</td><td>0.361941980809781</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:50 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>59175.0</td><td>0.4749302915082383</td><td>28104.0</td><td>7.9202651840828</td><td>16.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:50 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Histidine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Histidine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Histidine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 16.667% + +solution: 1 + description: http://bio2rdf.org/pdb:Histidine + accuracy: 16.667% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 16.667% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 16.667% + +solution: 4 + description: (not http://bio2rdf.org/pdb:GlutamicAcid) + accuracy: 16.667% + Added: trunk/test/pdb/1XFF/1XFF.A.Isoleucine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Isoleucine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Isoleucine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A15" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A127" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A3" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A7" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A69" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A93" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A100" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A101" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A149" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A160" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A180" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A189" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A204" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A211" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A214" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A221" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A234" Added: trunk/test/pdb/1XFF/1XFF.A.Isoleucine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Isoleucine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Isoleucine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>274515.0</td><td>0.03695608618836858</td><td>10145.0</td><td>0.3604806609907787</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:47 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>54062.0</td><td>0.505438200584514</td><td>27325.0</td><td>8.158675793216828</td><td>4.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:47 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Isoleucine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Isoleucine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Isoleucine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 11.765% + +solution: 1 + description: http://bio2rdf.org/pdb:Isoleucine + accuracy: 11.765% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 11.765% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 11.765% + +solution: 4 + description: (not http://bio2rdf.org/pdb:GlutamicAcid) + accuracy: 11.765% + Added: trunk/test/pdb/1XFF/1XFF.A.Leucine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Leucine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Leucine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,28 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A16" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A17" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A20" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A23" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A54" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A107" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A111" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A130" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A135" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A141" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A146" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A194" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A33" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A45" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A48" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A63" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A152" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A169" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A170" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A178" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A182" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A196" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A197" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A206" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A238" Added: trunk/test/pdb/1XFF/1XFF.A.Leucine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Leucine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Leucine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>335999.0</td><td>0.04201500599704166</td><td>14117.0</td><td>0.3615366327756158</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:11 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>70735.0</td><td>0.6197780448151552</td><td>43840.0</td><td>9.255043070818324</td><td>1.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:11 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Leucine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Leucine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Leucine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 48% + +solution: 1 + description: http://bio2rdf.org/pdb:Leucine + accuracy: 48% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 48% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 48% + +solution: 4 + description: (not http://bio2rdf.org/pdb:GlutamicAcid) + accuracy: 48% + Added: trunk/test/pdb/1XFF/1XFF.A.Lysine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Lysine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Lysine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,8 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A50" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A112" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A136" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A224" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A230" Added: trunk/test/pdb/1XFF/1XFF.A.Lysine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Lysine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Lysine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>218715.0</td><td>0.03602862172233272</td><td>7880.0</td><td>0.33605550602578027</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:41 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>41743.0</td><td>0.5882902522578636</td><td>24557.0</td><td>8.94018147551723</td><td>0.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:41 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Lysine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Lysine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Lysine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 60% + +solution: 1 + description: http://bio2rdf.org/pdb:Lysine + accuracy: 60% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 60% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 60% + +solution: 4 + description: (not http://bio2rdf.org/pdb:GlutamicAcid) + accuracy: 60% + Added: trunk/test/pdb/1XFF/1XFF.A.Methionine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Methionine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Methionine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,7 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A53" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A42" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A161" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A184" Added: trunk/test/pdb/1XFF/1XFF.A.Methionine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Methionine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Methionine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>396729.0</td><td>0.040392812221944956</td><td>16025.0</td><td>0.34172280900163604</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:17 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>85312.0</td><td>0.5383298949737434</td><td>45926.0</td><td>8.63622664710604</td><td>3.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:17 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Methionine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Methionine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Methionine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 25% + +solution: 1 + description: http://bio2rdf.org/pdb:Methionine + accuracy: 25% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 25% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 25% + +solution: 4 + description: (not http://bio2rdf.org/pdb:GlutamicAcid) + accuracy: 25% + Added: trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,8 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A118" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A188" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A203" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A205" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A222" Added: trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>307702.0</td><td>0.03699033480445366</td><td>11382.0</td><td>0.36036509736687183</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:55 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>63808.0</td><td>0.5118793881644935</td><td>32662.0</td><td>8.281475452315586</td><td>0.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:56 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Phenylalanine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: http://bio2rdf.org/pdb:Isoleucine + accuracy: 100% + +solution: 1 + description: http://bio2rdf.org/pdb:Histidine + accuracy: 100% + +solution: 2 + description: http://bio2rdf.org/pdb:Glycine + accuracy: 100% + +solution: 3 + description: http://bio2rdf.org/pdb:Glutamine + accuracy: 100% + +solution: 4 + description: http://bio2rdf.org/pdb:GlutamicAcid + accuracy: 100% + Added: trunk/test/pdb/1XFF/1XFF.A.Proline.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Proline.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Proline.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,11 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A106" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A150" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A62" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A80" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A87" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A166" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A177" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A198" Added: trunk/test/pdb/1XFF/1XFF.A.Proline.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Proline.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Proline.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>23817.0</td><td>0.036108661880169625</td><td>860.0</td><td>0.3321170773327638</td><td>0.0</td><td>0.0</td><td>34.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:06 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>4967.0</td><td>0.16529092007247836</td><td>821.0</td><td>4.951543207510954</td><td>5.0</td><td>0.0</td><td>344.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:06 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Proline.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Proline.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Proline.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: 25% + +solution: 1 + description: http://bio2rdf.org/pdb:Proline + accuracy: 25% + +solution: 2 + description: (not http://bio2rdf.org/pdb:Glycine) + accuracy: 25% + +solution: 3 + description: (not http://bio2rdf.org/pdb:Glutamine) + accuracy: 25% + +solution: 4 + description: (not http://bio2rdf.org/pdb:GlutamicAcid) + accuracy: 25% + Added: trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,3 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + Added: trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>220647.0</td><td>0.03596695173739049</td><td>7936.0</td><td>0.3349497294539293</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:43 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>43852.0</td><td>0.5909422603302016</td><td>25914.0</td><td>8.809421095120069</td><td>0.0</td><td>0.0</td><td>507.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:29:43 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Selenomethionine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: Thing + accuracy: �% + +solution: 1 + description: http://bio2rdf.org/pdb:Histidine + accuracy: �% + +solution: 2 + description: http://bio2rdf.org/pdb:Glycine + accuracy: �% + +solution: 3 + description: http://bio2rdf.org/pdb:Glutamine + accuracy: �% + +solution: 4 + description: http://bio2rdf.org/pdb:GlutamicAcid + accuracy: �% + Added: trunk/test/pdb/1XFF/1XFF.A.Serine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Serine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Serine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,13 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A30" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A81" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A90" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A120" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A163" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A174" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A176" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A191" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A218" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A236" Added: trunk/test/pdb/1XFF/1XFF.A.Serine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Serine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Serine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</th><th>Total</th><th>StdDev</th><th>LastValue</th><th>Min</th><th>Max</th><th>Active</th><th>AvgActive</th><th>MaxActive</th><th>FirstAccess</th><th>LastAccess</th><th>Enabled</th><th>Primary</th><th>HasListeners</th><th>Label</th> +<tr><td>addNode, ms.</td><td>457211.0</td><td>0.04011933221204214</td><td>18343.0</td><td>0.3297577376588546</td><td>0.0</td><td>0.0</td><td>62.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:32 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>addNode, ms.</td></tr> +<tr><td>refineNode, ms.</td><td>100732.0</td><td>0.5586407497121074</td><td>56273.0</td><td>8.925655045785778</td><td>0.0</td><td>0.0</td><td>529.0</td><td>0.0</td><td>1.0</td><td>1.0</td><td>Wed Oct 26 13:29:04 CEST 2011</td><td>Wed Oct 26 13:30:33 CEST 2011</td><td>true</td><td>false</td><td>false</td><td>refineNode, ms.</td></tr> +</table> \ No newline at end of file Added: trunk/test/pdb/1XFF/1XFF.A.Serine.dll.sol =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Serine.dll.sol (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Serine.dll.sol 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,20 @@ +solution: 0 + description: http://bio2rdf.org/pdb:Isoleucine + accuracy: 100% + +solution: 1 + description: http://bio2rdf.org/pdb:Histidine + accuracy: 100% + +solution: 2 + description: http://bio2rdf.org/pdb:Glycine + accuracy: 100% + +solution: 3 + description: http://bio2rdf.org/pdb:Glutamine + accuracy: 100% + +solution: 4 + description: http://bio2rdf.org/pdb:GlutamicAcid + accuracy: 100% + Added: trunk/test/pdb/1XFF/1XFF.A.Threonine.conf =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Threonine.conf (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Threonine.conf 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,16 @@ +import("../AA_properties.owl"); +import("1XFF.A.rdf"); + ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A124" ++"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A140" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A43" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A67" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A72" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A76" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A117" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A122" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A158" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A168" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A200" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A215" +-"http://bio2rdf.org/pdb:1XFF/chemicalComponent_A225" Added: trunk/test/pdb/1XFF/1XFF.A.Threonine.conf.jamon.log.html =================================================================== --- trunk/test/pdb/1XFF/1XFF.A.Threonine.conf.jamon.log.html (rev 0) +++ trunk/test/pdb/1XFF/1XFF.A.Threonine.conf.jamon.log.html 2011-10-26 11:38:13 UTC (rev 3324) @@ -0,0 +1,6 @@ + +<table border='1' rules='all'> +<th>Label</th><th>Hits</th><th>Avg</... [truncated message content] |
From: <jen...@us...> - 2011-11-01 18:59:41
|
Revision: 3353 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3353&view=rev Author: jenslehmann Date: 2011-11-01 18:59:35 +0000 (Tue, 01 Nov 2011) Log Message: ----------- wrote unit test to reproduce and narrow down bug in NLP2RDF example Modified Paths: -------------- trunk/examples/father.conf trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf Added Paths: ----------- trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java Added: trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java (rev 0) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java 2011-11-01 18:59:35 UTC (rev 3353) @@ -0,0 +1,67 @@ +/** + * Copyright (C) 2007-2011, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +package org.dllearner.test.junit; + +import static org.junit.Assert.*; + +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.owl.Individual; +import org.dllearner.core.owl.Intersection; +import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.core.owl.ObjectSomeRestriction; +import org.dllearner.core.owl.Thing; +import org.dllearner.kb.OWLFile; +import org.dllearner.reasoning.FastInstanceChecker; +import org.junit.Test; + +/** + * + * @author Jens Lehmann + * + */ +public class ReasonerTest { + + @Test + public void nlp2rdfTest() throws ComponentInitException { + // read file into reasoner + OWLFile file = new OWLFile("../examples/nlp2rdf/reuters_gold_vs_copper/positives.owl"); + file.init(); + FastInstanceChecker fic = new FastInstanceChecker(); + fic.setSources(file); + fic.init(); + + NamedClass doc = new NamedClass("http://nlp2rdf.lod2.eu/schema/string/Document"); + ObjectProperty op = new ObjectProperty("http://nlp2rdf.lod2.eu/schema/string/subStringTrans"); + ObjectSomeRestriction osr = new ObjectSomeRestriction(op,Thing.instance); + Intersection is = new Intersection(doc,osr); + + Individual ind = new Individual("http://nlp2rdf.org/POS/2/offset_0_763_COPPER+STUDY+GROUP+C"); + + // there should be several subStringTrans relations + assertFalse(fic.getRelatedIndividuals(ind, op).isEmpty()); + // individual should be member of this expression (required to learn the correct concept) + assertTrue(fic.hasType(is, ind)); + + // TODO: once this works, we need to make sure that "positives.owl" is in a "stable" directory + + } + +} Modified: trunk/examples/father.conf =================================================================== --- trunk/examples/father.conf 2011-11-01 16:01:42 UTC (rev 3352) +++ trunk/examples/father.conf 2011-11-01 18:59:35 UTC (rev 3353) @@ -16,7 +16,7 @@ // reasoner reasoner.type = "fast instance checker" -reasoner.sources = { ks } +reasoner.sources = { ks2 } // learning problem lp.type = "posNegStandard" @@ -25,3 +25,4 @@ // create learning algorithm to run alg.type = "ocel" + Modified: trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf =================================================================== --- trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-01 16:01:42 UTC (rev 3352) +++ trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-01 18:59:35 UTC (rev 3353) @@ -1,5 +1,10 @@ lp.positiveExamples = { -"http://nlp2rdf.org/POS/4/offset_0_837_TOTAL+U.S.+COPPER+ST","http://nlp2rdf.org/POS/6/offset_0_763_U.S.+REFINERY+COPPER","http://nlp2rdf.org/POS/3/offset_0_201_MAGMA+LOWERS+COPPER+","http://nlp2rdf.org/POS/2/offset_0_763_COPPER+STUDY+GROUP+C","http://nlp2rdf.org/POS/1/offset_0_840_COPPER+STOCKS+OUTSID","http://nlp2rdf.org/POS/5/offset_0_690_U.S.+BRASS+MILL+COPP" +"http://nlp2rdf.org/POS/4/offset_0_837_TOTAL+U.S.+COPPER+ST", +"http://nlp2rdf.org/POS/6/offset_0_763_U.S.+REFINERY+COPPER", +"http://nlp2rdf.org/POS/3/offset_0_201_MAGMA+LOWERS+COPPER+", +"http://nlp2rdf.org/POS/2/offset_0_763_COPPER+STUDY+GROUP+C", +"http://nlp2rdf.org/POS/1/offset_0_840_COPPER+STOCKS+OUTSID", +"http://nlp2rdf.org/POS/5/offset_0_690_U.S.+BRASS+MILL+COPP" } lp.negativeExamples = { "http://nlp2rdf.org/NEG/7/offset_0_691_CURRENCIES+COULD+INF","http://nlp2rdf.org/NEG/10/offset_0_847_REAGAN%27S+REMARKS+HEL","http://nlp2rdf.org/NEG/2/offset_0_1254_BELGIAN+ECU+COIN+ISS","http://nlp2rdf.org/NEG/6/offset_0_1657_CONSOLIDATED+TVX+TO+","http://nlp2rdf.org/NEG/9/offset_0_592_MORE+GOLD+DETECTED+A","http://nlp2rdf.org/NEG/3/offset_0_1754_BHP+TO+FLOAT+GOLD+UN","http://nlp2rdf.org/NEG/4/offset_0_1280_BLACK+MINERS+SUPPORT","http://nlp2rdf.org/NEG/1/offset_0_587_AMAX+%3CAMX%3E+IN+GOLD%2C+","http://nlp2rdf.org/NEG/8/offset_0_624_LAC+%3CLAC%3E+INTERSECTS","http://nlp2rdf.org/NEG/5/offset_0_621_CHINA%27S+HEILONGJIANG" @@ -28,4 +33,11 @@ op.useStringDatatypes = true //op.frequencyThreshold = 1 alg.type = "celoe" +alg.writeSearchTree = true +alg.replaceSearchTree = true +alg.maxExecutionTimeInSeconds = 100 +alg.maxNrOfResults = 100 + + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-02 08:43:52
|
Revision: 3357 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3357&view=rev Author: jenslehmann Date: 2011-11-02 08:43:43 +0000 (Wed, 02 Nov 2011) Log Message: ----------- improved reasoner unit test Modified Paths: -------------- trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java trunk/examples/father.conf trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf Added Paths: ----------- trunk/components-core/src/test/resources/nlp2rdf/ trunk/components-core/src/test/resources/nlp2rdf/positives.owl trunk/components-core/src/test/resources/nlp2rdf/sso.owl trunk/components-core/src/test/resources/nlp2rdf/string.owl Modified: trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java 2011-11-02 08:35:44 UTC (rev 3356) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/ReasonerTest.java 2011-11-02 08:43:43 UTC (rev 3357) @@ -42,7 +42,7 @@ @Test public void nlp2rdfTest() throws ComponentInitException { // read file into reasoner - OWLFile file = new OWLFile("../examples/nlp2rdf/reuters_gold_vs_copper/positives.owl"); + OWLFile file = new OWLFile("src/test/resources/nlp2rdf/positives.owl"); file.init(); FastInstanceChecker fic = new FastInstanceChecker(); fic.setSources(file); @@ -55,13 +55,13 @@ Individual ind = new Individual("http://nlp2rdf.org/POS/2/offset_0_763_COPPER+STUDY+GROUP+C"); +// System.out.println(); + // there should be several subStringTrans relations assertFalse(fic.getRelatedIndividuals(ind, op).isEmpty()); // individual should be member of this expression (required to learn the correct concept) assertTrue(fic.hasType(is, ind)); - - // TODO: once this works, we need to make sure that "positives.owl" is in a "stable" directory - + } } Added: trunk/components-core/src/test/resources/nlp2rdf/positives.owl =================================================================== --- trunk/components-core/src/test/resources/nlp2rdf/positives.owl (rev 0) +++ trunk/components-core/src/test/resources/nlp2rdf/positives.owl 2011-11-02 08:43:43 UTC (rev 3357) @@ -0,0 +1,25676 @@ +<rdf:RDF + xmlns:j.0="http://purl.org/olia/stanford.owl#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:j.1="http://purl.org/olia/penn-syntax.owl#" + xmlns:str="http://nlp2rdf.lod2.eu/schema/string/" + xmlns:j.2="http://purl.org/olia/system.owl#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xmlns:sso="http://nlp2rdf.lod2.eu/schema/sso/" + xmlns:j.3="http://purl.org/olia/olia.owl#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns:j.4="http://purl.org/olia/penn.owl#" + xmlns:j.5="http://purl.org/olia/olia-top.owl#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> + <owl:Ontology rdf:about="file://something/positives"> + <owl:imports rdf:resource="string.owl"/> + <owl:imports rdf:resource="sso.owl"/> + </owl:Ontology> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Residual"> + <rdfs:comment> + The residual value (R) is assigned to classes of text words which lie outside the + traditionally accepted range of grammatical classes, although they occur quite + commonly in many texts and very commonly in some. For example: foreign words, + or mathematical formulae. It can be argued that these are on the fringes of the + grammar or lexicon of the language in which the text is written. Nevertheless, + they need to be tagged. (http://www.ilc.cnr.it/EAGLES96/annotate/node16.html#mr 19.09.06) + + Although words in the Residual category are on the periphery of the lexicon, they may + take some of the grammatical characteristics, e.g., of nouns. Acronyms such as IBM are + similar to proper nouns; symbols such as alphabetic characters can vary for singular and + plural (e.g. How many Ps are there in `psychopath'?), and are in this respect like common + nouns. In some languages (e.g. Portuguese) such symbols also have gender. It is quite + reasonable that in some tagging schemes some of these classes of word will be classified + under other parts of speech. (The Unclassified category applies to word-like text segments + which do not easily fit into any of the foregoing values. For example: incomplete words + and pause fillers such as er and erm in transcriptions of speech, or written representations of singing such as dum-de-dum. (http://www.ilc.cnr.it/EAGLES96/annotate/node17.html#recr 19.09.06)</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Conjunction"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + </rdfs:subClassOf> + <rdfs:comment> + A conjunction is a word that syntactically links words or larger constituents, + and expresses a semantic relationship between them. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAConjunction.htm 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#LinguisticConcept"> + <rdfs:comment>The OLiA ontology specifies linguistic concepts on a theoretical basis, as for concepts used in annotations, see system.owl. +There is a great extent of overlap between LinguisticCategories/LinguisticFeatures and Categories/Features as defined in system.owl.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://www.w3.org/2002/07/owl#Thing"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#VerbPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#VerbPhrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:comment>VP|Verb phrase. Phrasal category headed a verb. +(Santorini 1991) + +VP — Verb Phrase. Phrasal category headed a verb. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#PrepositionalPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PrepositionalPhrase"/> + </rdfs:subClassOf> + <rdfs:comment>PP|Prepositional_phrase. Phrasal_category_headed_by_a_preposition. +(Santorini 1991) + +PP — Prepositional Phrase. Phrasal category headed by a preposition. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#WHDeterminer"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Determiner"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#TenseFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </rdfs:subClassOf> + <rdfs:comment>Tense is a grammatical category, typically marked on the verb, that deictically refers to the time of the event or state denoted by the verb in relation to some other temporal reference point. (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsTense.htm 17.11.06)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#CardinalNumber"> + <rdfs:comment> + A cardinal numeral is a numeral of the class whose members are considered basic + in form, used in counting, and used in expressing how many objects are referred to. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsACardinalNumeral.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Numeral"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/system.owl#LinguisticAnnotation"> + <rdfs:comment>Linguistic annotations pertain to either structural entities (words, tokens, constituents, sentences => UnitOfAnnotation), relations between these (dependency, dominance, coreference, etc. => Relation), or grammatical features attached to these (case, gender, number, agreement, tense, mood, aspect, ... => Feature).</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AuxiliaryVerb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment> + An auxiliary verb is a verb which accompanies the lexical verb of a verb phrase, + and expresses grammatical distinctions not carried by the lexical verb, such as + person, number, tense aspect, and voice. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAnAuxiliaryVerb.htm 19.09.06) + + Besides modal verbs ("semiauxiliary") and "strict" auxiliary verbs, also copulas + are classified under auxiliary verbs here, as this is a praxis applied in practically every + EAGLES-conformant morphosyntactic annotation scheme. + + Part of speech referring to the set of verbs, subordinate to the main lexical verb which help + to make distinction in mood, aspect, voice etc. + (Crystal 2003; http://www.isocat.org/datcat/DC-1244) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#CardinalNumber"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#CardinalNumber"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:comment>These are cardinal numbers.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#DegreeFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </rdfs:subClassOf> + <rdfs:comment>The Eagles-recommended attribute Degree applies only to inflectional comparatives and superlatives. In some languages, e.g. Spanish, the number of such adjectives is very small. (http://www.ilc.cnr.it/EAGLES96/annotate/node17.html#recn)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#To"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:comment>"To" is tagged TO, regardless of whether it is a preposition or an infinitival marker.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Word"> + <rdfs:label>word</rdfs:label> + <rdfs:comment> + SyntacticWord is the class of syntactic units occupying the lowest position in + a syntactic construction. They are the largest units resistant to insertion of + new constituents within their boundaries; or they are the smallest constituents + that can be moved within a sentence without making the sentence ungrammatical. + (http://www.linguistics-ontology.org/gold/2008/SyntacticWord) + + Linguistic unit composed of at least a part of speech and a lemma. + (Gil Francopoulo; http://www.isocat.org/datcat/DC-1415) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NonFiniteVerb"> + <rdfs:comment> + Verb forms occurring on their own only in dependent clauses and lacking tense and mood contrasts. + (adapted from Crystal 2003; http://www.isocat.org/datcat/DC-1332) + + A non-finite verb is a verb that is not fully inflected for categories that are marked inflectionally in a language, + such as the following: Tense, Aspect, Modality, Number, Person. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsANonfiniteVerb.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Verb"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Conjunction"> + <rdfs:comment>This class was inserted to reflect the tag structure. It does not, + however, exactly correspond to olia:Conjunction, because Penn conjunction + tags can also be applied to prepositions.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#CoordinatingConjunction"> + <rdfs:comment> + Coordinating conjunctions, also called coordinators, are conjunctions that + join two items of equal syntactic importance. + (http://en.wikipedia.org/wiki/Grammatical_conjunction 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Conjunction"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PrepositionalPhrase"> + <rdfs:comment> + A sequence of a preposition and its complement is a prepositional phrase. The complement of a preposition is usually + a noun phrase (see examples 38 to 40), but may also be a clause or an adverb phrase. According to the categories + recommended here, a prepositional phrase may be analysed further into preposition and noun phrase. The examples + below demonstrate how this further analysis can be a recursive procedure. + + (38) [PP en [NP sustitucion [PP de [NP los canales correspondientes [PP de [NP 50 baudios NP] PP] NP] PP] NP] PP]. + (39) [NP Fairbanks NP] [VP hummed [NP a few bars NP] VP] [PP in [NP a voice [VP made resonant + [PP by [NP the very weakness [PP of [NP his chest NP] PP] NP] PP] VP] NP] PP]. + (40) [PP En [NP el caso [PP de [NP un sistema mixto [PP en [NP el + [CL que [VP se utilicen [NP canales [PP con [NP tres velocidades + [PP de [NP modulacion NP] PP] diferentes NP] PP] NP] VP] CL] NP] PP] NP] PP] NP] PP] + + In a language such as Spanish, where a large proportion of the modification of nouns takes the form of a following + preposition de and another noun, this recursion is extremely prevalent, as in 40. In cases where the prepositional + phrase is complemented by a one word noun phrase, it may be advantageous to leave the analysis at this point, rather + than continuing to analyse further by enclosing the complement (see also one-word constituents). + + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node34.html#SECTION00052500000000000000) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounHeadedPhrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PastParticiple"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Participle"/> + </rdfs:subClassOf> + <rdfs:comment>This is a verb in past participle.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#NounPhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounPhrase"/> + </rdfs:subClassOf> + <rdfs:comment>NP|Noun phrase. Phrasal category that includes all constituents that depend on a head noun. +(Santorini 1991) + +NP — Noun Phrase. Phrasal category that includes all constituents that depend on a head noun. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/system.owl#UnitOfAnnotation"> + <rdfs:comment>A UnitOfAnnotation is a structural entity that can be annotated, e.g., a word, token, constituent, or another types of markable. +Word classes, etc., are then modelled as indirect children of UnitOfAnnotation. The division between Features and classes of UnitsOfAnnotation follows conventional standards. + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/system.owl#LinguisticAnnotation"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Present"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AbsoluteTense"/> + </rdfs:subClassOf> + <rdfs:comment> + Present tense refers to the moment of utterance. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#presentTense) + + Present tense refers to the moment of utterance. + It often refers to events or states that do not merely coincide + with the moment of utterance, such as those that are continuous, + habitual, or lawlike. + (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsPresentTense.htm 17.11.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Plural"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#NumberFeature"/> + </rdfs:subClassOf> + <rdfs:comment> + Plural is a grammatical number, typically referring to more than one of + the referent in the real world. In English, nouns, pronouns, and demonstratives + inflect for plurality. In many other languages, for example German and the + various Romance languages, articles and adjectives also inflect for plurality. + (http://en.wikipedia.org/wiki/Plural 17.11.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#GerundOrPresentParticiple"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ing"/> + </rdfs:subClassOf> + <rdfs:comment>This is a verb in present participle or in gerund.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Pronoun"> + <rdfs:comment>This is a class, we inserted to structure the tagset.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Pronoun"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Clause"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SyntaxTag"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Clause"/> + </rdfs:subClassOf> + <rdfs:comment>We distinguish among a number of basic clause types: S, SINV, SBAR, RRC, SBARQ, SQ, S-CLF, it-extraposition, and FRAG. +(Bies et al. 1995) + +S-CLF is @cat="S" & edge/@func="CLF", so see under ItCleft</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#Constituent"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"/> + </rdfs:subClassOf> + <rdfs:comment> + Constituents correspond to a GOLD SyntacticConstruction: + SyntacticConstruction is the class of grammar units that + have syntactic structure, i.e., consisting of more than + one syntactic word or construction in a syntactic + configuration. [Crystal 1980, 85-86]. + (http://www.linguistics-ontology.org/gold/2008) + + Corresponds to units of annotation in the EAGLES recommendations for syntactic annotation + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node29.html#SECTION00052000000000000000) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#NumberFeature"> + <rdfs:comment> + Grammatical category for the variation in form of nouns, pronouns, and any words agreeing + with them, depending on how many persons or things are referred to. + (www.wordreference.com/English/definition.asp?en=number 12; http://www.isocat.org/datcat/DC-1298) + + A grammatical number is a morphological category characterized by the expression of quantity + through inflection or agreement. (http://en.wikipedia.org/wiki/Grammatical_number 17.11.06)</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#ParentheticalNode"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SyntaxTag"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ParentheticalPunctuation"/> + </rdfs:subClassOf> + <rdfs:comment>Parenthetical elements are dominated by a node labeled PRN. Punctuation marks that set off a parenthetical (i.e., commas, dashes, parentheses (-LRB- and -RRB-)) are contained within the PRN node. Use of PRN is determined ultimately by individual annotator intuition, though the presence of dashes or parentheses strongly suggests a parenthetical. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#SyntacticCategory"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#LinguisticConcept"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Adjective"> + <rdfs:comment> + An Adjective is a noun-modifying expression that specifies the properties or attributes of the nominal referent. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAnAdjective.htm 18.9.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AbsoluteTense"> + <rdfs:label>absolute tense</rdfs:label> + <rdfs:comment> + Absolute tense refers to a time in relation to the moment of utterance. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#absoluteTense with + reference to http://www.sil.org/linguistics/glossaryoflinguisticterms/whatisabsolutetense.htm") + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#TenseFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Gerund"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#NonFiniteVerb"/> + <rdfs:comment> + property for a non-finite form of a verb other than the infinitive. + (http://www.isocat.org/datcat/DC-2243) + + A gerund is a kind of verbal noun that exists in some languages. In today's English, + gerunds are nouns built from a verb with an '-ing' suffix. They can be used as the + subject of a sentence, an object, or an object of preposition. They can also be used + to complement a subject. Often, gerunds exist side-by-side with nouns that come from + the same root but the gerund and the common noun have different shades of meaning. + (http://en.wikipedia.org/wiki/Gerund, http://en.wikibooks.org/wiki/English:Gerund 19.09.06) + + The term _gerund_ is ambiguous: with respect to Latin, in whose grammatical tradition it originates, it refers to a deverbal noun, and is needed in this function for Polish as well; in descriptions of some other languages, however, it has been used for an adverbial participle. + The two meanings have nothing in common, except that the English _ing_-form can translate both. (Ivan A Derzhanski, email 2010/06/09) + Here, it is assumed that Gerund refers only to deverbal nouns, cf. NominalNonfiniteVerb in the IIIT tagset (http://purl.org/olia/iiit.owl#NominalNonFiniteVerb) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#BePresentTense"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment>These are verbforms in present tense. This class includes 3rd person singular or other than 3rd person singular verbforms.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#BePastTense"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes the conditional form of the verb to be. +EXAMPLES: +If I were/VBD rich... +If I were/VBD to win the lottery...</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#VerbPhrase"> + <rdfs:comment> + This category is slightly more difficult to define, since there is disagreement over the extent of the verb phrase. + In particular, should the verb phrase include only the words that are verbs, or should it also include the + complements of the verb? In the examples given in this document, and in the sample texts in the appendices, we have + chosen to include the complements, but it must be noted that this is an open issue, and we are in no way implying + that this analysis is preferable to the alternative. The choice to be made at this level, i.e. the inclusion or + exclusion of verbal complements in the Verb Phrase, is shown by the examples in 27 and 28, 27 showing the inclusion + of the complement of the verb in the verb phrase and 28 excluding the complement: + + (27) He [VP took up [NP a clothes brush NP] VP] + (28) He [VP took up VP] [NP a clothes brush NP] + + An advantage in the type of analysis shown in 27 is that the relative levels of the constituents can be shown to a + greater extent -- i.e. complements of the verb are included in the verb phrase, while adjuncts and peripheral + adverbials are left at sentence level. + + However, in a case where an adjunct occurs before the complement of the verb, the approaches used in 27 and 28 would + cause problems, since either both the adjunct and the complement would be included as daughters of the verb phrase, + or both would be daughters of the sentence, rather than keeping the complement as a daughter of the verb phrase and + the adjunct as a sister of the verb phrase. These problems may be solved by an additional notation, but at some + level, arbitrariness is inevitable. + + Regardless of the choice made over the extent of the Verb Phrase, there arises a problem of discontinuous Verb + Phrases. A complex verbal construction may be discontinuous, e.g. the auxiliary and the main verb are separated in + inverted constructions in English, or the main verb is positioned at the end of the sentence in German and Dutch. + Such discontinuity can be avoided by having different labels and constituents for the auxiliary verb and the main + verb, resulting in an analysis as shown in the Dutch example 29 below: + + (29) [NP Ze NP] [AUX zullen AUX] [ADVP er ADVP] [VP [NP de VN-agenda + [PP voor [NP het komende jaar NP] PP] NP] behandelen VP]. + + and in the English interrogative inverted example 30, using the so-called `dummy auxiliary' do: + + (30) [AUX Do AUX] [NP they NP] [VP confide [PP in you PP] VP]? + + As with Noun Phrases, Verb Phrases can be identified by a constituency test. In strong constituency languages like + English, the whole VP can be moved, but not part of it: compare 31 and 32: + + (31) Give in to blackmail, I never will + (32) *Give in, I never will to blackmail + + However, there are languages in which constituent tests do not work. These will typically be languages with flexible + word order, such as Finnish. 33 is an example of a discontinuous VP (Vilkuna 1989: 26): + + (33) Maailmaa nähnyt hän on. + world-Part seen he is + `He IS a widely-travelled person.' + + For Finnish, then, evidence for a VP is less convincing than it is for English, and a dependency approach seems the + more natural choice. (Covington (1990) provides a parsing strategy for variable word order languages and Covington + (1991) for parsing discontinuous constituents, both using a dependency syntax approach.) + + In Italian also, constituency tests cannot be applied. This can be shown through the distribution of VP-adverbs + (e.g. completamente `completely', intenzionalmente `intentionally', attentamente `carefully') and S-adverbs (e.g. + probabilmente `probably', certamente `certainly'). In English, these different classes of adverbs have a different + distribution within the sentence. In contrast, in Italian, the distinct adverb classes cannot be distinguished on + the basis of their distribution in the sentence. S-adverbs and VP-adverbs can occur in the same positions within the + sentence, as illustrated in examples 34 to 37: + + (34) Attentamente/certamente, il bambino ascoltó la storia + `Carefully/certainly, the child listened to the story' + (35) Il bambino attentamente/certamente ascoltó la storia + `The child carefully/certainly listened to the story' + (36) Il bambino ascoltó attentamente/certamente la storia + `The child listened carefully/certainly to the story' + (37) Il bambino ascoltó la storia attentamente/certamente + `The child listened to the story carefully/certainly' + + Thus, in Italian as well as other languages, neither the position nor the syntactic context can help to decide + whether an adverb is an S-adverb or a VP-adverb; this can only be stated by considering its semantic content and the + way it relates to the content of the predicate or the sentence. This situation has consequences for the success of + standard VP-tests. + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node33.html) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Phrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#SecondaryPunctuation"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Punctuation"/> + </rdfs:subClassOf> + <rdfs:comment> + Punctuation that is not very important with regards to sentence splitting in a text. + (http://www.isocat.org/datcat/DC-2076) + </rdfs:comment> + <rdfs:label>secondary punctuation</rdfs:label> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Noun"> + <rdfs:comment>We inserted this class 'noun' to get a clearer ontology structure. In The Penn Treebank Tag Set there is no class 'noun'.</rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Noun"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Verb"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:comment> + A verb is a part of speech that usually denotes action ("bring", "read"), + occurrence ("decompose", "glitter"), or a state of being ("exist", "stand"). + Depending on the language, a verb may vary in form according to many factors, + possibly including its tense, aspect, mood and voice. It may also agree with + the person, gender, and/or number of some of its arguments (subject, object, etc.). + (http://en.wikipedia.org/wiki/Verb 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Adverb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Adverb"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes most words that end in -ly as well as degree words like "quite", "too" and "very", posthead modifiers like "enough" and "indeed" (as in "good enough", "very well indeed"), and negative markers like "not", "n' t" and "never".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#AdjectivePhrase"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AdjectivePhrase"/> + </rdfs:subClassOf> + <rdfs:comment>ADJP|Adjective phrase. Phrasal category headed by an adjective (including comparative and +superlative adjectives). Example: outrageously expensive. +(Santorini 1991) + +ADJP — Adjective Phrase. Phrasal category headed by an adjective (including comparative and superlative adjectives). Example: outrageously expensive. +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SubordinateClause"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#SubordinateClause"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn-syntax.owl#Clause"/> + <rdfs:comment>SBAR|Clause introduced by a (possibly empty) subordinating conjunction. +(Santorini 1991) + +SBAR is used for relative clauses and subordinate clauses, including indirect questions. ... +SBAR — Clause introduced by a (possibly empty) subordinating conjunction. + +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ComparativeAdjective"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Adjective"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Comparative"/> + </rdfs:subClassOf> + <rdfs:comment>These are adjectives mostly with the comparative ending -er and a comparative meaning. "More" or "less" should be tagged as a comparative adjective when it is used without a head noun and it +corresponds to the object of a verb or preposition.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Phrase"> + <rdfs:comment> + Phrase is the class of syntactic constructions that consist of one or more + syntactic words, but lack the subject-predicate organization of a clause. + Phrases get their grammatical characteristics according to what word occupies + the head position; thus, all phrases have heads [Crystal 1980, 232-233; Pei + and Gaynor 1954, 169; Pike and Pike 1982, 453]. + (http://purl.org/linguistics/gold/Phrase) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Constituent"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounPhrase"> + <rdfs:comment> + At phrase level, the noun phrase is probably the least problematic of the categories to be dealt + with. In general, a noun phrase will a have noun or a pronoun as its head, and included within + the noun phrase are the determinative elements, any premodification, and any postmodification. + The examples below, 14 to 17 show noun phrases with the head noun/pronoun in bold: + + (14) [NP He NP] was a tiny man + (15) [NP his white shirt cuffs NP] + (16) [NP his surprisingly thick and hairy wrists NP] + (17) [NP some wholly unanticipated but remotely possible event of absorbing interest NP] + + However, noun phrases may also occur with adjectival heads, as in 18 and 19: + + (18) [NP The unemployed NP] have had enough + (19) We've beaten [NP the best NP] + + or with a head which is a cardinal or ordinal number, as in 20 and 21: + + (20) [NP The ninth NP] is my particular favourite + (21) [NP The other seven NP] continued with the trip + + In `pro-drop' languages, such as Spanish and Italian, pronominal Subjects are usually not expressed. + Depending on the chosen type of analysis, this may require another definition of noun phrase, in order + to include `empty noun phrases', in which the pronoun is not actually present, but may be inferred + from the verb ending. + + A classic constituency test for Noun Phrases is that only whole NPs can be moved within the same sentence. + In English, constituents can be preposed to achieve some effect, as in 23 (from Radford 1988: 70): + + (22) I can't stand your elder sister + (23) Your elder sister I can't stand (though your brother's OK). + + Examples 24 and 25 show that it is not possible to move only part of the NP: + + (24) *Your elder I can't stand sister + (25) *Elder sister, I can't stand your + + However, this test should be used with caution. It works well in English, but not always in other languages. + For example, in 26 Neue Bücher is moved to the beginning of the sentence while keine is left at the end: + + (26) Neue Bücher habe ich keine + new books have I no + `I have not got any new books' + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node32.html) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounHeadedPhrase"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Parenthetical"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"/> + </rdfs:subClassOf> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ParentheticalPunctuation"/> + </rdfs:subClassOf> + <rdfs:comment>PRN +— Parenthetical. (See section 2.6 below for a complete description.) +(Bies et al. 1995)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PossessivePronoun"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Pronoun"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PossessivePronoun"/> + </rdfs:subClassOf> + <rdfs:comment>Both substitutive and attributive 'her' are covered by this categorie. It's thus PossessiveDeterminer or PossessivePronoun.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Determiner"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PronounOrDeterminer"/> + </rdfs:subClassOf> + <rdfs:comment> + A determiner is a noun modifier that expresses the reference of a noun or noun phrase + in the context, including quantity, rather than attributes expressed by adjectives. + This part of speech is defined in some languages, such as in English, as it is distinct + from adjectives grammatically, though most English dictionaries still identify the + determiners as adjectives. + (http://en.wikipedia.org/wiki/Determiner 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#CaseFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"/> + </rdfs:subClassOf> + <rdfs:comment>Case is a grammatical category determined by the syntactic or semantic function of a noun or pronoun. The term case has traditionally been restricted to apply to only those languages which indicate certain functions by the inflection of nouns, pronouns, or noun phrase constituents, such as adjectives and numerals. (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsCase.htm 17.11.06)</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Quantifier"> + <rdfs:comment> + A quantifier is a determiner that expresses a referent's definite or indefinite number or amount. + A quantifier functions as a modifier of a noun, or pronoun. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAQuantifier.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Superlative"> + <rdfs:comment> + The superlative of an adjective or adverb is a form of adjective or + adverb which indicates that something has some feature to a greater + degree than anything it is being compared to in a given context. + (http://en.wikipedia.org/wiki/Superlative 17.11.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#DegreeFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Pronoun"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PronounOrDeterminer"/> + </rdfs:subClassOf> + <rdfs:comment> + A pronoun is a pro-form which functions like a noun and substitutes for a + noun or a noun-phrase. A language may have several classes of pronouns. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAPronoun.htm 19.09.06) + + A pronominal is a phrase that functions as a pronoun + (www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAPronominal.htm; http://www.isocat.org/datcat/DC-1369) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Clause"> + <rdfs:comment> + Traditionally sentences are deemed to be composed of major constituents + known as clauses, which may be main clauses (not included in a superordinate + clause) or embedded clauses (included in a superordinate clause) such as + relative clauses or adverbial clauses. A main clause, unless it is coordinated, + is equivalent to a simple sentence, and does not need to be separately labelled. + Embedded and coordinated clauses, on the other hand, will need to be separately + identified. We recommend that such units be identified in the annotation, and + labelled either as sentences (S) or as clauses (CL), according to the preference + specified in the annotation scheme. + + The reason for allowing choice here is that different theoretical preferences + have to be accommodated. In some syntactic models, the `clause' category is not + used (except informally), embedded clauses being marked by included [S] + constituents. In other models, clauses are identified as such, even where they + are coextensive with an independent sentence. + + One solution which commends itself (and is employed in the Lancaster Treebank and + the SUSANNE Corpus) is to retain [S ... S] as the delimiter of sentences, whether + included or not, and also to use [S ... S] for the coordinated parts of a compound + sentence; but to use `clause' labels for subordinate clauses. An example which + illustrates this division is 12: + + (12) [S [S The distinction at issue is relatively clear S] , but [S closer + examination reveals [CL that all is not quite so straightforward + [CL as it seems CL] CL] S] . S] + + Embedded (subordinate) clauses are generally identified by some sign of their + dependence on the superordinate clause or sentence, such as an introductory + conjunction or a non-finite verb form. It is noticeable that the coordinated + parts of the compound sentence do not have to be clause-like units with subjects + and verbs, and to this extent [CL] would be a misleading label to apply to them. + This is true, in 13, of so far so good in: + + (13) [S [S So far so good S] , but [S now consider gender in adjectives S] . S] + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node31.html) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Constituent"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia-top.owl#MorphosyntacticFeature"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/system.owl#Feature"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#LinguisticConcept"/> + <rdfs:comment>Morphosyntactic and morphological features.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#WhDeterminer"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#WHDeterminer"/> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Determiner"/> + </rdfs:subClassOf> + <rdfs:comment>This category includes "which", as well as that when it is used as a relative pronoun.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Noun"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:comment> + A noun, or noun substantive, is a part of speech (a word or phrase) which can co-occur with + (in)definite articles and attributive adjectives, and function as the head of a noun phrase. + + The word "noun" derives from the Latin 'nomen' meaning "name", and a traditional definition + of nouns is that they are all and only those expressions that refer to a person, place, + thing, event, substance, quality, idea or an appointment. They serve as the subject or object + of a verb, and the object of a preposition. + (http://en.wikipedia.org/wiki/Noun 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ProperNoun"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ProperNoun"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Noun"/> + <rdfs:comment>These are singular or plural proper nouns.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Past"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#AbsoluteTense"/> + <rdfs:comment> + The past tense is a verb tense expressing action, activity, state + or being in the past. (http://en.wikipedia.org/wiki/Past_tense 17.11.06) + + The past tense refers to a tense category which places an event in the past. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#pastTense) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Singular"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#NumberFeature"/> + <rdfs:comment> + Singular is a grammatical number denoting a unit quantity (as opposed + to the plural and other forms). (http://en.wikipedia.org/wiki/Singular + 17.11.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ModalVerb"> + <rdfs:comment> + Verb form that is usually used with another verb to express ideas such as possibilities, permission, or intention. + (Gil Francopoulo; http://www.isocat.org/datcat/DC-1329) + + A modal verb (also modal, modal auxiliary verb, modal auxiliary) is a type of auxiliary + verb that is used to indicate modality. The use of auxiliary verbs to express modality + is characteristic of Germanic languages. + (http://en.wikipedia.org/wiki/Modal_verb 19.09.06) + + In addition to main and auxiliary verbs, it may be useful (e.g. in English) to recognise an intermediate + category of semi-auxiliary for such verbs as be going to, have got to, ought to. + (http://www.ilc.cnr.it/EAGLES96/annotate/node18.html#oav1v 20.09.06) + + The auxiliaries in English subdivide into the primary verbs `be', `have', and `do', which can also function + as main verbs, and the modal auxiliaries such as `can', `will', and `would', which are uninflected, and always + function as auxiliaries. + (http://www.ilc.cnr.it/EAGLES96/morphsyn/node158.html#SECTION00054800000000000000) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#AuxiliaryVerb"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#SubordinateClause"> + <rdfs:comment> + SubordinateClause is the class of clauses that cannot stand on their + own as sentences. A matrix clause combined with a subordinate clause + form a main clause. In the sentence 'John thinks that Mary is sick', + 'Mary is sick' is the subordinate clause. + (http://purl.org/linguistics/gold/SubordinateClause) + + Dependent clauses (which are also sometimes referred to as subordinate + clauses) cannot stand alone as sentences. They usually begin with + subordinating conjunctions. A sentence with an independent clause and + any number of dependent clauses is referred to as a complex sentence. + One with two or more independent clauses and any number of dependent + clauses is referred to as a compound-complex sentence + (http://en.wikipedia.org/wiki/Clause, cf. + http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#subordinateClause). + + A subordinate clause is an embedded construction which contains a finite verb form. + (http://languagelink.let.uu.nl/tds/onto/LinguisticOntology.owl#finiteEmbeddedConstruction) + </rdfs:comment> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#FiniteClause"/> + </rdfs:subClassOf> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#PossessivePronoun"> + <rdfs:comment> + A possessive pronoun is a pronoun that expresses relationships like ownership, such as kinship, and other forms of association. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAPossessivePronoun.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Pronoun"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Participle"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#NonFiniteVerb"/> + <rdfs:comment> + A participle is a lexical item, derived from a verb that has some of the characteristics and functions of both verbs and adjectives. + In English, participles may be used as adjectives, and in non-finite forms of verbs. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsAParticiple.htm 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#GenitiveCase"> + <rdfs:comment> + Genitive case signals that the referent of the marked noun is the possessor + of the referent of another noun, e.g. "the man's foot". In some languages, + genitive case may express an associative relation between the marked noun + and another noun. + (http://www.sil.org/linguistics/glossaryoflinguisticterms/WhatIsGenitiveCase.htm 17.11.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#CaseFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Tag"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/system.owl#LinguisticAnnotation"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#CommonNoun"> + <rdfs:comment> + A common noun is a noun that signifies a non-specific member of a group. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsACommonNoun.htm 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Noun"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PersonalPronoun"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Pronoun"/> + <rdfs:comment>This category includes the personal pronouns proper, without regard for case distinctions ("I", "me", "you", "he", "him", etc.), the reflexive pronouns ending in -self or -selves, and the nominal possessive pronouns "mine", "yours", "his", "hers", "ours" and "theirs".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Punctuation"> + <rdfs:comment> + Punctuation marks (PU) are treated here as a part of morphosyntactic annotation, as it + is very common for punctuation marks to be tagged and to be treated as equivalent to + words for the purposes of automatic tag assignment. + (http://www.ilc.cnr.it/EAGLES96/annotate/node16.html#mp 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#MorphosyntacticCategory"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#Word"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#SyntaxTag"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/system.owl#UnitOfAnnotation"/> + <rdfs:comment>Santorini (1991, §4.1), in TIGER cat label of syntactic nodes</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn-syntax.owl#Phrase"> + <rdfs:comment>(Bies et al. 1995, §2.1.2)</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Phrase"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn-syntax.owl#SyntaxTag"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Adjective"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Adjective"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:comment>These are adjectives, ordinal numerals, and ordinal numbers. +Hyphenated compounds that are used as modifiers are tagged as adjectives, e.g. "happy-go-lucky", "one-of-a-kind", "run-of-the-mill". Ordinal numbers are tagged as adjectives, as are compounds of the form "n-th" or "X-est", like "fourth-largest".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#ModalVerb"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#ModalVerb"/> + <rdfs:comment>This category includes all verbs that don't take an -s ending in the third person singular present: "can", +"could", ("dare"), "may", "might", "must", "ought", "shall", "should", "will", "would".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ProperNoun"> + <rdfs:comment> + Proper nouns (also called proper names) are the names of unique entities. + (http://en.wikipedia.org/wiki/Noun 19.09.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Noun"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Numeral"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Quantifier"/> + <rdfs:comment> + A numeral is a word, functioning most typically as an adjective or pronoun, + that expresses a number, and relation to the number, such as one of the + following: Quantity, Sequence, Frequency, Fraction. + (http://www.sil.org/linguistics/GlossaryOfLinguisticTerms/WhatIsANumeral.htm 19.09.06) + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#CoordinatingConjunction"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Conjunction"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#CoordinatingConjunction"/> + <rdfs:comment>This category includes "and", "but", "nor", "or", "yet" (as in "Yet it's cheap", "cheap yet good"), as well as the mathematical operators "plus", "minus", "less", "times" (in the sense of "multiplied by") and "over" (in the sense of "divided by"), when they are spelled out. +For in the sense of "because" is a coordinating conjunction.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Determiner"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:comment>Not clear whether this corresponds to OLiA/EAGLES determiners, because some predeterminers seem to be adverbs rather than determiners proper.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#NounHeadedPhrase"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Phrase"/> + <rdfs:comment> + A NounHeadedPhrase takes a nominal as its (semantic) head. + Introduced as a generalization over NounPhrase and PrepositionalPhrase for reasons of consistency with dependency parsers like + Connexor where this differentiation is not made. + </rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#Comparative"> + <rdfs:comment> + The comparative is the form of an adjective or adverb which denotes + the degree or grade by which a person, thing, or other entity has a + property or quality greater or less in extent than that of another. + In English the structure of a comparative consists normally of the + positive form of the adjective or adverb, plus the suffix -er, or + (especially in the case of longer words) the modifier "more" (or + "less") before the adjective or adverb. The form is usually completed + by "than" and the noun which is being compared, e.g. "he is taller + than his father is", or "the village is less picturesque than the + town near by is". (http://en.wikipedia.org/wiki/Comparative 17.11.06) + </rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia-top.owl#DegreeFeature"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#BaseForm"> + <rdfs:subClassOf> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#Verb"/> + </rdfs:subClassOf> + <rdfs:comment>This tag subsumes imperatives, infinitives and subjunctives. +EXAMPLES: +Imperative: Do/VB it. +Infinitive: You should do/VB it. + We want them to do/VB it. + We made them do/VB it. +Subjunctive: We suggested that he do/VB it.</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#ing"> + <rdfs:comment>English verb forms ending in '-ing' that represent either Gerunds or Participles.</rdfs:comment> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Participle"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Gerund"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#FiniteClause"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Clause"/> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/penn.owl#PossessiveEnding"> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#GenitiveCase"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/penn.owl#Tag"/> + <rdfs:subClassOf rdf:resource="http://purl.org/olia/olia.owl#Residual"/> + <rdfs:comment>The possessive ending on nouns ending in 's or is split off by the tagging algorithm and tagged as if it +were a separate word. e.g. "John/ NP 's/POS idea", "the parents/NNS'/POS distress".</rdfs:comment> + </owl:Class> + <owl:Class rdf:about="http://purl.org/olia/olia.owl#AdjectivePhrase"> + <rdfs:comment> + An adjective phrase may consist of an adjective, or a sequence of words in which an adjective is the head of the + phrase, as shown in 47 to 50 below. + + (47) [NP his [ADJP surprisingly thick and hairy ADJP] wrists NP] + (48) [NP some [ADJP [ADJP wholly unanticipated ADJP] but [ADJP remotely possible ADJP] ADJP] event NP] + (49) [S [NP His speeches NP] [VP are [ADVP always ADVP] [ADJP too long [PP for comfort PP] ADJP] VP] S] + (50) [AUX have AUX] [NP you NP] [VP found [NP something + [ADJP suitable [PP for [NP your needs NP] PP] ADJP] NP] VP] ? + (http://www.ilc.cnr.it/EAGLES96/segsasg1/node36.html) + </r... [truncated message content] |
From: <jen...@us...> - 2011-11-02 09:09:03
|
Revision: 3358 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3358&view=rev Author: jenslehmann Date: 2011-11-02 09:08:56 +0000 (Wed, 02 Nov 2011) Log Message: ----------- registered editor for class expressions (not working yet) Modified Paths: -------------- trunk/components-core/src/test/java/org/dllearner/test/junit/OWLAPITests.java trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf trunk/interfaces/src/main/java/org/dllearner/configuration/spring/CustomPropertyEditorRegistrar.java Added Paths: ----------- trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java Added: trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java 2011-11-02 09:08:56 UTC (rev 3358) @@ -0,0 +1,92 @@ +package org.dllearner.core.config; + +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Rectangle; +import java.beans.PropertyChangeListener; +import java.beans.PropertyEditor; + +import org.dllearner.core.owl.Description; +import org.dllearner.utilities.owl.ManchesterOWLSyntaxParser; +import org.semanticweb.owlapi.expression.ParserException; + +public class ClassExpressionPropertyEditor implements PropertyEditor { + + private Description description; + + @Override + public void addPropertyChangeListener(PropertyChangeListener arg0) { + // TODO Auto-generated method stub + + } + + @Override + public String getAsText() { + return description.toManchesterSyntaxString(null, null); + } + + @Override + public Component getCustomEditor() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getJavaInitializationString() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String[] getTags() { + // TODO Auto-generated method stub + return null; + } + + @Override + public Object getValue() { + return description; + } + + @Override + public boolean isPaintable() { + // TODO Auto-generated method stub + return false; + } + + @Override + public void paintValue(Graphics arg0, Rectangle arg1) { + // TODO Auto-generated method stub + + } + + @Override + public void removePropertyChangeListener(PropertyChangeListener arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void setAsText(String arg0) throws IllegalArgumentException { + System.out.println(arg0); + // we assume that the start class string is given in Manchester syntax + try { + description = ManchesterOWLSyntaxParser.getDescription(arg0); + } catch (ParserException e) { + throw new IllegalArgumentException(e); + } + System.out.println(description); + } + + @Override + public void setValue(Object arg0) { + description = (Description) arg0; + } + + @Override + public boolean supportsCustomEditor() { + // TODO Auto-generated method stub + return false; + } + +} Modified: trunk/components-core/src/test/java/org/dllearner/test/junit/OWLAPITests.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/OWLAPITests.java 2011-11-02 08:43:43 UTC (rev 3357) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/OWLAPITests.java 2011-11-02 09:08:56 UTC (rev 3358) @@ -21,6 +21,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.utilities.owl.ManchesterOWLSyntaxParser; +import org.junit.Test; import org.semanticweb.owlapi.expression.ParserException; /** @@ -32,7 +33,7 @@ */ public class OWLAPITests { -// @Test + @Test public void testManchesterSyntaxParser() throws ParserException { // String s = "BIGPROP SOME smallclass"; // String s = "<http://test.de/prop> some <http://test.de/Class>"; Modified: trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf =================================================================== --- trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-02 08:43:43 UTC (rev 3357) +++ trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-02 09:08:56 UTC (rev 3358) @@ -34,9 +34,9 @@ op.useStringDatatypes = true //op.frequencyThreshold = 1 alg.type = "celoe" -// alg.writeSearchTree = true +alg.writeSearchTree = true alg.replaceSearchTree = true -alg.maxExecutionTimeInSeconds = 10 +alg.maxExecutionTimeInSeconds = 100 alg.maxNrOfResults = 10 Modified: trunk/interfaces/src/main/java/org/dllearner/configuration/spring/CustomPropertyEditorRegistrar.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/configuration/spring/CustomPropertyEditorRegistrar.java 2011-11-02 08:43:43 UTC (rev 3357) +++ trunk/interfaces/src/main/java/org/dllearner/configuration/spring/CustomPropertyEditorRegistrar.java 2011-11-02 09:08:56 UTC (rev 3358) @@ -1,5 +1,7 @@ package org.dllearner.configuration.spring; +import org.dllearner.core.config.ClassExpressionPropertyEditor; +import org.dllearner.core.owl.Description; import org.springframework.beans.PropertyEditorRegistrar; import org.springframework.beans.PropertyEditorRegistry; @@ -17,6 +19,7 @@ @Override public void registerCustomEditors(PropertyEditorRegistry registry) { //Register any custom editors here. - + ClassExpressionPropertyEditor ce = new ClassExpressionPropertyEditor(); + registry.registerCustomEditor(Description.class, ce); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-02 12:27:00
|
Revision: 3359 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3359&view=rev Author: jenslehmann Date: 2011-11-02 12:26:53 +0000 (Wed, 02 Nov 2011) Log Message: ----------- - wrote Manchester syntax parser - added a unit test for it - integrated support for using class expressions in conf files (via property editor) Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java trunk/components-core/src/main/java/org/dllearner/core/owl/StringValueRestriction.java trunk/components-core/src/main/java/org/dllearner/utilities/owl/ManchesterOWLSyntaxParser.java trunk/components-core/src/test/java/org/dllearner/test/junit/OWLAPITests.java trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java trunk/examples/father.conf Added Paths: ----------- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserConstants.java trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-11-02 09:08:56 UTC (rev 3358) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-11-02 12:26:53 UTC (rev 3359) @@ -49,6 +49,8 @@ import org.dllearner.core.owl.Individual; import org.dllearner.core.owl.Intersection; import org.dllearner.core.owl.NamedClass; +import org.dllearner.core.owl.ObjectProperty; +import org.dllearner.core.owl.ObjectSomeRestriction; import org.dllearner.core.owl.Restriction; import org.dllearner.core.owl.Thing; import org.dllearner.learningproblems.ClassLearningProblem; @@ -262,7 +264,10 @@ minimizer = new DescriptionMinimizer(reasoner); - startClass = Thing.instance; + // start at owl:Thing by default + if(startClass == null) { + startClass = Thing.instance; + } // singleSuggestionMode = configurator.getSingleSuggestionMode(); Modified: trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java 2011-11-02 09:08:56 UTC (rev 3358) +++ trunk/components-core/src/main/java/org/dllearner/core/config/ClassExpressionPropertyEditor.java 2011-11-02 12:26:53 UTC (rev 3359) @@ -7,6 +7,8 @@ import java.beans.PropertyEditor; import org.dllearner.core.owl.Description; +import org.dllearner.parser.ManchesterSyntaxParser; +import org.dllearner.parser.ParseException; import org.dllearner.utilities.owl.ManchesterOWLSyntaxParser; import org.semanticweb.owlapi.expression.ParserException; @@ -68,14 +70,12 @@ @Override public void setAsText(String arg0) throws IllegalArgumentException { - System.out.println(arg0); // we assume that the start class string is given in Manchester syntax try { - description = ManchesterOWLSyntaxParser.getDescription(arg0); - } catch (ParserException e) { + description = ManchesterSyntaxParser.parseClassExpression(arg0); + } catch (ParseException e) { throw new IllegalArgumentException(e); } - System.out.println(description); } @Override Modified: trunk/components-core/src/main/java/org/dllearner/core/owl/StringValueRestriction.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/owl/StringValueRestriction.java 2011-11-02 09:08:56 UTC (rev 3358) +++ trunk/components-core/src/main/java/org/dllearner/core/owl/StringValueRestriction.java 2011-11-02 12:26:53 UTC (rev 3359) @@ -42,7 +42,7 @@ @Override public String toManchesterSyntaxString(String baseURI, Map<String,String> prefixes) { - return restrictedPropertyExpression.toString(baseURI, prefixes) + " value " +"\"" +value.toManchesterSyntaxString(baseURI, prefixes)+"\""; + return restrictedPropertyExpression.toString(baseURI, prefixes) + " value " + value.toManchesterSyntaxString(baseURI, prefixes); } @Override Added: trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java 2011-11-02 12:26:53 UTC (rev 3359) @@ -0,0 +1,641 @@ +/* Generated By:JavaCC: Do not edit this line. ManchesterSyntaxParser.java */ +package org.dllearner.parser; + +import org.dllearner.core.owl.*; +import java.io.*; +import java.net.URL; + +public class ManchesterSyntaxParser implements ManchesterSyntaxParserConstants { + + public static Description parseClassExpression(String classExpression) throws ParseException { + ManchesterSyntaxParser parser = new ManchesterSyntaxParser(new StringReader(classExpression)); + return parser.ClassExpression(); + } + + final public Description ClassExpression() throws ParseException { + Description c,c1,c2; + String s,s1,s2; + int i; + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case TOP: + jj_consume_token(TOP); + {if (true) return new Thing();} + break; + case BOTTOM: + jj_consume_token(BOTTOM); + {if (true) return new Nothing();} + break; + default: + jj_la1[0] = jj_gen; + if (jj_2_1(2147483647)) { + jj_consume_token(21); + c1 = ClassExpression(); + jj_consume_token(AND); + c2 = ClassExpression(); + jj_consume_token(22); + {if (true) return new Intersection(c1,c2);} + } else if (jj_2_2(2147483647)) { + jj_consume_token(21); + c1 = ClassExpression(); + jj_consume_token(OR); + c2 = ClassExpression(); + jj_consume_token(22); + {if (true) return new Union(c1,c2);} + } else if (jj_2_3(2147483647)) { + s = URI(); + jj_consume_token(SOME); + c = ClassExpression(); + {if (true) return new ObjectSomeRestriction(new ObjectProperty(s),c);} + } else if (jj_2_4(2147483647)) { + s = URI(); + jj_consume_token(ONLY); + c = ClassExpression(); + {if (true) return new ObjectAllRestriction(new ObjectProperty(s),c);} + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case NOT: + jj_consume_token(NOT); + c = ClassExpression(); + {if (true) return new Negation(c);} + break; + case GE: + jj_consume_token(GE); + i = Integer(); + s = URI(); + jj_consume_token(23); + c = ClassExpression(); + {if (true) return new ObjectMinCardinalityRestriction(i,new ObjectProperty(s),c);} + break; + case LE: + jj_consume_token(LE); + i = Integer(); + s = URI(); + jj_consume_token(23); + c = ClassExpression(); + {if (true) return new ObjectMaxCardinalityRestriction(i,new ObjectProperty(s),c);} + break; + default: + jj_la1[1] = jj_gen; + if (jj_2_5(4)) { + jj_consume_token(21); + s1 = URI(); + jj_consume_token(24); + s2 = URI(); + jj_consume_token(22); + {if (true) return new ObjectValueRestriction(new ObjectProperty(s1), new Individual(s2));} + } else if (jj_2_6(4)) { + jj_consume_token(21); + s1 = URI(); + jj_consume_token(24); + s2 = String(); + jj_consume_token(22); + {if (true) return new StringValueRestriction(new DatatypeProperty(s1), s2);} + } else { + switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { + case URI: + s = URI(); + {if (true) return new NamedClass(s);} + break; + default: + jj_la1[2] = jj_gen; + jj_consume_token(-1); + throw new ParseException(); + } + } + } + } + } + throw new Error("Missing return statement in function"); + } + + final public double Double() throws ParseException { + Token t; + t = jj_consume_token(DOUBLE); + {if (true) return new Double(t.image);} + throw new Error("Missing return statement in function"); + } + + final public int Integer() throws ParseException { + Token t; + t = jj_consume_token(NUMBER); + {if (true) return new Integer(t.image);} + throw new Error("Missing return statement in function"); + } + + final public String String() throws ParseException { + Token t; + String s; + t = jj_consume_token(STRING); + // cut quotes + s = t.image; + s = s.substring(1, s.length() - 1); + {if (true) return s;} + throw new Error("Missing return statement in function"); + } + + final public String URI() throws ParseException { + Token t; + String s; + t = jj_consume_token(URI); + // cut "<" and ">" + s = t.image; + s = s.substring(1, s.length() - 1); + {if (true) return s;} + throw new Error("Missing return statement in function"); + } + + private boolean jj_2_1(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_1(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(0, xla); } + } + + private boolean jj_2_2(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_2(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(1, xla); } + } + + private boolean jj_2_3(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_3(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(2, xla); } + } + + private boolean jj_2_4(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_4(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(3, xla); } + } + + private boolean jj_2_5(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_5(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(4, xla); } + } + + private boolean jj_2_6(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_6(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(5, xla); } + } + + private boolean jj_3R_3() { + if (jj_scan_token(STRING)) return true; + return false; + } + + private boolean jj_3R_8() { + if (jj_3R_2()) return true; + if (jj_scan_token(SOME)) return true; + if (jj_3R_1()) return true; + return false; + } + + private boolean jj_3R_7() { + if (jj_scan_token(21)) return true; + if (jj_3R_1()) return true; + if (jj_scan_token(OR)) return true; + if (jj_3R_1()) return true; + if (jj_scan_token(22)) return true; + return false; + } + + private boolean jj_3R_6() { + if (jj_scan_token(21)) return true; + if (jj_3R_1()) return true; + if (jj_scan_token(AND)) return true; + if (jj_3R_1()) return true; + if (jj_scan_token(22)) return true; + return false; + } + + private boolean jj_3R_5() { + if (jj_scan_token(BOTTOM)) return true; + return false; + } + + private boolean jj_3R_1() { + Token xsp; + xsp = jj_scanpos; + if (jj_3R_4()) { + jj_scanpos = xsp; + if (jj_3R_5()) { + jj_scanpos = xsp; + if (jj_3R_6()) { + jj_scanpos = xsp; + if (jj_3R_7()) { + jj_scanpos = xsp; + if (jj_3R_8()) { + jj_scanpos = xsp; + if (jj_3R_9()) { + jj_scanpos = xsp; + if (jj_3R_10()) { + jj_scanpos = xsp; + if (jj_3R_11()) { + jj_scanpos = xsp; + if (jj_3R_12()) { + jj_scanpos = xsp; + if (jj_3_5()) { + jj_scanpos = xsp; + if (jj_3_6()) { + jj_scanpos = xsp; + if (jj_3R_13()) return true; + } + } + } + } + } + } + } + } + } + } + } + return false; + } + + private boolean jj_3R_4() { + if (jj_scan_token(TOP)) return true; + return false; + } + + private boolean jj_3R_14() { + if (jj_scan_token(NUMBER)) return true; + return false; + } + + private boolean jj_3R_13() { + if (jj_3R_2()) return true; + return false; + } + + private boolean jj_3R_2() { + if (jj_scan_token(URI)) return true; + return false; + } + + private boolean jj_3_6() { + if (jj_scan_token(21)) return true; + if (jj_3R_2()) return true; + if (jj_scan_token(24)) return true; + if (jj_3R_3()) return true; + if (jj_scan_token(22)) return true; + return false; + } + + private boolean jj_3_4() { + if (jj_3R_2()) return true; + if (jj_scan_token(ONLY)) return true; + return false; + } + + private boolean jj_3_5() { + if (jj_scan_token(21)) return true; + if (jj_3R_2()) return true; + if (jj_scan_token(24)) return true; + if (jj_3R_2()) return true; + if (jj_scan_token(22)) return true; + return false; + } + + private boolean jj_3_3() { + if (jj_3R_2()) return true; + if (jj_scan_token(SOME)) return true; + return false; + } + + private boolean jj_3R_12() { + if (jj_scan_token(LE)) return true; + if (jj_3R_14()) return true; + if (jj_3R_2()) return true; + if (jj_scan_token(23)) return true; + if (jj_3R_1()) return true; + return false; + } + + private boolean jj_3_2() { + if (jj_scan_token(21)) return true; + if (jj_3R_1()) return true; + if (jj_scan_token(OR)) return true; + return false; + } + + private boolean jj_3R_11() { + if (jj_scan_token(GE)) return true; + if (jj_3R_14()) return true; + if (jj_3R_2()) return true; + if (jj_scan_token(23)) return true; + if (jj_3R_1()) return true; + return false; + } + + private boolean jj_3R_10() { + if (jj_scan_token(NOT)) return true; + if (jj_3R_1()) return true; + return false; + } + + private boolean jj_3_1() { + if (jj_scan_token(21)) return true; + if (jj_3R_1()) return true; + if (jj_scan_token(AND)) return true; + return false; + } + + private boolean jj_3R_9() { + if (jj_3R_2()) return true; + if (jj_scan_token(ONLY)) return true; + if (jj_3R_1()) return true; + return false; + } + + /** Generated Token Manager. */ + public ManchesterSyntaxParserTokenManager token_source; + SimpleCharStream jj_input_stream; + /** Current token. */ + public Token token; + /** Next token. */ + public Token jj_nt; + private int jj_ntk; + private Token jj_scanpos, jj_lastpos; + private int jj_la; + private int jj_gen; + final private int[] jj_la1 = new int[3]; + static private int[] jj_la1_0; + static { + jj_la1_init_0(); + } + private static void jj_la1_init_0() { + jj_la1_0 = new int[] {0xc00,0x70000,0x100000,}; + } + final private JJCalls[] jj_2_rtns = new JJCalls[6]; + private boolean jj_rescan = false; + private int jj_gc = 0; + + /** Constructor with InputStream. */ + public ManchesterSyntaxParser(java.io.InputStream stream) { + this(stream, null); + } + /** Constructor with InputStream and supplied encoding */ + public ManchesterSyntaxParser(java.io.InputStream stream, String encoding) { + try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source = new ManchesterSyntaxParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 3; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(java.io.InputStream stream) { + ReInit(stream, null); + } + /** Reinitialise. */ + public void ReInit(java.io.InputStream stream, String encoding) { + try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 3; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor. */ + public ManchesterSyntaxParser(java.io.Reader stream) { + jj_input_stream = new SimpleCharStream(stream, 1, 1); + token_source = new ManchesterSyntaxParserTokenManager(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 3; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(java.io.Reader stream) { + jj_input_stream.ReInit(stream, 1, 1); + token_source.ReInit(jj_input_stream); + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 3; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Constructor with generated Token Manager. */ + public ManchesterSyntaxParser(ManchesterSyntaxParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 3; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + /** Reinitialise. */ + public void ReInit(ManchesterSyntaxParserTokenManager tm) { + token_source = tm; + token = new Token(); + jj_ntk = -1; + jj_gen = 0; + for (int i = 0; i < 3; i++) jj_la1[i] = -1; + for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); + } + + private Token jj_consume_token(int kind) throws ParseException { + Token oldToken; + if ((oldToken = token).next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + if (token.kind == kind) { + jj_gen++; + if (++jj_gc > 100) { + jj_gc = 0; + for (int i = 0; i < jj_2_rtns.length; i++) { + JJCalls c = jj_2_rtns[i]; + while (c != null) { + if (c.gen < jj_gen) c.first = null; + c = c.next; + } + } + } + return token; + } + token = oldToken; + jj_kind = kind; + throw generateParseException(); + } + + static private final class LookaheadSuccess extends java.lang.Error { } + final private LookaheadSuccess jj_ls = new LookaheadSuccess(); + private boolean jj_scan_token(int kind) { + if (jj_scanpos == jj_lastpos) { + jj_la--; + if (jj_scanpos.next == null) { + jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); + } else { + jj_lastpos = jj_scanpos = jj_scanpos.next; + } + } else { + jj_scanpos = jj_scanpos.next; + } + if (jj_rescan) { + int i = 0; Token tok = token; + while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } + if (tok != null) jj_add_error_token(kind, i); + } + if (jj_scanpos.kind != kind) return true; + if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; + return false; + } + + +/** Get the next Token. */ + final public Token getNextToken() { + if (token.next != null) token = token.next; + else token = token.next = token_source.getNextToken(); + jj_ntk = -1; + jj_gen++; + return token; + } + +/** Get the specific Token. */ + final public Token getToken(int index) { + Token t = token; + for (int i = 0; i < index; i++) { + if (t.next != null) t = t.next; + else t = t.next = token_source.getNextToken(); + } + return t; + } + + private int jj_ntk() { + if ((jj_nt=token.next) == null) + return (jj_ntk = (token.next=token_source.getNextToken()).kind); + else + return (jj_ntk = jj_nt.kind); + } + + private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>(); + private int[] jj_expentry; + private int jj_kind = -1; + private int[] jj_lasttokens = new int[100]; + private int jj_endpos; + + private void jj_add_error_token(int kind, int pos) { + if (pos >= 100) return; + if (pos == jj_endpos + 1) { + jj_lasttokens[jj_endpos++] = kind; + } else if (jj_endpos != 0) { + jj_expentry = new int[jj_endpos]; + for (int i = 0; i < jj_endpos; i++) { + jj_expentry[i] = jj_lasttokens[i]; + } + jj_entries_loop: for (java.util.Iterator<?> it = jj_expentries.iterator(); it.hasNext();) { + int[] oldentry = (int[])(it.next()); + if (oldentry.length == jj_expentry.length) { + for (int i = 0; i < jj_expentry.length; i++) { + if (oldentry[i] != jj_expentry[i]) { + continue jj_entries_loop; + } + } + jj_expentries.add(jj_expentry); + break jj_entries_loop; + } + } + if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; + } + } + + /** Generate ParseException. */ + public ParseException generateParseException() { + jj_expentries.clear(); + boolean[] la1tokens = new boolean[25]; + if (jj_kind >= 0) { + la1tokens[jj_kind] = true; + jj_kind = -1; + } + for (int i = 0; i < 3; i++) { + if (jj_la1[i] == jj_gen) { + for (int j = 0; j < 32; j++) { + if ((jj_la1_0[i] & (1<<j)) != 0) { + la1tokens[j] = true; + } + } + } + } + for (int i = 0; i < 25; i++) { + if (la1tokens[i]) { + jj_expentry = new int[1]; + jj_expentry[0] = i; + jj_expentries.add(jj_expentry); + } + } + jj_endpos = 0; + jj_rescan_token(); + jj_add_error_token(0, 0); + int[][] exptokseq = new int[jj_expentries.size()][]; + for (int i = 0; i < jj_expentries.size(); i++) { + exptokseq[i] = jj_expentries.get(i); + } + return new ParseException(token, exptokseq, tokenImage); + } + + /** Enable tracing. */ + final public void enable_tracing() { + } + + /** Disable tracing. */ + final public void disable_tracing() { + } + + private void jj_rescan_token() { + jj_rescan = true; + for (int i = 0; i < 6; i++) { + try { + JJCalls p = jj_2_rtns[i]; + do { + if (p.gen > jj_gen) { + jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; + switch (i) { + case 0: jj_3_1(); break; + case 1: jj_3_2(); break; + case 2: jj_3_3(); break; + case 3: jj_3_4(); break; + case 4: jj_3_5(); break; + case 5: jj_3_6(); break; + } + } + p = p.next; + } while (p != null); + } catch(LookaheadSuccess ls) { } + } + jj_rescan = false; + } + + private void jj_save(int index, int xla) { + JJCalls p = jj_2_rtns[index]; + while (p.gen > jj_gen) { + if (p.next == null) { p = p.next = new JJCalls(); break; } + p = p.next; + } + p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; + } + + static final class JJCalls { + int gen; + Token first; + int arg; + JJCalls next; + } + +} Added: trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserConstants.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserConstants.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserConstants.java 2011-11-02 12:26:53 UTC (rev 3359) @@ -0,0 +1,78 @@ +/* Generated By:JavaCC: Do not edit this line. ManchesterSyntaxParserConstants.java */ +package org.dllearner.parser; + + +/** + * Token literal values and constants. + * Generated by org.javacc.parser.OtherFilesGen#start() + */ +public interface ManchesterSyntaxParserConstants { + + /** End of File. */ + int EOF = 0; + /** RegularExpression Id. */ + int SINGLE_LINE_COMMENT = 5; + /** RegularExpression Id. */ + int FORMAL_COMMENT = 6; + /** RegularExpression Id. */ + int MULTI_LINE_COMMENT = 7; + /** RegularExpression Id. */ + int NUMBER = 8; + /** RegularExpression Id. */ + int DOUBLE = 9; + /** RegularExpression Id. */ + int TOP = 10; + /** RegularExpression Id. */ + int BOTTOM = 11; + /** RegularExpression Id. */ + int AND = 12; + /** RegularExpression Id. */ + int OR = 13; + /** RegularExpression Id. */ + int SOME = 14; + /** RegularExpression Id. */ + int ONLY = 15; + /** RegularExpression Id. */ + int NOT = 16; + /** RegularExpression Id. */ + int GE = 17; + /** RegularExpression Id. */ + int LE = 18; + /** RegularExpression Id. */ + int STRING = 19; + /** RegularExpression Id. */ + int URI = 20; + + /** Lexical state. */ + int DEFAULT = 0; + + /** Literal token values. */ + String[] tokenImage = { + "<EOF>", + "\" \"", + "\"\\t\"", + "\"\\n\"", + "\"\\r\"", + "<SINGLE_LINE_COMMENT>", + "<FORMAL_COMMENT>", + "<MULTI_LINE_COMMENT>", + "<NUMBER>", + "<DOUBLE>", + "\"TOP\"", + "\"BOTTOM\"", + "\"and\"", + "\"or\"", + "\"some\"", + "\"only\"", + "\"not\"", + "\">=\"", + "\"<=\"", + "<STRING>", + "<URI>", + "\"(\"", + "\")\"", + "\".\"", + "\"value\"", + }; + +} Added: trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java 2011-11-02 12:26:53 UTC (rev 3359) @@ -0,0 +1,692 @@ +/* Generated By:JavaCC: Do not edit this line. ManchesterSyntaxParserTokenManager.java */ +package org.dllearner.parser; +import org.dllearner.core.owl.*; +import java.io.*; +import java.net.URL; + +/** Token Manager. */ +public class ManchesterSyntaxParserTokenManager implements ManchesterSyntaxParserConstants +{ + + /** Debug output. */ + public java.io.PrintStream debugStream = System.out; + /** Set debug output. */ + public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } +private final int jjStopStringLiteralDfa_0(int pos, long active0) +{ + switch (pos) + { + case 0: + if ((active0 & 0x40000L) != 0L) + return 31; + return -1; + case 1: + if ((active0 & 0x40000L) != 0L) + return 31; + return -1; + default : + return -1; + } +} +private final int jjStartNfa_0(int pos, long active0) +{ + return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); +} +private int jjStopAtPos(int pos, int kind) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + return pos + 1; +} +private int jjMoveStringLiteralDfa0_0() +{ + switch(curChar) + { + case 40: + return jjStopAtPos(0, 21); + case 41: + return jjStopAtPos(0, 22); + case 46: + return jjStopAtPos(0, 23); + case 60: + return jjMoveStringLiteralDfa1_0(0x40000L); + case 62: + return jjMoveStringLiteralDfa1_0(0x20000L); + case 66: + return jjMoveStringLiteralDfa1_0(0x800L); + case 84: + return jjMoveStringLiteralDfa1_0(0x400L); + case 97: + return jjMoveStringLiteralDfa1_0(0x1000L); + case 110: + return jjMoveStringLiteralDfa1_0(0x10000L); + case 111: + return jjMoveStringLiteralDfa1_0(0xa000L); + case 115: + return jjMoveStringLiteralDfa1_0(0x4000L); + case 118: + return jjMoveStringLiteralDfa1_0(0x1000000L); + default : + return jjMoveNfa_0(0, 0); + } +} +private int jjMoveStringLiteralDfa1_0(long active0) +{ + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(0, active0); + return 1; + } + switch(curChar) + { + case 61: + if ((active0 & 0x20000L) != 0L) + return jjStopAtPos(1, 17); + else if ((active0 & 0x40000L) != 0L) + return jjStartNfaWithStates_0(1, 18, 31); + break; + case 79: + return jjMoveStringLiteralDfa2_0(active0, 0xc00L); + case 97: + return jjMoveStringLiteralDfa2_0(active0, 0x1000000L); + case 110: + return jjMoveStringLiteralDfa2_0(active0, 0x9000L); + case 111: + return jjMoveStringLiteralDfa2_0(active0, 0x14000L); + case 114: + if ((active0 & 0x2000L) != 0L) + return jjStopAtPos(1, 13); + break; + default : + break; + } + return jjStartNfa_0(0, active0); +} +private int jjMoveStringLiteralDfa2_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(0, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(1, active0); + return 2; + } + switch(curChar) + { + case 80: + if ((active0 & 0x400L) != 0L) + return jjStopAtPos(2, 10); + break; + case 84: + return jjMoveStringLiteralDfa3_0(active0, 0x800L); + case 100: + if ((active0 & 0x1000L) != 0L) + return jjStopAtPos(2, 12); + break; + case 108: + return jjMoveStringLiteralDfa3_0(active0, 0x1008000L); + case 109: + return jjMoveStringLiteralDfa3_0(active0, 0x4000L); + case 116: + if ((active0 & 0x10000L) != 0L) + return jjStopAtPos(2, 16); + break; + default : + break; + } + return jjStartNfa_0(1, active0); +} +private int jjMoveStringLiteralDfa3_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(1, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(2, active0); + return 3; + } + switch(curChar) + { + case 84: + return jjMoveStringLiteralDfa4_0(active0, 0x800L); + case 101: + if ((active0 & 0x4000L) != 0L) + return jjStopAtPos(3, 14); + break; + case 117: + return jjMoveStringLiteralDfa4_0(active0, 0x1000000L); + case 121: + if ((active0 & 0x8000L) != 0L) + return jjStopAtPos(3, 15); + break; + default : + break; + } + return jjStartNfa_0(2, active0); +} +private int jjMoveStringLiteralDfa4_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(2, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(3, active0); + return 4; + } + switch(curChar) + { + case 79: + return jjMoveStringLiteralDfa5_0(active0, 0x800L); + case 101: + if ((active0 & 0x1000000L) != 0L) + return jjStopAtPos(4, 24); + break; + default : + break; + } + return jjStartNfa_0(3, active0); +} +private int jjMoveStringLiteralDfa5_0(long old0, long active0) +{ + if (((active0 &= old0)) == 0L) + return jjStartNfa_0(3, old0); + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { + jjStopStringLiteralDfa_0(4, active0); + return 5; + } + switch(curChar) + { + case 77: + if ((active0 & 0x800L) != 0L) + return jjStopAtPos(5, 11); + break; + default : + break; + } + return jjStartNfa_0(4, active0); +} +private int jjStartNfaWithStates_0(int pos, int kind, int state) +{ + jjmatchedKind = kind; + jjmatchedPos = pos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return pos + 1; } + return jjMoveNfa_0(state, pos + 1); +} +static final long[] jjbitVec0 = { + 0x0L, 0x0L, 0xffffffffffffffffL, 0xffffffffffffffffL +}; +private int jjMoveNfa_0(int startState, int curPos) +{ + int startsAt = 0; + jjnewStateCnt = 31; + int i = 1; + jjstateSet[0] = startState; + int kind = 0x7fffffff; + for (;;) + { + if (++jjround == 0x7fffffff) + ReInitRounds(); + if (curChar < 64) + { + long l = 1L << curChar; + do + { + switch(jjstateSet[--i]) + { + case 31: + if ((0xbfffffffffffdbffL & l) != 0L) + jjCheckNAddTwoStates(4, 5); + else if (curChar == 62) + { + if (kind > 20) + kind = 20; + } + break; + case 0: + if ((0x3fe000000000000L & l) != 0L) + { + if (kind > 8) + kind = 8; + jjCheckNAddStates(0, 2); + } + else if (curChar == 48) + { + if (kind > 8) + kind = 8; + jjCheckNAdd(28); + } + else if (curChar == 47) + jjAddStates(3, 5); + else if (curChar == 60) + jjCheckNAddTwoStates(4, 5); + else if (curChar == 34) + jjCheckNAddTwoStates(1, 2); + break; + case 1: + if ((0xfffffffbffffdbffL & l) != 0L) + jjCheckNAddTwoStates(1, 2); + break; + case 2: + if (curChar == 34 && kind > 19) + kind = 19; + break; + case 3: + if (curChar == 60) + jjCheckNAddTwoStates(4, 5); + break; + case 4: + if ((0xbfffffffffffdbffL & l) != 0L) + jjCheckNAddTwoStates(4, 5); + break; + case 5: + if (curChar == 62 && kind > 20) + kind = 20; + break; + case 6: + if (curChar == 47) + jjAddStates(3, 5); + break; + case 7: + if (curChar == 47) + jjCheckNAddStates(6, 8); + break; + case 8: + if ((0xffffffffffffdbffL & l) != 0L) + jjCheckNAddStates(6, 8); + break; + case 9: + if ((0x2400L & l) != 0L && kind > 5) + kind = 5; + break; + case 10: + if (curChar == 10 && kind > 5) + kind = 5; + break; + case 11: + if (curChar == 13) + jjstateSet[jjnewStateCnt++] = 10; + break; + case 12: + if (curChar == 42) + jjCheckNAddTwoStates(13, 14); + break; + case 13: + if ((0xfffffbffffffffffL & l) != 0L) + jjCheckNAddTwoStates(13, 14); + break; + case 14: + if (curChar == 42) + jjCheckNAddStates(9, 11); + break; + case 15: + if ((0xffff7bffffffffffL & l) != 0L) + jjCheckNAddTwoStates(16, 14); + break; + case 16: + if ((0xfffffbffffffffffL & l) != 0L) + jjCheckNAddTwoStates(16, 14); + break; + case 17: + if (curChar == 47 && kind > 6) + kind = 6; + break; + case 18: + if (curChar == 42) + jjstateSet[jjnewStateCnt++] = 12; + break; + case 19: + if (curChar == 42) + jjCheckNAddTwoStates(20, 21); + break; + case 20: + if ((0xfffffbffffffffffL & l) != 0L) + jjCheckNAddTwoStates(20, 21); + break; + case 21: + if (curChar == 42) + jjCheckNAddStates(12, 14); + break; + case 22: + if ((0xffff7bffffffffffL & l) != 0L) + jjCheckNAddTwoStates(23, 21); + break; + case 23: + if ((0xfffffbffffffffffL & l) != 0L) + jjCheckNAddTwoStates(23, 21); + break; + case 24: + if (curChar == 47 && kind > 7) + kind = 7; + break; + case 25: + if ((0x3fe000000000000L & l) == 0L) + break; + if (kind > 8) + kind = 8; + jjCheckNAddStates(0, 2); + break; + case 26: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 8) + kind = 8; + jjCheckNAdd(26); + break; + case 27: + if ((0x3ff000000000000L & l) != 0L) + jjCheckNAddTwoStates(27, 28); + break; + case 28: + if (curChar != 46) + break; + if (kind > 9) + kind = 9; + jjCheckNAdd(29); + break; + case 29: + if ((0x3ff000000000000L & l) == 0L) + break; + if (kind > 9) + kind = 9; + jjCheckNAdd(29); + break; + case 30: + if (curChar != 48) + break; + if (kind > 8) + kind = 8; + jjCheckNAdd(28); + break; + default : break; + } + } while(i != startsAt); + } + else if (curChar < 128) + { + long l = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 31: + case 4: + if ((0xffffffffefffffffL & l) != 0L) + jjCheckNAddTwoStates(4, 5); + break; + case 1: + if ((0xffffffffefffffffL & l) != 0L) + jjAddStates(15, 16); + break; + case 8: + jjAddStates(6, 8); + break; + case 13: + jjCheckNAddTwoStates(13, 14); + break; + case 15: + case 16: + jjCheckNAddTwoStates(16, 14); + break; + case 20: + jjCheckNAddTwoStates(20, 21); + break; + case 22: + case 23: + jjCheckNAddTwoStates(23, 21); + break; + default : break; + } + } while(i != startsAt); + } + else + { + int i2 = (curChar & 0xff) >> 6; + long l2 = 1L << (curChar & 077); + do + { + switch(jjstateSet[--i]) + { + case 31: + case 4: + if ((jjbitVec0[i2] & l2) != 0L) + jjCheckNAddTwoStates(4, 5); + break; + case 1: + if ((jjbitVec0[i2] & l2) != 0L) + jjAddStates(15, 16); + break; + case 8: + if ((jjbitVec0[i2] & l2) != 0L) + jjAddStates(6, 8); + break; + case 13: + if ((jjbitVec0[i2] & l2) != 0L) + jjCheckNAddTwoStates(13, 14); + break; + case 15: + case 16: + if ((jjbitVec0[i2] & l2) != 0L) + jjCheckNAddTwoStates(16, 14); + break; + case 20: + if ((jjbitVec0[i2] & l2) != 0L) + jjCheckNAddTwoStates(20, 21); + break; + case 22: + case 23: + if ((jjbitVec0[i2] & l2) != 0L) + jjCheckNAddTwoStates(23, 21); + break; + default : break; + } + } while(i != startsAt); + } + if (kind != 0x7fffffff) + { + jjmatchedKind = kind; + jjmatchedPos = curPos; + kind = 0x7fffffff; + } + ++curPos; + if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt))) + return curPos; + try { curChar = input_stream.readChar(); } + catch(java.io.IOException e) { return curPos; } + } +} +static final int[] jjnextStates = { + 26, 27, 28, 7, 18, 19, 8, 9, 11, 14, 15, 17, 21, 22, 24, 1, + 2, +}; + +/** Token literal values. */ +public static final String[] jjstrLiteralImages = { +"", null, null, null, null, null, null, null, null, null, "\124\117\120", +"\102\117\124\124\117\115", "\141\156\144", "\157\162", "\163\157\155\145", "\157\156\154\171", +"\156\157\164", "\76\75", "\74\75", null, null, "\50", "\51", "\56", "\166\141\154\165\145", }; + +/** Lexer state names. */ +public static final String[] lexStateNames = { + "DEFAULT", +}; +static final long[] jjtoToken = { + 0x1ffff01L, +}; +static final long[] jjtoSkip = { + 0xfeL, +}; +protected SimpleCharStream input_stream; +private final int[] jjrounds = new int[31]; +private final int[] jjstateSet = new int[62]; +protected char curChar; +/** Constructor. */ +public ManchesterSyntaxParserTokenManager(SimpleCharStream stream){ + if (SimpleCharStream.staticFlag) + throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); + input_stream = stream; +} + +/** Constructor. */ +public ManchesterSyntaxParserTokenManager(SimpleCharStream stream, int lexState){ + this(stream); + SwitchTo(lexState); +} + +/** Reinitialise parser. */ +public void ReInit(SimpleCharStream stream) +{ + jjmatchedPos = jjnewStateCnt = 0; + curLexState = defaultLexState; + input_stream = stream; + ReInitRounds(); +} +private void ReInitRounds() +{ + int i; + jjround = 0x80000001; + for (i = 31; i-- > 0;) + jjrounds[i] = 0x80000000; +} + +/** Reinitialise parser. */ +public void ReInit(SimpleCharStream stream, int lexState) +{ + ReInit(stream); + SwitchTo(lexState); +} + +/** Switch to specified lex state. */ +public void SwitchTo(int lexState) +{ + if (lexState >= 1 || lexState < 0) + throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); + else + curLexState = lexState; +} + +protected Token jjFillToken() +{ + final Token t; + final String curTokenImage; + final int beginLine; + final int endLine; + final int beginColumn; + final int endColumn; + String im = jjstrLiteralImages[jjmatchedKind]; + curTokenImage = (im == null) ? input_stream.GetImage() : im; + beginLine = input_stream.getBeginLine(); + beginColumn = input_stream.getBeginColumn(); + endLine = input_stream.getEndLine(); + endColumn = input_stream.getEndColumn(); + t = Token.newToken(jjmatchedKind, curTokenImage); + + t.beginLine = beginLine; + t.endLine = endLine; + t.beginColumn = beginColumn; + t.endColumn = endColumn; + + return t; +} + +int curLexState = 0; +int defaultLexState = 0; +int jjnewStateCnt; +int jjround; +int jjmatchedPos; +int jjmatchedKind; + +/** Get the next Token. */ +public Token getNextToken() +{ + Token matchedToken; + int curPos = 0; + + EOFLoop : + for (;;) + { + try + { + curChar = input_stream.BeginToken(); + } + catch(java.io.IOException e) + { + jjmatchedKind = 0; + matchedToken = jjFillToken(); + return matchedToken; + } + + try { input_stream.backup(0); + while (curChar <= 32 && (0x100002600L & (1L << curChar)) != 0L) + curChar = input_stream.BeginToken(); + } + catch (java.io.IOException e1) { continue EOFLoop; } + jjmatchedKind = 0x7fffffff; + jjmatchedPos = 0; + curPos = jjMoveStringLiteralDfa0_0(); + if (jjmatchedKind != 0x7fffffff) + { + if (jjmatchedPos + 1 < curPos) + input_stream.backup(curPos - jjmatchedPos - 1); + if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L) + { + matchedToken = jjFillToken(); + return matchedToken; + } + else + { + continue EOFLoop; + } + } + int error_line = input_stream.getEndLine(); + int error_column = input_stream.getEndColumn(); + String error_after = null; + boolean EOFSeen = false; + try { input_stream.readChar(); input_stream.backup(1); } + catch (java.io.IOException e1) { + EOFSeen = true; + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + if (curChar == '\n' || curChar == '\r') { + error_line++; + error_column = 0; + } + else + error_column++; + } + if (!EOFSeen) { + input_stream.backup(1); + error_after = curPos <= 1 ? "" : input_stream.GetImage(); + } + throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); + } +} + +private void jjCheckNAdd(int state) +{ + if (jjrounds[state] != jjround) + { + jjstateSet[jjnewStateCnt++] = state; + jjrounds[state] = jjround; + } +} +private void jjAddStates(int start, int end) +{ + do { + jjstateSet[jjnewStateCnt++] = jjnextStates[start]; + } while (start++ != end); +} +private void jjCheckNAddTwoStates(int state1, int state2) +{ + jjCheckNAdd(state1); + jjCheckNAdd(state2); +} + +private void jjCheckNAddStates(int start, int end) +{ + do { + jjCheckNAdd(jjnextStates[start]); + } while (start++ != end); +} + +} Added: trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj (rev 0) +++ trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj 2011-11-02 12:26:53 UTC (rev 3359) @@ -0,0 +1,159 @@ +/** + * Copyright (C) 2011, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +options { + JDK_VERSION = "1.5"; + STATIC = false; +} + +PARSER_BEGIN(ManchesterSyntaxParser) +package org.dllearner.parser; + +import org.dllearner.core.owl.*; +import java.io.*; +import java.net.URL; + +public class ManchesterSyntaxParser { + + public static Description parseClassExpression(String classExpression) throws ParseException { + ManchesterSyntaxParser parser = new ManchesterSyntaxParser(new StringReader(classExpression)); + return parser.ClassExpression(); + } + +} +PARSER_END(ManchesterSyntaxParser) + +SKIP : +{ + " " +| "\t" +| "\n" +| "\r" +| <SINGLE_LINE_COMMENT: "//" (~["\n","\r"])* ("\n"|"\r"|"\r\n")> +| <FORMAL_COMMENT: "/**" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/"> +| <MULTI_LINE_COMMENT: "/*" (~["*"])* "*" ("*" | (~["*","/"] (~["*"])* "*"))* "/"> +} + +TOKEN : +{ + < NUMBER: (["1"-"9"] (["0"-"9"])* | "0") > + | < DOUBLE: (["1"-"9"] (["0"-"9"])* | "0") "." (["0"-"9"])* > + | < TOP: "TOP" > + | < BOTTOM: "BOTTOM" > + | < AND: "and" > + | < OR: "or" > + | < SOME: "some" > + | < ONLY: "only" > + | < NOT: "not" > + | < GE: ">=" > + | < LE: "<=" > + | < STRING: "\"" (~["\"","\\","\n","\r"])* "\"" > + | < URI: "<" (~[">","\\","\n","\r"])* ">" > +} + +Description ClassExpression() : +{ + Description c,c1,c2; + String s,s1,s2; + int i; +} +{ + <TOP> {return new Thing();} + | <BOTTOM> {return new Nothing();} + // parse until next AND or OR + | LOOKAHEAD( "(" ClassExpression() <AND>) + "(" c1=ClassExpression() <AND> c2=ClassExpression() ")" + {return new Intersection(c1,c2);} + | LOOKAHEAD( "(" ClassExpression() <OR>) + "(" c1=ClassExpression() <OR> c2=ClassExpression() ")" + {return new Union(c1,c2);} + | LOOKAHEAD( URI() <SOME>) + s=URI() <SOME> c=ClassExpression() + {return new ObjectSomeRestriction(new ObjectProperty(s),c); } + | LOOKAHEAD( URI() <ONLY>) + s=URI() <ONLY> c=ClassExpression() + {return new ObjectAllRestriction(new ObjectProperty(s),c); } + | <NOT> c=ClassExpression() + {return new Negation(c); } + | <GE> i=Integer() s=URI() "." c=ClassExpression() + {return new ObjectMinCardinalityRestriction(i,new ObjectProperty(s),c);} + | <LE> i=Integer() s=URI() "." c=ClassExpression() + {return new ObjectMaxCardinalityRestriction(i,new ObjectProperty(s),c);} + | LOOKAHEAD(4) + "(" s1=URI() "value" s2=URI() ")" + { return new ObjectValueRestriction(new ObjectProperty(s1), new Individual(s2)); } + | LOOKAHEAD(4) + "(" s1=URI() "value" s2=String() ")" + { return new StringValueRestriction(new DatatypeProperty(s1), s2); } + // if none of the other cases matches, it is just a named class + | s = URI() {return new NamedClass(s);} +} + +double Double() : +{ + Token t; +} +{ + t=<DOUBLE> + { + return new Double(t.image); + } +} + +int Integer() : +{ + Token t; +} +{ + t=<NUMBER> + { + return new Integer(t.image); + } +} + +String String() : +{ + Token t; + String s; +} +{ + t=<STRING> + { + // cut quotes + s = t.image; + s = s.substring(1, s.length() - 1); + return s; + } +} + +String URI() : +{ + Token t; + String s; +} +{ + t=<URI> + { + // cut "<" and ">" + s = t.image; + s = s.substring(1, s.length() - 1); + return s; + } +} \ No newline at end of file Modified: trunk/components-core/src/main/java/org/dllearner/utilities/owl/ManchesterOWLSyntaxParser.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/owl/ManchesterOWLSyntaxParser.java 2011-11-02 09:08:56 UTC (rev 3358) +++ trunk/components-core/src/main/java/org/dllearner/utilities/owl/ManchesterOWLSyntaxParser.java 2011-11-02 12:26:53 UTC (rev 3359) @@ -22,6 +22,8 @@ import org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxEditorParser; import org.dllearner.core.owl.Description; import org.dllearner.kb.sparql.SparqlQueryDescriptionConvertVisitor; +import org.dllearner.parser.ManchesterSyntaxParser; +import org.dllearner.parser.ParseException; import org.semanticweb.owlapi.apibinding.OWLManager; import org.semanticweb.owlapi.expression.ParserException; import org.semanticweb.owlapi.model.OWLClassExpression; @@ -42,14 +44,16 @@ return parser.parseClassExpression(); } - public static Description getDescription(String manchesterSyntaxDescription) throws ParserException { - OWLClassExpression d = getOWLAPIDescription(manchesterSyntaxDescription); - return DLLearnerDescriptionConvertVisitor.getDLLearnerDescription(d); + public static Description getDescription(String manchesterSyntaxDescription) throws ParseException { +// OWLClassExpression d = getOWLAPIDescription(manchesterSyntaxDescription); +// return DLLearnerDescriptionConvertVisitor.getDLLearnerDescription(d); + return ManchesterSyntaxParser.parseClassExpression(manchesterSyntaxDescription); } + - public static void main(String args[]) throws ParserException { - Description d = ManchesterOWLSyntaxParser.getDescription("hasP SOME A"); - SparqlQueryDescriptionConvertVisitor.getSparqlQuery(d, 10, false, false); - } +// public static void main(String args[]) throws ParserException { +// Description d = ManchesterOWLSyntaxParser.getDescription("hasP SOME A"); +// SparqlQueryDescriptionConvertVisitor.getSparqlQuery(d, 10, false, false); +// } } Modified: trunk/components-core/src/test/java/org/dllearner/test/junit/OWLAPITests.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/OWLAPITests.java 2011-11-02 09:08:56 UTC (rev 3358) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/OWLAPITests.java 2011-11-02 12:26:53 UTC (rev 3359) @@ -20,9 +20,9 @@ package org.dllearner.test.junit; import org.dllearner.core.owl.Description; +import org.dllearner.parser.ParseException; import org.dllearner.utilities.owl.ManchesterOWLSyntaxParser; import org.junit.Test; -import org.semanticweb.owlapi.expression.ParserException; /** * @@ -34,7 +34,7 @@ public class OWLAPITests { @Test - public void testManchesterSyntaxParser() throws ParserException { + public void testManchesterSyntaxParser() throws ParseException { // String s = "BIGPROP SOME smallclass"; // String s = "<http://test.de/prop> some <http://test.de/Class>"; String s = "<http://test.de/Class>"; Modified: trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java 2011-11-02 09:08:56 UTC (rev 3358) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java 2011-11-02 12:26:53 UTC (rev 3359) @@ -24,6 +24,7 @@ import org.dllearner.core.owl.Description; import org.dllearner.kb.sparql.SparqlQueryDescriptionConvertVisitor; import org.dllearner.parser.KBParser; +import org.dllearner.parser.ManchesterSyntaxParser; import org.dllearner.parser.ParseException; import org.junit.Test; @@ -47,6 +48,36 @@ } @Test + public void ManchesterParserTest() throws ParseException { + String[] tests = new String[] { + // simple URI + "<http://example.com/foo>", + // existential restriction + "<http://example.com/prop> some <http://example.com/class>", + // universal restriction + "<http://example.com/prop> only <http://example.com/class>", + // intersection + "(<http://example.com/class1> and <http://example.com/class2>)", + // disjunction + "(<http://example.com/class1> or <http://example.com/class2>)", + // has value + "(<http://example.com/prop> value <http://example.com/ind>)", + // has value with string + "(<http://example.com/prop> value \"string\")", + // nested expression + "<http://example.com/prop> some (<http://example.com/class1> and <http://example.com/class2>)", + }; + + // loop through all test cases + for(String test : tests) { + System.out.print(test + " --> "); + Description d = ManchesterSyntaxParser.parseClassExpression(test); + System.out.println(d.toManchesterSyntaxString(null, null)); + } + + } + + @Test public void ParseAndSPARQLConvertTest() throws ParseException { // add your test strings here (do not use prefixes) String[] kbArray = new String[] { Modified: trunk/examples/father.conf =================================================================== --- trunk/examples/father.conf 2011-11-02 09:08:56 UTC (rev 3358) +++ trunk/examples/father.conf 2011-11-02 12:26:53 UTC (rev 3359) @@ -25,4 +25,3 @@ // create learning algorithm to run alg.type = "ocel" - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-02 12:46:10
|
Revision: 3360 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3360&view=rev Author: jenslehmann Date: 2011-11-02 12:46:04 +0000 (Wed, 02 Nov 2011) Log Message: ----------- improvements of Manchester syntax parser Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf Modified: trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java 2011-11-02 12:26:53 UTC (rev 3359) +++ trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java 2011-11-02 12:46:04 UTC (rev 3360) @@ -42,14 +42,18 @@ jj_consume_token(22); {if (true) return new Union(c1,c2);} } else if (jj_2_3(2147483647)) { + jj_consume_token(21); s = URI(); jj_consume_token(SOME); c = ClassExpression(); + jj_consume_token(22); {if (true) return new ObjectSomeRestriction(new ObjectProperty(s),c);} } else if (jj_2_4(2147483647)) { + jj_consume_token(21); s = URI(); jj_consume_token(ONLY); c = ClassExpression(); + jj_consume_token(22); {if (true) return new ObjectAllRestriction(new ObjectProperty(s),c);} } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { @@ -192,9 +196,11 @@ } private boolean jj_3R_8() { + if (jj_scan_token(21)) return true; if (jj_3R_2()) return true; if (jj_scan_token(SOME)) return true; if (jj_3R_1()) return true; + if (jj_scan_token(22)) return true; return false; } @@ -291,6 +297,7 @@ } private boolean jj_3_4() { + if (jj_scan_token(21)) return true; if (jj_3R_2()) return true; if (jj_scan_token(ONLY)) return true; return false; @@ -306,6 +313,7 @@ } private boolean jj_3_3() { + if (jj_scan_token(21)) return true; if (jj_3R_2()) return true; if (jj_scan_token(SOME)) return true; return false; @@ -350,9 +358,11 @@ } private boolean jj_3R_9() { + if (jj_scan_token(21)) return true; if (jj_3R_2()) return true; if (jj_scan_token(ONLY)) return true; if (jj_3R_1()) return true; + if (jj_scan_token(22)) return true; return false; } Modified: trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj 2011-11-02 12:26:53 UTC (rev 3359) +++ trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj 2011-11-02 12:46:04 UTC (rev 3360) @@ -84,11 +84,11 @@ | LOOKAHEAD( "(" ClassExpression() <OR>) "(" c1=ClassExpression() <OR> c2=ClassExpression() ")" {return new Union(c1,c2);} - | LOOKAHEAD( URI() <SOME>) - s=URI() <SOME> c=ClassExpression() + | LOOKAHEAD( "(" URI() <SOME>) + "(" s=URI() <SOME> c=ClassExpression() ")" {return new ObjectSomeRestriction(new ObjectProperty(s),c); } - | LOOKAHEAD( URI() <ONLY>) - s=URI() <ONLY> c=ClassExpression() + | LOOKAHEAD( "(" URI() <ONLY>) + "(" s=URI() <ONLY> c=ClassExpression() ")" {return new ObjectAllRestriction(new ObjectProperty(s),c); } | <NOT> c=ClassExpression() {return new Negation(c); } Modified: trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java 2011-11-02 12:26:53 UTC (rev 3359) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java 2011-11-02 12:46:04 UTC (rev 3360) @@ -53,9 +53,9 @@ // simple URI "<http://example.com/foo>", // existential restriction - "<http://example.com/prop> some <http://example.com/class>", + "(<http://example.com/prop> some <http://example.com/class>)", // universal restriction - "<http://example.com/prop> only <http://example.com/class>", + "(<http://example.com/prop> only <http://example.com/class>)", // intersection "(<http://example.com/class1> and <http://example.com/class2>)", // disjunction @@ -65,7 +65,9 @@ // has value with string "(<http://example.com/prop> value \"string\")", // nested expression - "<http://example.com/prop> some (<http://example.com/class1> and <http://example.com/class2>)", + "(<http://example.com/prop> some (<http://example.com/class1> and <http://example.com/class2>))", + // another nested expression + "(<http://nlp2rdf.lod2.eu/schema/string/Document> and (<http://nlp2rdf.lod2.eu/schema/string/subStringTrans> some <http://www.w3.org/2002/07/owl#Thing>))", }; // loop through all test cases Modified: trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf =================================================================== --- trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-02 12:26:53 UTC (rev 3359) +++ trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-02 12:46:04 UTC (rev 3360) @@ -34,11 +34,11 @@ op.useStringDatatypes = true //op.frequencyThreshold = 1 alg.type = "celoe" -alg.writeSearchTree = true +// alg.writeSearchTree = true alg.replaceSearchTree = true alg.maxExecutionTimeInSeconds = 100 alg.maxNrOfResults = 10 +alg.startClass = "(<http://nlp2rdf.lod2.eu/schema/string/Document> and (<http://nlp2rdf.lod2.eu/schema/string/subStringTrans> some <http://www.w3.org/2002/07/owl#Thing>))" - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-02 14:07:37
|
Revision: 3361 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3361&view=rev Author: jenslehmann Date: 2011-11-02 14:07:30 +0000 (Wed, 02 Nov 2011) Log Message: ----------- - fixed a difficult to find bug in the refinement operator for string datatypes (related to an optimisation using property ranges) - added support for single quoted strings in manchester parser (allows to use strings in conf files) Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-11-02 12:46:04 UTC (rev 3360) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-11-02 14:07:30 UTC (rev 3361) @@ -453,7 +453,7 @@ // for(Description refinement : refinements) { // System.out.println("refinement: " + refinement); // } -// if(loop % 100 == 0) { +// if((loop+1) % 500 == 0) { // System.out.println(getMinimumHorizontalExpansion() + " - " + getMaximumHorizontalExpansion()); // System.exit(0); // } Modified: trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java 2011-11-02 12:46:04 UTC (rev 3360) +++ trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParser.java 2011-11-02 14:07:30 UTC (rev 3361) @@ -190,11 +190,6 @@ finally { jj_save(5, xla); } } - private boolean jj_3R_3() { - if (jj_scan_token(STRING)) return true; - return false; - } - private boolean jj_3R_8() { if (jj_scan_token(21)) return true; if (jj_3R_2()) return true; @@ -366,6 +361,11 @@ return false; } + private boolean jj_3R_3() { + if (jj_scan_token(STRING)) return true; + return false; + } + /** Generated Token Manager. */ public ManchesterSyntaxParserTokenManager token_source; SimpleCharStream jj_input_stream; Modified: trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java 2011-11-02 12:46:04 UTC (rev 3360) +++ trunk/components-core/src/main/java/org/dllearner/parser/ManchesterSyntaxParserTokenManager.java 2011-11-02 14:07:30 UTC (rev 3361) @@ -18,11 +18,11 @@ { case 0: if ((active0 & 0x40000L) != 0L) - return 31; + return 34; return -1; case 1: if ((active0 & 0x40000L) != 0L) - return 31; + return 34; return -1; default : return -1; @@ -83,7 +83,7 @@ if ((active0 & 0x20000L) != 0L) return jjStopAtPos(1, 17); else if ((active0 & 0x40000L) != 0L) - return jjStartNfaWithStates_0(1, 18, 31); + return jjStartNfaWithStates_0(1, 18, 34); break; case 79: return jjMoveStringLiteralDfa2_0(active0, 0xc00L); @@ -220,7 +220,7 @@ private int jjMoveNfa_0(int startState, int curPos) { int startsAt = 0; - jjnewStateCnt = 31; + jjnewStateCnt = 34; int i = 1; jjstateSet[0] = startState; int kind = 0x7fffffff; @@ -235,15 +235,6 @@ { switch(jjstateSet[--i]) { - case 31: - if ((0xbfffffffffffdbffL & l) != 0L) - jjCheckNAddTwoStates(4, 5); - else if (curChar == 62) - { - if (kind > 20) - kind = 20; - } - break; case 0: if ((0x3fe000000000000L & l) != 0L) { @@ -255,15 +246,26 @@ { if (kind > 8) kind = 8; - jjCheckNAdd(28); + jjCheckNAdd(31); } else if (curChar == 47) jjAddStates(3, 5); else if (curChar == 60) + jjCheckNAddTwoStates(7, 8); + else if (curChar == 39) jjCheckNAddTwoStates(4, 5); else if (curChar == 34) jjCheckNAddTwoStates(1, 2); break; + case 34: + if ((0xbfffffffffffdbffL & l) != 0L) + jjCheckNAddTwoStates(7, 8); + else if (curChar == 62) + { + if (kind > 20) + kind = 20; + } + break; case 1: if ((0xfffffffbffffdbffL & l) != 0L) jjCheckNAddTwoStates(1, 2); @@ -273,131 +275,143 @@ kind = 19; break; case 3: - if (curChar == 60) + if (curChar == 39) jjCheckNAddTwoStates(4, 5); break; case 4: - if ((0xbfffffffffffdbffL & l) != 0L) + if ((0xfffffffbffffdbffL & l) != 0L) jjCheckNAddTwoStates(4, 5); break; case 5: + if (curChar == 39 && kind > 19) + kind = 19; + break; + case 6: + if (curChar == 60) + jjCheckNAddTwoStates(7, 8); + break; + case 7: + if ((0xbfffffffffffdbffL & l) != 0L) + jjCheckNAddTwoStates(7, 8); + break; + case 8: if (curChar == 62 && kind > 20) kind = 20; break; - case 6: + case 9: if (curChar == 47) jjAddStates(3, 5); break; - case 7: + case 10: if (curChar == 47) jjCheckNAddStates(6, 8); break; - case 8: + case 11: if ((0xffffffffffffdbffL & l) != 0L) jjCheckNAddStates(6, 8); break; - case 9: + case 12: if ((0x2400L & l) != 0L && kind > 5) kind = 5; break; - case 10: + case 13: if (curChar == 10 && kind > 5) kind = 5; break; - case 11: + case 14: if (curChar == 13) - jjstateSet[jjnewStateCnt++] = 10; + jjstateSet[jjnewStateCnt++] = 13; break; - case 12: + case 15: if (curChar == 42) - jjCheckNAddTwoStates(13, 14); + jjCheckNAddTwoStates(16, 17); break; - case 13: + case 16: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddTwoStates(13, 14); + jjCheckNAddTwoStates(16, 17); break; - case 14: + case 17: if (curChar == 42) jjCheckNAddStates(9, 11); break; - case 15: + case 18: if ((0xffff7bffffffffffL & l) != 0L) - jjCheckNAddTwoStates(16, 14); + jjCheckNAddTwoStates(19, 17); break; - case 16: + case 19: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddTwoStates(16, 14); + jjCheckNAddTwoStates(19, 17); break; - case 17: + case 20: if (curChar == 47 && kind > 6) kind = 6; break; - case 18: + case 21: if (curChar == 42) - jjstateSet[jjnewStateCnt++] = 12; + jjstateSet[jjnewStateCnt++] = 15; break; - case 19: + case 22: if (curChar == 42) - jjCheckNAddTwoStates(20, 21); + jjCheckNAddTwoStates(23, 24); break; - case 20: + case 23: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddTwoStates(20, 21); + jjCheckNAddTwoStates(23, 24); break; - case 21: + case 24: if (curChar == 42) jjCheckNAddStates(12, 14); break; - case 22: + case 25: if ((0xffff7bffffffffffL & l) != 0L) - jjCheckNAddTwoStates(23, 21); + jjCheckNAddTwoStates(26, 24); break; - case 23: + case 26: if ((0xfffffbffffffffffL & l) != 0L) - jjCheckNAddTwoStates(23, 21); + jjCheckNAddTwoStates(26, 24); break; - case 24: + case 27: if (curChar == 47 && kind > 7) kind = 7; break; - case 25: + case 28: if ((0x3fe000000000000L & l) == 0L) break; if (kind > 8) kind = 8; jjCheckNAddStates(0, 2); break; - case 26: + case 29: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 8) kind = 8; - jjCheckNAdd(26); + jjCheckNAdd(29); break; - case 27: + case 30: if ((0x3ff000000000000L & l) != 0L) - jjCheckNAddTwoStates(27, 28); + jjCheckNAddTwoStates(30, 31); break; - case 28: + case 31: if (curChar != 46) break; if (kind > 9) kind = 9; - jjCheckNAdd(29); + jjCheckNAdd(32); break; - case 29: + case 32: if ((0x3ff000000000000L & l) == 0L) break; if (kind > 9) kind = 9; - jjCheckNAdd(29); + jjCheckNAdd(32); break; - case 30: + case 33: if (curChar != 48) break; if (kind > 8) kind = 8; - jjCheckNAdd(28); + jjCheckNAdd(31); break; default : break; } @@ -410,32 +424,36 @@ { switch(jjstateSet[--i]) { - case 31: - case 4: + case 34: + case 7: if ((0xffffffffefffffffL & l) != 0L) - jjCheckNAddTwoStates(4, 5); + jjCheckNAddTwoStates(7, 8); break; case 1: if ((0xffffffffefffffffL & l) != 0L) jjAddStates(15, 16); break; - case 8: + case 4: + if ((0xffffffffefffffffL & l) != 0L) + jjAddStates(17, 18); + break; + case 11: jjAddStates(6, 8); break; - case 13: - jjCheckNAddTwoStates(13, 14); - break; - case 15: case 16: - jjCheckNAddTwoStates(16, 14); + jjCheckNAddTwoStates(16, 17); break; - case 20: - jjCheckNAddTwoStates(20, 21); + case 18: + case 19: + jjCheckNAddTwoStates(19, 17); break; - case 22: case 23: - jjCheckNAddTwoStates(23, 21); + jjCheckNAddTwoStates(23, 24); break; + case 25: + case 26: + jjCheckNAddTwoStates(26, 24); + break; default : break; } } while(i != startsAt); @@ -448,37 +466,41 @@ { switch(jjstateSet[--i]) { - case 31: - case 4: + case 34: + case 7: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddTwoStates(4, 5); + jjCheckNAddTwoStates(7, 8); break; case 1: if ((jjbitVec0[i2] & l2) != 0L) jjAddStates(15, 16); break; - case 8: + case 4: if ((jjbitVec0[i2] & l2) != 0L) - jjAddStates(6, 8); + jjAddStates(17, 18); break; - case 13: + case 11: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddTwoStates(13, 14); + jjAddStates(6, 8); break; - case 15: case 16: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddTwoStates(16, 14); + jjCheckNAddTwoStates(16, 17); break; - case 20: + case 18: + case 19: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddTwoStates(20, 21); + jjCheckNAddTwoStates(19, 17); break; - case 22: case 23: if ((jjbitVec0[i2] & l2) != 0L) - jjCheckNAddTwoStates(23, 21); + jjCheckNAddTwoStates(23, 24); break; + case 25: + case 26: + if ((jjbitVec0[i2] & l2) != 0L) + jjCheckNAddTwoStates(26, 24); + break; default : break; } } while(i != startsAt); @@ -490,15 +512,15 @@ kind = 0x7fffffff; } ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 31 - (jjnewStateCnt = startsAt))) + if ((i = jjnewStateCnt) == (startsAt = 34 - (jjnewStateCnt = startsAt))) return curPos; try { curChar = input_stream.readChar(); } catch(java.io.IOException e) { return curPos; } } } static final int[] jjnextStates = { - 26, 27, 28, 7, 18, 19, 8, 9, 11, 14, 15, 17, 21, 22, 24, 1, - 2, + 29, 30, 31, 10, 21, 22, 11, 12, 14, 17, 18, 20, 24, 25, 27, 1, + 2, 4, 5, }; /** Token literal values. */ @@ -518,8 +540,8 @@ 0xfeL, }; protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[31]; -private final int[] jjstateSet = new int[62]; +private final int[] jjrounds = new int[34]; +private final int[] jjstateSet = new int[68]; protected char curChar; /** Constructor. */ public ManchesterSyntaxParserTokenManager(SimpleCharStream stream){ @@ -546,7 +568,7 @@ { int i; jjround = 0x80000001; - for (i = 31; i-- > 0;) + for (i = 34; i-- > 0;) jjrounds[i] = 0x80000000; } Modified: trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj =================================================================== --- trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj 2011-11-02 12:46:04 UTC (rev 3360) +++ trunk/components-core/src/main/java/org/dllearner/parser/manchester.jj 2011-11-02 14:07:30 UTC (rev 3361) @@ -64,7 +64,8 @@ | < NOT: "not" > | < GE: ">=" > | < LE: "<=" > - | < STRING: "\"" (~["\"","\\","\n","\r"])* "\"" > + // support single quotes and double quotes + | < STRING: "\"" (~["\"","\\","\n","\r"])* "\"" | "'" (~["\"","\\","\n","\r"])* "'"> | < URI: "<" (~[">","\\","\n","\r"])* ">" > } Modified: trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java 2011-11-02 12:46:04 UTC (rev 3360) +++ trunk/components-core/src/main/java/org/dllearner/refinementoperators/RhoDRDown.java 2011-11-02 14:07:30 UTC (rev 3361) @@ -145,6 +145,7 @@ private Map<NamedClass, Set<ObjectProperty>> appOP = new TreeMap<NamedClass, Set<ObjectProperty>>(); private Map<NamedClass, Set<DatatypeProperty>> appBD = new TreeMap<NamedClass, Set<DatatypeProperty>>(); private Map<NamedClass, Set<DatatypeProperty>> appDD = new TreeMap<NamedClass, Set<DatatypeProperty>>(); + private Map<NamedClass, Set<DatatypeProperty>> appSD = new TreeMap<NamedClass, Set<DatatypeProperty>>(); // most general applicable properties private Map<NamedClass,Set<ObjectProperty>> mgr = new TreeMap<NamedClass,Set<ObjectProperty>>(); @@ -838,6 +839,7 @@ private void computeTopRefinements(int maxLength, NamedClass domain) { long topComputationTimeStartNs = System.nanoTime(); +// System.out.println("computing top refinements for " + domain + " up to length " + maxLength); if(domain == null && m.size() == 0) computeM(); @@ -957,6 +959,12 @@ topARefinementsLength.put(domain,maxLength); topComputationTimeNs += System.nanoTime() - topComputationTimeStartNs; + +// if(domain == null) { +// System.out.println("computed top refinements: " + topRefinementsCumulative.get(maxLength)); +// } else { +// System.out.println("computed top refinements: " + topARefinementsCumulative.get(domain).get(maxLength)); +// } } // compute M_\top @@ -1046,6 +1054,8 @@ } m.put(4,m4); +// System.out.println("m: " + m); + mComputationTimeNs += System.nanoTime() - mComputationTimeStartNs; } @@ -1183,7 +1193,7 @@ } mA.get(nc).put(4,m4); -// System.out.println(mA.get(nc)); +// System.out.println("m for " + nc + ": " + mA.get(nc)); mComputationTimeNs += System.nanoTime() - mComputationTimeStartNs; } @@ -1330,7 +1340,7 @@ private void computeMgsdRecursive(NamedClass domain, Set<DatatypeProperty> currProperties, Set<DatatypeProperty> mgsdTmp) { for(DatatypeProperty prop : currProperties) { - if(appDD.get(domain).contains(prop)) + if(appSD.get(domain).contains(prop)) mgsdTmp.add(prop); else computeMgsdRecursive(domain, reasoner.getSubProperties(prop), mgsdTmp); @@ -1372,7 +1382,19 @@ if(!isDisjoint(domain,d)) applicableDDPs.add(role); } - appDD.put(domain, applicableDDPs); + appDD.put(domain, applicableDDPs); + + // string datatype properties + Set<DatatypeProperty> mostGeneralSDPs = reasoner.getStringDatatypeProperties(); + Set<DatatypeProperty> applicableSDPs = new TreeSet<DatatypeProperty>(); + for(DatatypeProperty role : mostGeneralSDPs) { +// Description d = (NamedClass) rs.getDomain(role); + Description d = reasoner.getDomain(role); +// System.out.println("domain: " + d); + if(!isDisjoint(domain,d)) + applicableSDPs.add(role); + } + appSD.put(domain, applicableSDPs); } // returns true of the intersection contains elements disjoint Modified: trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java =================================================================== --- trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java 2011-11-02 12:46:04 UTC (rev 3360) +++ trunk/components-core/src/test/java/org/dllearner/test/junit/ParserTests.java 2011-11-02 14:07:30 UTC (rev 3361) @@ -68,6 +68,8 @@ "(<http://example.com/prop> some (<http://example.com/class1> and <http://example.com/class2>))", // another nested expression "(<http://nlp2rdf.lod2.eu/schema/string/Document> and (<http://nlp2rdf.lod2.eu/schema/string/subStringTrans> some <http://www.w3.org/2002/07/owl#Thing>))", + // a test with a single quoted string + "(<http://nlp2rdf.lod2.eu/schema/string/Document> and (<http://nlp2rdf.lod2.eu/schema/string/subStringTrans> some ( <http://nlp2rdf.lod2.eu/schema/sso/lemma> value 'copper')))" }; // loop through all test cases Modified: trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf =================================================================== --- trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-02 12:46:04 UTC (rev 3360) +++ trunk/examples/nlp2rdf/reuters_gold_vs_copper/learn.conf 2011-11-02 14:07:30 UTC (rev 3361) @@ -36,9 +36,10 @@ alg.type = "celoe" // alg.writeSearchTree = true alg.replaceSearchTree = true -alg.maxExecutionTimeInSeconds = 100 +alg.maxExecutionTimeInSeconds = 10 alg.maxNrOfResults = 10 alg.startClass = "(<http://nlp2rdf.lod2.eu/schema/string/Document> and (<http://nlp2rdf.lod2.eu/schema/string/subStringTrans> some <http://www.w3.org/2002/07/owl#Thing>))" +// solution: +// alg.startClass = "(<http://nlp2rdf.lod2.eu/schema/string/Document> and (<http://nlp2rdf.lod2.eu/schema/string/subStringTrans> some ( <http://nlp2rdf.lod2.eu/schema/sso/lemma> value 'copper')))" - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-02 19:33:00
|
Revision: 3363 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3363&view=rev Author: jenslehmann Date: 2011-11-02 19:32:53 +0000 (Wed, 02 Nov 2011) Log Message: ----------- cross validation for the new command line interface Modified Paths: -------------- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java Added Paths: ----------- trunk/examples/cross-validation/ trunk/examples/cross-validation/father.conf trunk/examples/cross-validation/father.owl trunk/examples/cross-validation/father.xml trunk/interfaces/src/main/java/org/dllearner/cli/CrossValidation.java Added: trunk/examples/cross-validation/father.conf =================================================================== --- trunk/examples/cross-validation/father.conf (rev 0) +++ trunk/examples/cross-validation/father.conf 2011-11-02 19:32:53 UTC (rev 3363) @@ -0,0 +1,33 @@ +/** + * Father Example + * + * possible solution: + * male AND EXISTS hasChild.TOP + * + * Copyright (C) 2007, Jens Lehmann + */ + +// perform cross validation +cli.type = "org.dllearner.cli.CLI" +cli.writeSpringConfiguration = true +cli.performCrossValidation = true +cli.nrOfFolds = 3 + +// declare some prefixes to use as abbreviations +prefixes = [ ("ex","http://example.com/father#") ] + +// knowledge source definition +ks.type = "OWL File" +ks.fileName = "father.owl" + +// reasoner +reasoner.type = "fast instance checker" +reasoner.sources = { ks } + +// learning problem +lp.type = "posNegStandard" +lp.positiveExamples = { "ex:stefan", "ex:markus", "ex:martin" } +lp.negativeExamples = { "ex:heinz", "ex:anna", "ex:michelle" } + +// create learning algorithm to run +alg.type = "ocel" Added: trunk/examples/cross-validation/father.owl =================================================================== --- trunk/examples/cross-validation/father.owl (rev 0) +++ trunk/examples/cross-validation/father.owl 2011-11-02 19:32:53 UTC (rev 3363) @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<rdf:RDF + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:xsd="http://www.w3.org/2001/XMLSchema#" + xmlns="http://example.com/father#" + xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" + xmlns:owl="http://www.w3.org/2002/07/owl#" + xml:base="http://example.com/father"> + <owl:Ontology rdf:about=""/> + <owl:Class rdf:ID="female"/> + <owl:Class rdf:ID="male"> + <owl:equivalentClass> + <owl:Class> + <owl:complementOf rdf:resource="#female"/> + </owl:Class> + </owl:equivalentClass> + </owl:Class> + <owl:ObjectProperty rdf:ID="hasChild"/> + <male rdf:ID="markus"> + <hasChild> + <female rdf:ID="anna"> + <hasChild> + <male rdf:ID="heinz"/> + </hasChild> + </female> + </hasChild> + </male> + <male rdf:ID="stefan"> + <hasChild rdf:resource="#markus"/> + </male> + <female rdf:ID="michelle"/> + <male rdf:ID="martin"> + <hasChild rdf:resource="#heinz"/> + </male> +</rdf:RDF> Added: trunk/examples/cross-validation/father.xml =================================================================== --- trunk/examples/cross-validation/father.xml (rev 0) +++ trunk/examples/cross-validation/father.xml 2011-11-02 19:32:53 UTC (rev 3363) @@ -0,0 +1,32 @@ +<beans xmlns="http://www.springframework.org/schema/beans"> + <bean class="org.dllearner.algorithms.ocel.OCEL" name="alg"/> + <bean class="org.dllearner.kb.OWLFile" name="ks"> + <property name="fileName" value="father.owl"/> + </bean> + <bean class="org.dllearner.learningproblems.PosNegLPStandard" name="lp"> + <property name="positiveExamples"> + <set> + <value>http://example.com/father#markus</value> + <value>http://example.com/father#stefan</value> + <value>http://example.com/father#martin</value> + </set> + </property> + <property name="negativeExamples"> + <set> + <value>http://example.com/father#heinz</value> + <value>http://example.com/father#anna</value> + <value>http://example.com/father#michelle</value> + </set> + </property> + </bean> + <bean class="org.dllearner.cli.CLI" name="cli"> + <property name="writeSpringConfiguration"/> + </bean> + <bean class="org.dllearner.reasoning.FastInstanceChecker" name="reasoner"> + <property name="sources"> + <set> + <ref bean="ks"/> + </set> + </property> + </bean> +</beans> \ No newline at end of file Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-11-02 14:37:35 UTC (rev 3362) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-11-02 19:32:53 UTC (rev 3363) @@ -38,8 +38,10 @@ import org.dllearner.confparser3.ConfParserConfiguration; import org.dllearner.confparser3.ParseException; import org.dllearner.core.AbstractCELA; +import org.dllearner.core.AbstractReasonerComponent; import org.dllearner.core.LearningAlgorithm; import org.dllearner.core.ReasoningMethodUnsupportedException; +import org.dllearner.learningproblems.PosNegLP; import org.dllearner.utilities.Files; import org.springframework.context.ApplicationContext; import org.springframework.core.io.FileSystemResource; @@ -57,59 +59,65 @@ private static Logger logger = Logger.getLogger(CLI.class); private static Logger rootLogger = Logger.getRootLogger(); - private boolean writeSpringConfiguration = false; private ApplicationContext context; + private File confFile; - public CLI(File file) throws IOException{ - Resource confFile = new FileSystemResource(file); + // some CLI options + private boolean writeSpringConfiguration = false; + private boolean performCrossValidation = false; + private int nrOfFolds = 10; + + public CLI() { - List<Resource> springConfigResources = new ArrayList<Resource>(); + } + + public CLI(File confFile) { + this(); + this.confFile = confFile; + } + + public void run() throws IOException { // ApplicationContext context, String algorithmBeanName){ + + IConfiguration configuration = null; + + if(context == null) { + Resource confFileR = new FileSystemResource(confFile); + List<Resource> springConfigResources = new ArrayList<Resource>(); + configuration = new ConfParserConfiguration(confFileR); - //DL-Learner Configuration Object - IConfiguration configuration = new ConfParserConfiguration(confFile); - - ApplicationContextBuilder builder = new DefaultApplicationContextBuilder(); - context = builder.buildApplicationContext(configuration,springConfigResources); - - // a lot of debugging stuff -// FastInstanceChecker fi = context.getBean("reasoner", FastInstanceChecker.class); -// System.out.println(fi.getClassHierarchy()); -// NamedClass male = new NamedClass("http://localhost/foo#male"); -// System.out.println(fi.getIndividuals(new NamedClass("http://localhost/foo#male"))); -// System.out.println(fi.getIndividuals().size()); -// System.out.println("has type: " + fi.hasTypeImpl(male, new Individual("http://localhost/foo#bernd"))); -// -// PosNegLPStandard lp = context.getBean("lp", PosNegLPStandard.class); -// System.out.println(lp.getPositiveExamples()); -// System.out.println(lp.getNegativeExamples()); -// System.out.println(lp.getAccuracy(new NamedClass("http://localhost/foo#male"))); - - // get a CLI bean if it exists - CLI cli = null; - if(context.getBeansOfType(CLI.class).size()>0) { - System.out.println(); - cli = context.getBean(CLI.class); + ApplicationContextBuilder builder = new DefaultApplicationContextBuilder(); + ApplicationContext context = builder.buildApplicationContext(configuration,springConfigResources); + } + + if(writeSpringConfiguration) { SpringConfigurationXMLBeanConverter converter = new SpringConfigurationXMLBeanConverter(); - XmlObject xml = converter.convert(configuration); - String springFilename = file.getCanonicalPath().replace(".conf", ".xml"); + XmlObject xml; + if(configuration == null) { + Resource confFileR = new FileSystemResource(confFile); + configuration = new ConfParserConfiguration(confFileR); + xml = converter.convert(configuration); + } else { + xml = converter.convert(configuration); + } + String springFilename = confFile.getCanonicalPath().replace(".conf", ".xml"); File springFile = new File(springFilename); if(springFile.exists()) { logger.warn("Cannot write Spring configuration, because " + springFilename + " already exists."); } else { Files.createFile(springFile, xml.toString()); - } -// SpringConfigurationXMLBeanConverter converter; - } - - // start algorithm in conf file -// LearningAlgorithm algorithm = context.getBean("alg",LearningAlgorithm.class); -// algorithm.start(); - } + } + } + + if(performCrossValidation) { + AbstractReasonerComponent rs = context.getBean(AbstractReasonerComponent.class); + PosNegLP lp = context.getBean(PosNegLP.class); + AbstractCELA la = context.getBean(AbstractCELA.class); + new CrossValidation(la,lp,rs,nrOfFolds,false); + } else { + LearningAlgorithm algorithm = context.getBean(LearningAlgorithm.class); + algorithm.start(); + } - public void run() { // ApplicationContext context, String algorithmBeanName){ - LearningAlgorithm algorithm = context.getBean(LearningAlgorithm.class); -// LearningAlgorithm algorithm = context.getBean(algorithmBeanName, LearningAlgorithm.class); - algorithm.start(); } public boolean isWriteSpringConfiguration() { @@ -150,12 +158,61 @@ System.exit(0); } - CLI cli = new CLI(file); + Resource confFile = new FileSystemResource(file); + + List<Resource> springConfigResources = new ArrayList<Resource>(); + + //DL-Learner Configuration Object + IConfiguration configuration = new ConfParserConfiguration(confFile); + + ApplicationContextBuilder builder = new DefaultApplicationContextBuilder(); + ApplicationContext context = builder.buildApplicationContext(configuration,springConfigResources); + + // TODO: later we could check which command line interface is specified in the conf file + // for now we just use the default one + + CLI cli; + if(context.containsBean("cli")) { + cli = (CLI) context.getBean("cli"); + } else { + cli = new CLI(); + } + cli.setContext(context); + cli.setConfFile(file); cli.run(); + } + public void setContext(ApplicationContext context) { + this.context = context; + } + public ApplicationContext getContext() { return context; } + public File getConfFile() { + return confFile; + } + + public void setConfFile(File confFile) { + this.confFile = confFile; + } + + public boolean isPerformCrossValidation() { + return performCrossValidation; + } + + public void setPerformCrossValidation(boolean performCrossValiation) { + this.performCrossValidation = performCrossValiation; + } + + public int getNrOfFolds() { + return nrOfFolds; + } + + public void setNrOfFolds(int nrOfFolds) { + this.nrOfFolds = nrOfFolds; + } + } Added: trunk/interfaces/src/main/java/org/dllearner/cli/CrossValidation.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CrossValidation.java (rev 0) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CrossValidation.java 2011-11-02 19:32:53 UTC (rev 3363) @@ -0,0 +1,286 @@ +/** + * Copyright (C) 2007-2008, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.cli; + +import java.io.File; +import java.io.FileNotFoundException; +import java.text.DecimalFormat; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Random; +import java.util.Set; + +import org.apache.log4j.ConsoleAppender; +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.apache.log4j.SimpleLayout; +import org.dllearner.core.ComponentInitException; +import org.dllearner.core.ComponentManager; +import org.dllearner.core.AbstractCELA; +import org.dllearner.core.AbstractLearningProblem; +import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.owl.Description; +import org.dllearner.core.owl.Individual; +import org.dllearner.learningproblems.Heuristics; +import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.learningproblems.PosOnlyLP; +import org.dllearner.utilities.Helper; +import org.dllearner.utilities.datastructures.Datastructures; +import org.dllearner.utilities.statistics.Stat; +import org.dllearner.utilities.Files; + +/** + * Performs cross validation for the given problem. Supports + * k-fold cross-validation and leave-one-out cross-validation. + * + * @author Jens Lehmann + * + */ +public class CrossValidation { + + private static Logger logger = Logger.getRootLogger(); + + // statistical values + private Stat runtime = new Stat(); + private Stat accuracy = new Stat(); + private Stat length = new Stat(); + private Stat accuracyTraining = new Stat(); + private Stat fMeasure = new Stat(); + private Stat fMeasureTraining = new Stat(); + private static boolean writeToFile = false; + private static File outputFile; + + public CrossValidation(AbstractCELA la, PosNegLP lp, AbstractReasonerComponent rs, int folds, boolean leaveOneOut) { + + DecimalFormat df = new DecimalFormat(); + + // the training and test sets used later on + List<Set<Individual>> trainingSetsPos = new LinkedList<Set<Individual>>(); + List<Set<Individual>> trainingSetsNeg = new LinkedList<Set<Individual>>(); + List<Set<Individual>> testSetsPos = new LinkedList<Set<Individual>>(); + List<Set<Individual>> testSetsNeg = new LinkedList<Set<Individual>>(); + + // get examples and shuffle them too + Set<Individual> posExamples = ((PosNegLP)lp).getPositiveExamples(); + List<Individual> posExamplesList = new LinkedList<Individual>(posExamples); + Collections.shuffle(posExamplesList, new Random(1)); + Set<Individual> negExamples = ((PosNegLP)lp).getNegativeExamples(); + List<Individual> negExamplesList = new LinkedList<Individual>(negExamples); + Collections.shuffle(negExamplesList, new Random(2)); + + // sanity check whether nr. of folds makes sense for this benchmark + if(!leaveOneOut && (posExamples.size()<folds && negExamples.size()<folds)) { + System.out.println("The number of folds is higher than the number of " + + "positive/negative examples. This can result in empty test sets. Exiting."); + System.exit(0); + } + + if(leaveOneOut) { + // note that leave-one-out is not identical to k-fold with + // k = nr. of examples in the current implementation, because + // with n folds and n examples there is no guarantee that a fold + // is never empty (this is an implementation issue) + int nrOfExamples = posExamples.size() + negExamples.size(); + for(int i = 0; i < nrOfExamples; i++) { + // ... + } + System.out.println("Leave-one-out not supported yet."); + System.exit(1); + } else { + // calculating where to split the sets, ; note that we split + // positive and negative examples separately such that the + // distribution of positive and negative examples remains similar + // (note that there are better but more complex ways to implement this, + // which guarantee that the sum of the elements of a fold for pos + // and neg differs by at most 1 - it can differ by 2 in our implementation, + // e.g. with 3 folds, 4 pos. examples, 4 neg. examples) + int[] splitsPos = calculateSplits(posExamples.size(),folds); + int[] splitsNeg = calculateSplits(negExamples.size(),folds); + +// System.out.println(splitsPos[0]); +// System.out.println(splitsNeg[0]); + + // calculating training and test sets + for(int i=0; i<folds; i++) { + Set<Individual> testPos = getTestingSet(posExamplesList, splitsPos, i); + Set<Individual> testNeg = getTestingSet(negExamplesList, splitsNeg, i); + testSetsPos.add(i, testPos); + testSetsNeg.add(i, testNeg); + trainingSetsPos.add(i, getTrainingSet(posExamples, testPos)); + trainingSetsNeg.add(i, getTrainingSet(negExamples, testNeg)); + } + + } + + // run the algorithm + for(int currFold=0; currFold<folds; currFold++) { + + Set<String> pos = Datastructures.individualSetToStringSet(trainingSetsPos.get(currFold)); + Set<String> neg = Datastructures.individualSetToStringSet(trainingSetsNeg.get(currFold)); + lp.setPositiveExamples(trainingSetsPos.get(currFold)); + lp.setNegativeExamples(trainingSetsNeg.get(currFold)); + + try { + lp.init(); + la.init(); + } catch (ComponentInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + long algorithmStartTime = System.nanoTime(); + la.start(); + long algorithmDuration = System.nanoTime() - algorithmStartTime; + runtime.addNumber(algorithmDuration/(double)1000000000); + + Description concept = la.getCurrentlyBestDescription(); + + Set<Individual> tmp = rs.hasType(concept, testSetsPos.get(currFold)); + Set<Individual> tmp2 = Helper.difference(testSetsPos.get(currFold), tmp); + Set<Individual> tmp3 = rs.hasType(concept, testSetsNeg.get(currFold)); + + outputWriter("test set errors pos: " + tmp2); + outputWriter("test set errors neg: " + tmp3); + + // calculate training accuracies + int trainingCorrectPosClassified = getCorrectPosClassified(rs, concept, trainingSetsPos.get(currFold)); + int trainingCorrectNegClassified = getCorrectNegClassified(rs, concept, trainingSetsNeg.get(currFold)); + int trainingCorrectExamples = trainingCorrectPosClassified + trainingCorrectNegClassified; + double trainingAccuracy = 100*((double)trainingCorrectExamples/(trainingSetsPos.get(currFold).size()+ + trainingSetsNeg.get(currFold).size())); + accuracyTraining.addNumber(trainingAccuracy); + // calculate test accuracies + int correctPosClassified = getCorrectPosClassified(rs, concept, testSetsPos.get(currFold)); + int correctNegClassified = getCorrectNegClassified(rs, concept, testSetsNeg.get(currFold)); + int correctExamples = correctPosClassified + correctNegClassified; + double currAccuracy = 100*((double)correctExamples/(testSetsPos.get(currFold).size()+ + testSetsNeg.get(currFold).size())); + accuracy.addNumber(currAccuracy); + // calculate training F-Score + int negAsPosTraining = rs.hasType(concept, trainingSetsNeg.get(currFold)).size(); + double precisionTraining = trainingCorrectPosClassified + negAsPosTraining == 0 ? 0 : trainingCorrectPosClassified / (double) (trainingCorrectPosClassified + negAsPosTraining); + double recallTraining = trainingCorrectPosClassified / (double) trainingSetsPos.get(currFold).size(); + fMeasureTraining.addNumber(100*Heuristics.getFScore(recallTraining, precisionTraining)); + // calculate test F-Score + int negAsPos = rs.hasType(concept, testSetsNeg.get(currFold)).size(); + double precision = correctPosClassified + negAsPos == 0 ? 0 : correctPosClassified / (double) (correctPosClassified + negAsPos); + double recall = correctPosClassified / (double) testSetsPos.get(currFold).size(); +// System.out.println(precision);System.out.println(recall); + fMeasure.addNumber(100*Heuristics.getFScore(recall, precision)); + + length.addNumber(concept.getLength()); + + outputWriter("fold " + currFold + ":"); + outputWriter(" training: " + pos.size() + " positive and " + neg.size() + " negative examples"); + outputWriter(" testing: " + correctPosClassified + "/" + testSetsPos.get(currFold).size() + " correct positives, " + + correctNegClassified + "/" + testSetsNeg.get(currFold).size() + " correct negatives"); + outputWriter(" concept: " + concept); + outputWriter(" accuracy: " + df.format(currAccuracy) + "% (" + df.format(trainingAccuracy) + "% on training set)"); + outputWriter(" length: " + df.format(concept.getLength())); + outputWriter(" runtime: " + df.format(algorithmDuration/(double)1000000000) + "s"); + + } + + outputWriter(""); + outputWriter("Finished " + folds + "-folds cross-validation."); + outputWriter("runtime: " + statOutput(df, runtime, "s")); + outputWriter("length: " + statOutput(df, length, "")); + outputWriter("F-Measure on training set: " + statOutput(df, fMeasureTraining, "%")); + outputWriter("F-Measure: " + statOutput(df, fMeasure, "%")); + outputWriter("predictive accuracy on training set: " + statOutput(df, accuracyTraining, "%")); + outputWriter("predictive accuracy: " + statOutput(df, accuracy, "%")); + + } + + private int getCorrectPosClassified(AbstractReasonerComponent rs, Description concept, Set<Individual> testSetPos) { + return rs.hasType(concept, testSetPos).size(); + } + + private int getCorrectNegClassified(AbstractReasonerComponent rs, Description concept, Set<Individual> testSetNeg) { + return testSetNeg.size() - rs.hasType(concept, testSetNeg).size(); + } + + public static Set<Individual> getTestingSet(List<Individual> examples, int[] splits, int fold) { + int fromIndex; + // we either start from 0 or after the last fold ended + if(fold == 0) + fromIndex = 0; + else + fromIndex = splits[fold-1]; + // the split corresponds to the ends of the folds + int toIndex = splits[fold]; + +// System.out.println("from " + fromIndex + " to " + toIndex); + + Set<Individual> testingSet = new HashSet<Individual>(); + // +1 because 2nd element is exclusive in subList method + testingSet.addAll(examples.subList(fromIndex, toIndex)); + return testingSet; + } + + public static Set<Individual> getTrainingSet(Set<Individual> examples, Set<Individual> testingSet) { + return Helper.difference(examples, testingSet); + } + + // takes nr. of examples and the nr. of folds for this examples; + // returns an array which says where each fold ends, i.e. + // splits[i] is the index of the last element of fold i in the examples + public static int[] calculateSplits(int nrOfExamples, int folds) { + int[] splits = new int[folds]; + for(int i=1; i<=folds; i++) { + // we always round up to the next integer + splits[i-1] = (int)Math.ceil(i*nrOfExamples/(double)folds); + } + return splits; + } + + public static String statOutput(DecimalFormat df, Stat stat, String unit) { + String str = "av. " + df.format(stat.getMean()) + unit; + str += " (deviation " + df.format(stat.getStandardDeviation()) + unit + "; "; + str += "min " + df.format(stat.getMin()) + unit + "; "; + str += "max " + df.format(stat.getMax()) + unit + ")"; + return str; + } + + public Stat getAccuracy() { + return accuracy; + } + + public Stat getLength() { + return length; + } + + public Stat getRuntime() { + return runtime; + } + + private void outputWriter(String output) { + if(writeToFile) { + Files.appendFile(outputFile, output +"\n"); + System.out.println(output); + } else { + System.out.println(output); + } + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-06 14:16:53
|
Revision: 3380 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3380&view=rev Author: jenslehmann Date: 2011-11-06 14:16:46 +0000 (Sun, 06 Nov 2011) Log Message: ----------- NLP2RDF evaluation script Modified Paths: -------------- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java trunk/interfaces/src/main/java/org/dllearner/cli/CrossValidation.java Added Paths: ----------- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-11-05 19:21:09 UTC (rev 3379) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-11-06 14:16:46 UTC (rev 3380) @@ -60,6 +60,7 @@ private static Logger rootLogger = Logger.getRootLogger(); private ApplicationContext context; + private IConfiguration configuration; private File confFile; // some CLI options @@ -76,10 +77,9 @@ this.confFile = confFile; } - public void run() throws IOException { // ApplicationContext context, String algorithmBeanName){ - - IConfiguration configuration = null; - + // separate init methods, because some scripts may want to just get the application + // context from a conf file without actually running it + public void init() throws IOException { if(context == null) { Resource confFileR = new FileSystemResource(confFile); List<Resource> springConfigResources = new ArrayList<Resource>(); @@ -88,7 +88,10 @@ ApplicationContextBuilder builder = new DefaultApplicationContextBuilder(); context = builder.buildApplicationContext(configuration,springConfigResources); } - + } + + public void run() throws IOException { + if(writeSpringConfiguration) { SpringConfigurationXMLBeanConverter converter = new SpringConfigurationXMLBeanConverter(); XmlObject xml; Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CrossValidation.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CrossValidation.java 2011-11-05 19:21:09 UTC (rev 3379) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CrossValidation.java 2011-11-06 14:16:46 UTC (rev 3380) @@ -283,4 +283,12 @@ } + public Stat getfMeasure() { + return fMeasure; + } + + public Stat getfMeasureTraining() { + return fMeasureTraining; + } + } Added: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java (rev 0) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java 2011-11-06 14:16:46 UTC (rev 3380) @@ -0,0 +1,108 @@ +/** + * Copyright (C) 2011, Jens Lehmann + * + * This file is part of DL-Learner. + * + * DL-Learner is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * DL-Learner is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +package org.dllearner.scripts.evaluation; + +import java.io.File; +import java.io.IOException; + +import org.dllearner.cli.CLI; +import org.dllearner.cli.CrossValidation; +import org.dllearner.core.AbstractCELA; +import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.learningproblems.PosNegLP; +import org.dllearner.utilities.Files; +import org.springframework.context.ApplicationContext; + +/** + * Currently, the script is NLP2RDF evaluation specific, but may be generalised later. + * + * - take array of conf files as arguments + * - run cross val over them and get basic stats + * - output to a CSV file + * - run through gnumeric + * + * @author Jens Lehmann + * + */ +public class NLP2RDFEval { + + public static void main(String args[]) throws IOException { + + // TODO: convert those things into command line arguments to make the script generic + int nrOfFolds = 5; + +// String confs[] = new String[] { +// "../examples/nlp2rdf/learning_7_components/stanford/gas9_vs_nat-gas26.conf", +// "../examples/nlp2rdf/learning_7_components/opennlp/gas9_vs_nat-gas26.conf", +// "../examples/nlp2rdf/learning_7_components/gateannie/gas9_vs_nat-gas26.conf", +// "../examples/nlp2rdf/learning_7_components/dbpedia_spotlight/gas9_vs_nat-gas26.conf", +// "../examples/nlp2rdf/learning_7_components/dbpedia_spotlight_plus/gas9_vs_nat-gas26.conf", +// }; +// + String baseDir = "../examples/nlp2rdf/learning_7_components/"; + + String outputFile = "results.csv"; + String content = ""; + + String[] tools = new String[] { + "stanford", "opennlp", "gateannie", "dbpedia_spotlight", "dbpedia_spotlight_plus" //, "combined" + }; + + String topics[] = new String[] { + "gas9_vs_nat-gas26", "copper17_vs_gold35", "oilseed11_vs_soybean35", "veg-oil18_vs_palm-oil17" + }; + // shorter labels for diagram + String topiclabels[] = new String[] { + "gas", "copper", "oilseed", "veg-oil" + }; + + for(String tool : tools) { + content += "," + tool; + } + content += "\n"; + + // loop through topics + for(int i=0; i<topics.length; i++) { + content += topiclabels[i] + ","; + + for(String tool : tools) { + String conf = baseDir + tool + "/" + topics[i] + ".conf"; + File confFile = new File(conf); + System.out.print("Next file: " + confFile); + CLI cli = new CLI(confFile); + cli.init(); + System.out.println("File " + confFile + " initialised."); + + // perform cross validation + ApplicationContext context = cli.getContext(); + AbstractReasonerComponent rs = context.getBean(AbstractReasonerComponent.class); + PosNegLP lp = context.getBean(PosNegLP.class); + AbstractCELA la = context.getBean(AbstractCELA.class); + CrossValidation cv = new CrossValidation(la,lp,rs,nrOfFolds,false); + content += cv.getfMeasure().getMean(); + } + content += "\n"; + } + + Files.createFile(new File(baseDir + outputFile), content); + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-06 20:15:40
|
Revision: 3381 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3381&view=rev Author: jenslehmann Date: 2011-11-06 20:15:33 +0000 (Sun, 06 Nov 2011) Log Message: ----------- small fixes Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java 2011-11-06 14:16:46 UTC (rev 3380) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/FastInstanceChecker.java 2011-11-06 20:15:33 UTC (rev 3381) @@ -249,6 +249,9 @@ // System.out.println("FIC: " + description + " " + individual); if (description instanceof NamedClass) { + if(!atomicConcepts.contains(description)) { + throw new ReasoningMethodUnsupportedException("Class " + description + " is not contained in knowledge base."); + } return classInstancesPos.get((NamedClass) description).contains(individual); } else if (description instanceof Negation) { Description child = description.getChild(0); Modified: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java 2011-11-06 14:16:46 UTC (rev 3380) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java 2011-11-06 20:15:33 UTC (rev 3381) @@ -96,7 +96,7 @@ PosNegLP lp = context.getBean(PosNegLP.class); AbstractCELA la = context.getBean(AbstractCELA.class); CrossValidation cv = new CrossValidation(la,lp,rs,nrOfFolds,false); - content += cv.getfMeasure().getMean(); + content += Math.round(cv.getfMeasure().getMean())+","; } content += "\n"; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-07 10:59:45
|
Revision: 3384 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3384&view=rev Author: jenslehmann Date: 2011-11-07 10:59:39 +0000 (Mon, 07 Nov 2011) Log Message: ----------- bug fix and new config option to work around Pellet bug Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-11-06 21:31:13 UTC (rev 3383) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-11-07 10:59:39 UTC (rev 3384) @@ -94,6 +94,7 @@ private RefinementOperator operator; private DescriptionMinimizer minimizer; + private boolean useMinimizer = true; // all nodes in the search tree (used for selecting most promising node) private TreeSet<OENode> nodes; @@ -760,7 +761,12 @@ private Description rewriteNode(OENode node) { Description description = node.getDescription(); // minimize description (expensive!) - also performes some human friendly rewrites - Description niceDescription = minimizer.minimizeClone(description); + Description niceDescription; + if(useMinimizer) { + niceDescription = minimizer.minimizeClone(description); + } else { + niceDescription = description; + } // replace \exists r.\top with \exists r.range(r) which is easier to read for humans ConceptTransformation.replaceRange(niceDescription, reasoner); return niceDescription; @@ -987,6 +993,14 @@ public void setReuseExistingDescription(boolean reuseExistingDescription) { this.reuseExistingDescription = reuseExistingDescription; + } + + public boolean isUseMinimizer() { + return useMinimizer; + } + + public void setUseMinimizer(boolean useMinimizer) { + this.useMinimizer = useMinimizer; } } Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-11-06 21:31:13 UTC (rev 3383) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-11-07 10:59:39 UTC (rev 3384) @@ -779,7 +779,9 @@ // take one element from the set and ignore the rest // (TODO: we need to make sure we always ignore the same concepts) OWLObjectPropertyExpression property = node.getRepresentativeElement(); - roles.add(new ObjectProperty(property.asOWLObjectProperty().toStringID())); + if(!property.isAnonymous()) { + roles.add(new ObjectProperty(property.asOWLObjectProperty().toStringID())); + } } roles.remove(new ObjectProperty(factory.getOWLTopObjectProperty().toStringID())); roles.remove(new ObjectProperty(factory.getOWLBottomObjectProperty().toStringID())); Modified: trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java =================================================================== --- trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java 2011-11-06 21:31:13 UTC (rev 3383) +++ trunk/scripts/src/main/java/org/dllearner/scripts/evaluation/NLP2RDFEval.java 2011-11-07 10:59:39 UTC (rev 3384) @@ -56,13 +56,17 @@ // "../examples/nlp2rdf/learning_7_components/dbpedia_spotlight_plus/gas9_vs_nat-gas26.conf", // }; // - String baseDir = "../examples/nlp2rdf/learning_7_components/"; +// String baseDir = "../examples/nlp2rdf/learning_7_components/"; + String baseDir = "../examples/nlp2rdf/learning_reduced/"; String outputFile = "results.csv"; String content = ""; + // gate + spotlight plus; gate + snowball; standford + spotlight plus String[] tools = new String[] { - "stanford", "opennlp", "gateannie", "dbpedia_spotlight", "dbpedia_spotlight_plus" //, "combined" + "gateannie_dbpedia_spotlight_plus", + // "gateannie_snowball", zu langsam + "stanford_dbpedia_spotlight_plus", "stanford", "opennlp", "gateannie", "dbpedia_spotlight", "dbpedia_spotlight_plus", "snowball" }; String topics[] = new String[] { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-12 08:14:14
|
Revision: 3397 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3397&view=rev Author: jenslehmann Date: 2011-11-12 08:14:05 +0000 (Sat, 12 Nov 2011) Log Message: ----------- several changes to get QTL algorithm working from conf file Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/core/AbstractLearningProblem.java trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java trunk/components-core/src/main/java/org/dllearner/learningproblems/PosOnlyLP.java trunk/components-ext/src/main/java/org/dllearner/algorithm/qtl/QTL.java trunk/interfaces/pom.xml Added Paths: ----------- trunk/examples/qtl/ trunk/examples/qtl/dbpedia_simple.conf Modified: trunk/components-core/src/main/java/org/dllearner/core/AbstractLearningProblem.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AbstractLearningProblem.java 2011-11-11 15:05:29 UTC (rev 3396) +++ trunk/components-core/src/main/java/org/dllearner/core/AbstractLearningProblem.java 2011-11-12 08:14:05 UTC (rev 3397) @@ -119,7 +119,7 @@ return reasoner; } - @Autowired + @Autowired(required=false) public void setReasoner(AbstractReasonerComponent reasoner) { this.reasoner = reasoner; } Modified: trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java 2011-11-11 15:05:29 UTC (rev 3396) +++ trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java 2011-11-12 08:14:05 UTC (rev 3397) @@ -70,6 +70,7 @@ "org.dllearner.algorithms.properties.SubDataPropertyOfAxiomLearner", "org.dllearner.algorithms.DisjointClassesLearner", "org.dllearner.algorithms.SimpleSubclassLearner", + "org.dllearner.algorithm.qtl.QTL", "org.dllearner.kb.KBFile", "org.dllearner.kb.OWLFile", "org.dllearner.kb.SparqlEndpointKS", Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/PosOnlyLP.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/PosOnlyLP.java 2011-11-11 15:05:29 UTC (rev 3396) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/PosOnlyLP.java 2011-11-12 08:14:05 UTC (rev 3397) @@ -109,10 +109,14 @@ // reasoning options (i.e. options are the same up to reversed example sets) // definitionLP.init(); - individuals = new LinkedList<Individual>(getReasoner().getIndividuals()); + Random rand = new Random(1); + + if(getReasoner()!=null) { + individuals = new LinkedList<Individual>(getReasoner().getIndividuals()); + Collections.shuffle(individuals, rand); + } + positiveExamplesShuffled = new LinkedList<Individual>(positiveExamples); - Random rand = new Random(1); - Collections.shuffle(individuals, rand); Collections.shuffle(positiveExamplesShuffled, rand); } Modified: trunk/components-ext/src/main/java/org/dllearner/algorithm/qtl/QTL.java =================================================================== --- trunk/components-ext/src/main/java/org/dllearner/algorithm/qtl/QTL.java 2011-11-11 15:05:29 UTC (rev 3396) +++ trunk/components-ext/src/main/java/org/dllearner/algorithm/qtl/QTL.java 2011-11-12 08:14:05 UTC (rev 3397) @@ -46,6 +46,7 @@ import org.dllearner.algorithm.qtl.util.SPARQLEndpointEx; import org.dllearner.core.AbstractComponent; import org.dllearner.core.AbstractLearningProblem; +import org.dllearner.core.ComponentAnn; import org.dllearner.core.ComponentManager; import org.dllearner.core.LearningProblemUnsupportedException; import org.dllearner.core.SparqlQueryLearningAlgorithm; @@ -60,6 +61,7 @@ import org.dllearner.learningproblems.PosNegLP; import org.dllearner.learningproblems.PosOnlyLP; import org.dllearner.utilities.Helper; +import org.springframework.beans.factory.annotation.Autowired; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSetRewindable; @@ -76,11 +78,12 @@ * * */ +@ComponentAnn(name="query tree learner", shortName="qtl", version=0.8) public class QTL extends AbstractComponent implements SparqlQueryLearningAlgorithm { private static final Logger logger = Logger.getLogger(QTL.class); - private AbstractLearningProblem lp; + private AbstractLearningProblem learningProblem; private SparqlEndpointKS endpointKS; // private QTLConfigurator configurator; @@ -115,11 +118,15 @@ return options; } + public QTL() { + + } + public QTL(AbstractLearningProblem learningProblem, SparqlEndpointKS endpointKS) throws LearningProblemUnsupportedException{ if(!(learningProblem instanceof PosOnlyLP || learningProblem instanceof PosNegLP)){ throw new LearningProblemUnsupportedException(learningProblem.getClass(), getClass()); } - this.lp = learningProblem; + this.learningProblem = learningProblem; this.endpointKS = endpointKS; // this.configurator = new QTLConfigurator(this); @@ -307,11 +314,11 @@ } public void init() { - if(lp instanceof PosOnlyLP){ - this.posExamples = convert(((PosOnlyLP)lp).getPositiveExamples()); - } else if(lp instanceof PosNegLP){ - this.posExamples = convert(((PosNegLP)lp).getPositiveExamples()); - this.negExamples = convert(((PosNegLP)lp).getNegativeExamples()); + if(learningProblem instanceof PosOnlyLP){ + this.posExamples = convert(((PosOnlyLP)learningProblem).getPositiveExamples()); + } else if(learningProblem instanceof PosNegLP){ + this.posExamples = convert(((PosNegLP)learningProblem).getPositiveExamples()); + this.negExamples = convert(((PosNegLP)learningProblem).getNegativeExamples()); } endpoint = endpointKS.getEndpoint(); @@ -354,5 +361,23 @@ System.out.println(query); } + public AbstractLearningProblem getLearningProblem() { + return learningProblem; + } + + @Autowired + public void setLearningProblem(AbstractLearningProblem learningProblem) { + this.learningProblem = learningProblem; + } + + public SparqlEndpointKS getEndpointKS() { + return endpointKS; + } + + @Autowired + public void setEndpointKS(SparqlEndpointKS endpointKS) { + this.endpointKS = endpointKS; + } + } Added: trunk/examples/qtl/dbpedia_simple.conf =================================================================== --- trunk/examples/qtl/dbpedia_simple.conf (rev 0) +++ trunk/examples/qtl/dbpedia_simple.conf 2011-11-12 08:14:05 UTC (rev 3397) @@ -0,0 +1,12 @@ + +prefixes = [ ("dbr","http://dbpedia.org/resource/") ] + +ks.type = "SPARQL" +ks.url = "http://live.dbpedia.org/sparql" +ks.defaultGraphURIs = { "http://dbpedia.org" } + +// learning problem +lp.type = "posonlylp" +lp.positiveExamples = { "Bob_Dylan", "The_Beatles", "dbr:Aerosmith" } + +alg.type = "qtl" Modified: trunk/interfaces/pom.xml =================================================================== --- trunk/interfaces/pom.xml 2011-11-11 15:05:29 UTC (rev 3396) +++ trunk/interfaces/pom.xml 2011-11-12 08:14:05 UTC (rev 3397) @@ -202,6 +202,10 @@ <groupId>org.dllearner</groupId> <artifactId>components-core</artifactId> </dependency> + <dependency> + <groupId>org.dllearner</groupId> + <artifactId>components-ext</artifactId> + </dependency> <!-- Added the dependency of the core tests so that they will be accessible from the tests in this component --> <dependency> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sha...@us...> - 2011-11-12 23:10:35
|
Revision: 3399 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3399&view=rev Author: shadowtm Date: 2011-11-12 23:10:28 +0000 (Sat, 12 Nov 2011) Log Message: ----------- Cleaned up CLI output so that stacktraces could be minimized and more user friendly messages displayed. Modified Paths: -------------- trunk/components-core/pom.xml trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java trunk/components-core/src/main/java/org/dllearner/algorithms/isle/ISLE.java trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ROLearner2.java trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java trunk/components-ext/pom.xml trunk/interfaces/pom.xml trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java trunk/interfaces/src/main/java/org/dllearner/configuration/spring/ComponentInitializationBeanPostProcessor.java trunk/interfaces/src/main/java/org/dllearner/configuration/spring/DefaultApplicationContextBuilder.java trunk/interfaces/src/main/resources/log4j.properties trunk/interfaces/src/test/java/org/dllearner/configuration/spring/TestBean.java trunk/pom.xml Modified: trunk/components-core/pom.xml =================================================================== --- trunk/components-core/pom.xml 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/components-core/pom.xml 2011-11-12 23:10:28 UTC (rev 3399) @@ -277,11 +277,12 @@ </dependency> + <!-- This module is a library module, so it needs only to have the slf api dependency to enable logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> - <version>1.5.8</version> </dependency> + <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/celoe/CELOE.java 2011-11-12 23:10:28 UTC (rev 3399) @@ -511,6 +511,7 @@ logger.info("Algorithm stopped ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); } else { logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); + logger.info(reasoner.toString()); } if(singleSuggestionMode) { Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2011-11-12 23:10:28 UTC (rev 3399) @@ -514,6 +514,7 @@ logger.info("Algorithm stopped ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); } else { logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); + logger.info(reasoner.toString()); } if(singleSuggestionMode) { Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/isle/ISLE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/isle/ISLE.java 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/isle/ISLE.java 2011-11-12 23:10:28 UTC (rev 3399) @@ -392,6 +392,7 @@ logger.info("Algorithm stopped ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); } else { logger.info("Algorithm terminated successfully ("+expressionTests+" descriptions tested). " + nodes.size() + " nodes in the search tree.\n"); + logger.info(reasoner.toString()); } if(singleSuggestionMode) { Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ROLearner2.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ROLearner2.java 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/ocel/ROLearner2.java 2011-11-12 23:10:28 UTC (rev 3399) @@ -520,6 +520,7 @@ logger.info("Algorithm stopped ("+conceptTests+" descriptions tested).\n"); } else { logger.info("Algorithm terminated successfully ("+conceptTests+" descriptions tested).\n"); + logger.info(rs.toString()); } totalLearningTime.stop(); Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/OWLAPIReasoner.java 2011-11-12 23:10:28 UTC (rev 3399) @@ -147,7 +147,7 @@ Set<OWLOntology> allImports = new HashSet<OWLOntology>(); prefixes = new TreeMap<String, String>(); - + Set<OWLImportsDeclaration> directImports = new HashSet<OWLImportsDeclaration>(); for (AbstractKnowledgeSource source : sources) { @@ -202,9 +202,9 @@ } } catch (OWLOntologyCreationException e) { - e.printStackTrace(); + throw new RuntimeException(e); } catch (URISyntaxException e) { - e.printStackTrace(); + throw new RuntimeException(e); } // all other sources are converted to KB and then to an // OWL API ontology @@ -217,7 +217,7 @@ try { ontology = manager.createOntology(ontologyURI); } catch (OWLOntologyCreationException e) { - e.printStackTrace(); + throw new RuntimeException(e); } OWLAPIAxiomConvertVisitor.fillOWLOntology(manager, ontology, kb); owlAPIOntologies.add(ontology); @@ -232,8 +232,8 @@ ontology = manager.createOntology(IRI.create("http://dl-learner/all"), new HashSet<OWLOntology>(owlAPIOntologies)); //we have to add all import declarations manually here, because this are no axioms List<OWLOntologyChange> addImports = new ArrayList<OWLOntologyChange>(); - for(OWLImportsDeclaration i : directImports){ - addImports.add(new AddImport(ontology, i)); + for (OWLImportsDeclaration i : directImports) { + addImports.add(new AddImport(ontology, i)); } manager.applyChanges(addImports); } catch (OWLOntologyCreationException e1) { @@ -252,7 +252,7 @@ try { reasoner = new FaCTPlusPlusReasonerFactory().createNonBufferingReasoner(ontology, conf); } catch (Exception e) { - e.printStackTrace(); + throw new RuntimeException(e); } System.out.println("Using FaCT++."); } else if (getReasonerTypeString().equals("hermit")) { @@ -340,7 +340,7 @@ for (OWLNamedIndividual owlIndividual : owlIndividuals) { individuals.add(new Individual(owlIndividual.toStringID())); } - + // remove top and bottom properties (for backwards compatibility) // atomicRoles.remove(new ObjectProperty("http://www.w3.org/2002/07/owl#bottomObjectProperty")); // atomicRoles.remove(new ObjectProperty("http://www.w3.org/2002/07/owl#topObjectProperty")); @@ -779,8 +779,8 @@ // take one element from the set and ignore the rest // (TODO: we need to make sure we always ignore the same concepts) OWLObjectPropertyExpression property = node.getRepresentativeElement(); - if(!property.isAnonymous()) { - roles.add(new ObjectProperty(property.asOWLObjectProperty().toStringID())); + if (!property.isAnonymous()) { + roles.add(new ObjectProperty(property.asOWLObjectProperty().toStringID())); } } roles.remove(new ObjectProperty(factory.getOWLTopObjectProperty().toStringID())); Modified: trunk/components-ext/pom.xml =================================================================== --- trunk/components-ext/pom.xml 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/components-ext/pom.xml 2011-11-12 23:10:28 UTC (rev 3399) @@ -52,19 +52,42 @@ <groupId>org.aksw.commons</groupId> <artifactId>sparql</artifactId> </dependency> + <dependency> <groupId>org.apache.solr</groupId> <artifactId>solr-core</artifactId> - <version>3.3.0</version> - <type>jar</type> - <scope>compile</scope> </dependency> + + <!--BEGIN Logging Dependencies--> + + <!--This is the api jar, it's needed at compile time--> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> - <version>1.6.0</version> </dependency> + + <!--This is the bridge that ties calls to the slf4j api to the log4j framework. This is a runtime dependency for programs which wish to use log4j as their implementation.--> <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <scope>runtime</scope> + </dependency> + + <!-- This is the concrete implementation of the log4j framework - it is a runtime dependency that needs to be used with the slf4j-log4j12 dependency --> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <scope>runtime</scope> + </dependency> + <!--END Logging Dependencies--> + + + <dependency> <groupId>edu.stanford</groupId> <artifactId>postagger</artifactId> <version>3.0.2</version> @@ -148,7 +171,6 @@ <dependency> <groupId>org.nlp2rdf</groupId> <artifactId>nif</artifactId> - <version>1.1-SNAPSHOT</version> </dependency> Modified: trunk/interfaces/pom.xml =================================================================== --- trunk/interfaces/pom.xml 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/interfaces/pom.xml 2011-11-12 23:10:28 UTC (rev 3399) @@ -56,9 +56,9 @@ <mainClass>org.dllearner.cli.Enrichment</mainClass> <name>enrichment</name> </program> - <!-- <program> <mainClass>org.dllearner.gui.StartGUI</mainClass> - <name>gui</name> </program> <program> <mainClass>org.dllearner.cli.QuickStart</mainClass> - <name>quickstart</name> </program> <program> <mainClass>org.dllearner.server.DLLearnerWS</mainClass> + <!-- <program> <mainClass>org.dllearner.gui.StartGUI</mainClass> + <name>gui</name> </program> <program> <mainClass>org.dllearner.cli.QuickStart</mainClass> + <name>quickstart</name> </program> <program> <mainClass>org.dllearner.server.DLLearnerWS</mainClass> <name>ws</name> </program> --> </programs> </configuration> @@ -171,10 +171,10 @@ </requestLog> </configuration> <!--execution is used for testing --> - <!--executions> <execution> <id>start-jetty</id> <phase>pre-integration-test</phase> - <goals> <goal>run</goal> </goals> <configuration> <scanIntervalSeconds>0</scanIntervalSeconds> - <daemon>true</daemon> <stopKey>stopKey</stopKey> <stopPort>9999</stopPort> - </configuration> </execution> <execution> <id>stop-jetty</id> <phase>post-integration-test</phase> + <!--executions> <execution> <id>start-jetty</id> <phase>pre-integration-test</phase> + <goals> <goal>run</goal> </goals> <configuration> <scanIntervalSeconds>0</scanIntervalSeconds> + <daemon>true</daemon> <stopKey>stopKey</stopKey> <stopPort>9999</stopPort> + </configuration> </execution> <execution> <id>stop-jetty</id> <phase>post-integration-test</phase> <goals> <goal>stop</goal> </goals> </execution> </executions --> </plugin> @@ -205,8 +205,8 @@ <dependency> <groupId>org.dllearner</groupId> <artifactId>components-ext</artifactId> - </dependency> - <!-- Added the dependency of the core tests so that they will be accessible + </dependency> + <!-- Added the dependency of the core tests so that they will be accessible from the tests in this component --> <dependency> <groupId>org.dllearner</groupId> @@ -267,6 +267,45 @@ <artifactId>spring-xmlbeans-3.0</artifactId> <version>1.0</version> </dependency> + + <dependency> + <groupId>net.sf.jopt-simple</groupId> + <artifactId>jopt-simple</artifactId> + </dependency> + + <dependency> + <groupId>org.json</groupId> + <artifactId>json</artifactId> + </dependency> + + <!--BEGIN Logging Dependencies--> + + <!--This is the api jar, it's needed at compile time--> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + + <!--This is the bridge that ties calls to the slf4j api to the log4j framework. This is a runtime dependency for programs which wish to use log4j as their implementation.--> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <scope>runtime</scope> + </dependency> + + <!--Log4J dependency needed for the runtime as well as some specific compile time calls--> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <scope>runtime</scope> + </dependency> + <!--END Logging Dependencies--> + </dependencies> Modified: trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/interfaces/src/main/java/org/dllearner/cli/CLI.java 2011-11-12 23:10:28 UTC (rev 3399) @@ -20,7 +20,9 @@ package org.dllearner.cli; import java.io.File; +import java.io.FileOutputStream; import java.io.IOException; +import java.io.PrintStream; import java.util.ArrayList; import java.util.List; @@ -139,12 +141,6 @@ */ public static void main(String[] args) throws ParseException, IOException, ReasoningMethodUnsupportedException { - 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"); @@ -168,24 +164,32 @@ //DL-Learner Configuration Object IConfiguration configuration = new ConfParserConfiguration(confFile); - ApplicationContextBuilder builder = new DefaultApplicationContextBuilder(); - ApplicationContext context = builder.buildApplicationContext(configuration,springConfigResources); - - // TODO: later we could check which command line interface is specified in the conf file - // for now we just use the default one - - CLI cli; - if(context.containsBean("cli")) { - cli = (CLI) context.getBean("cli"); - } else { - cli = new CLI(); + try { + ApplicationContextBuilder builder = new DefaultApplicationContextBuilder(); + ApplicationContext context = builder.buildApplicationContext(configuration,springConfigResources); + + // TODO: later we could check which command line interface is specified in the conf file + // for now we just use the default one + + CLI cli; + if(context.containsBean("cli")) { + cli = (CLI) context.getBean("cli"); + } else { + cli = new CLI(); + } + cli.setContext(context); + cli.setConfFile(file); + cli.run(); + } catch (Exception e) { + String stacktraceFileName = "log/error.log"; + logger.error("An Error Occurred During Processing. Terminating DL-Learner...and writing stacktrace to: " + stacktraceFileName); + FileOutputStream fos = new FileOutputStream(stacktraceFileName); + PrintStream ps = new PrintStream(fos); + e.printStackTrace(ps); } - cli.setContext(context); - cli.setConfFile(file); - cli.run(); - - } + } + public void setContext(ApplicationContext context) { this.context = context; } Modified: trunk/interfaces/src/main/java/org/dllearner/configuration/spring/ComponentInitializationBeanPostProcessor.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/configuration/spring/ComponentInitializationBeanPostProcessor.java 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/interfaces/src/main/java/org/dllearner/configuration/spring/ComponentInitializationBeanPostProcessor.java 2011-11-12 23:10:28 UTC (rev 3399) @@ -1,29 +1,49 @@ package org.dllearner.configuration.spring; +import org.dllearner.core.AnnComponentManager; import org.dllearner.core.Component; import org.dllearner.core.ComponentInitException; +import org.dllearner.utilities.Helper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; +import java.util.Date; + /** * Created by IntelliJ IDEA. * User: Chris * Date: 8/23/11 * Time: 7:00 AM - * + * <p/> * Post Processor to initialize our components. */ -public class ComponentInitializationBeanPostProcessor implements BeanPostProcessor{ +public class ComponentInitializationBeanPostProcessor implements BeanPostProcessor { + private static Logger logger = LoggerFactory.getLogger(ComponentInitializationBeanPostProcessor.class); + @Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { - if(bean instanceof Component){ + if (bean instanceof Component) { Component c = (Component) bean; + + String componentName = AnnComponentManager.getName(c); try { + + Date startTime = new Date(); c.init(); + Date stopTime = new Date(); + long elapsedTime = stopTime.getTime() - startTime.getTime(); + + logger.info("Initializing Component \"" + componentName + "\"... OK (" + Helper.prettyPrintMilliSeconds(elapsedTime) + ")"); } catch (ComponentInitException e) { - throw new RuntimeException("Problem initializing the component with beanName: " + beanName,e); + throw new RuntimeException("Problem initializing the component \"" + componentName + "\" with beanName: " + beanName, e); + } catch (Exception e) { + /** Catch any exception as an init exception */ + logger.warn("Could not initialize component \"" + componentName + "\""); + throw new RuntimeException(e); } } return bean; Modified: trunk/interfaces/src/main/java/org/dllearner/configuration/spring/DefaultApplicationContextBuilder.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/configuration/spring/DefaultApplicationContextBuilder.java 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/interfaces/src/main/java/org/dllearner/configuration/spring/DefaultApplicationContextBuilder.java 2011-11-12 23:10:28 UTC (rev 3399) @@ -6,6 +6,9 @@ import java.util.List; import org.dllearner.configuration.IConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; @@ -23,6 +26,8 @@ */ public class DefaultApplicationContextBuilder implements ApplicationContextBuilder{ + private static Logger logger = LoggerFactory.getLogger(DefaultApplicationContextBuilder.class); + @Override public ApplicationContext buildApplicationContext(IConfiguration configuration, List<Resource> springConfigurationLocations) throws IOException{ ConfigurableApplicationContext context = null; @@ -51,7 +56,15 @@ context.addBeanFactoryPostProcessor(beanDefinitionRegistryPostProcessor); //Instantiate and initialize the beans. - context.refresh(); + try { + context.refresh(); + } catch (BeanCreationException e) { + logger.error("There was a problem creating the bean named \"" + e.getBeanName() + "\" - Check your configuration file and try again."); + throw new RuntimeException(e); + } catch (Exception e) { + logger.error("There was a problem initializing the components...shutting down."); + throw new RuntimeException(e); + } return context; } } Modified: trunk/interfaces/src/main/resources/log4j.properties =================================================================== --- trunk/interfaces/src/main/resources/log4j.properties 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/interfaces/src/main/resources/log4j.properties 2011-11-12 23:10:28 UTC (rev 3399) @@ -2,17 +2,20 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss} %-5p %-20c{1} :: %m%n log4j.appender.file=org.apache.log4j.FileAppender log4j.appender.file.File=log/interfaces.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern= %-4r [%t] %-5p %c %x - %m%n -# Joseki server logging -log4j.logger.org.dllearner=DEBUG +# DL-Learner Logs +log4j.logger.org.dllearner=INFO + log4j.logger.org.dllearner.server.nke.LogicalRelationStrategy=DEBUG +# Eliminate most of the Spring Context Loading noise +log4j.logger.org.springframework=WARN + ## log4j.logger.org.joseki.server.http.LocatorServletContext=ALL # Jena, including the Joseki client Modified: trunk/interfaces/src/test/java/org/dllearner/configuration/spring/TestBean.java =================================================================== --- trunk/interfaces/src/test/java/org/dllearner/configuration/spring/TestBean.java 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/interfaces/src/test/java/org/dllearner/configuration/spring/TestBean.java 2011-11-12 23:10:28 UTC (rev 3399) @@ -1,6 +1,7 @@ package org.dllearner.configuration.spring; import org.dllearner.core.Component; +import org.dllearner.core.ComponentAnn; import java.util.Map; import java.util.Set; @@ -13,6 +14,7 @@ * * Test Bean for testing that we can store all the types we need. */ +@ComponentAnn(version = 1,shortName ="tbc", name = "TestBean Component") public class TestBean implements Component{ private String simpleValue; Modified: trunk/pom.xml =================================================================== --- trunk/pom.xml 2011-11-12 09:37:21 UTC (rev 3398) +++ trunk/pom.xml 2011-11-12 23:10:28 UTC (rev 3399) @@ -17,6 +17,9 @@ <!--Define the AKSW dependency version --> <aksw.version>0.1</aksw.version> + + <slf4j.version>1.6.4</slf4j.version> + <log4j.version>1.2.16</log4j.version> </properties> <modules> @@ -29,7 +32,7 @@ </modules> - <!--This is the SCM information, which needs to be here so we can use the + <!--This is the SCM information, which needs to be here so we can use the maven release plugin --> <scm> <connection>scm:svn:https://dl-learner.svn.sourceforge.net/svnroot/dl-learner/trunk</connection> @@ -39,9 +42,9 @@ </scm> <build> - <!-- - Plugin Management defines the plugins that the child components - can use - It's good practice to do this as we can ensure all children use - common versions - of the plugins, and we can look in one place to see all + <!-- - Plugin Management defines the plugins that the child components + can use - It's good practice to do this as we can ensure all children use + common versions - of the plugins, and we can look in one place to see all plugin dependencies. --> <pluginManagement> <plugins> @@ -64,8 +67,8 @@ </configuration> </plugin> - <!-- - Maven Jar Plugin - if you want to create and/or sign jars. - I'm - putting this in so we can create a jar for the test classes - in components + <!-- - Maven Jar Plugin - if you want to create and/or sign jars. - I'm + putting this in so we can create a jar for the test classes - in components core so that other components' tests can leverage them --> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -88,12 +91,12 @@ </build> <dependencyManagement> - <!-- - Dependency Management defines the dependencies at the parent level - - These set the dependencies on a global level and the children are forced - to use the defined version - We do this to ensure consistent dependencies - amongst all children artifacts that are generated by this pom. - - Children - still have to include the dependency, but only the groupId and artifactId - as version is retrieved from the parent. - - Remember, default scope is compile + <!-- - Dependency Management defines the dependencies at the parent level + - These set the dependencies on a global level and the children are forced + to use the defined version - We do this to ensure consistent dependencies + amongst all children artifacts that are generated by this pom. - - Children + still have to include the dependency, but only the groupId and artifactId + as version is retrieved from the parent. - - Remember, default scope is compile in Maven. --> <dependencies> <dependency> @@ -120,19 +123,43 @@ <version>0.9.3</version> </dependency> - <dependency> - <groupId>log4j</groupId> - <artifactId>log4j</artifactId> - <version>1.2.16</version> - </dependency> + <!-- SOLR Dependency --> + <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr-core</artifactId> + <version>3.3.0</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + <exclusion> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + </exclusion> + </exclusions> + </dependency> - <dependency> + <dependency> + <groupId>org.nlp2rdf</groupId> + <artifactId>nif</artifactId> + <version>1.1-SNAPSHOT</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> + </dependency> + + + <dependency> <groupId>com.extjs</groupId> <artifactId>gxt</artifactId> <version>2.2.3</version> </dependency> - <!--Available via central, we use the latest with minor mods to DL Learner + <!--Available via central, we use the latest with minor mods to DL Learner source (IE Dig related code) --> <dependency> <groupId>com.hp.hpl.jena</groupId> @@ -390,12 +417,18 @@ <version>1.0.3</version> <scope>provided</scope> </dependency> - + <!-- Spring --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>3.0.5.RELEASE</version> + <exclusions> + <exclusion> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> <groupId>org.springframework</groupId> @@ -403,6 +436,47 @@ <version>3.0.5.RELEASE</version> </dependency> + <!--BEGIN Logging Dependencies--> + + <!--This is the api jar, it's needed at compile time--> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <version>${slf4j.version}</version> + </dependency> + + <!--This is the bridge that ties calls to the slf4j api to the log4j framework. This is a runtime dependency for programs which wish to use log4j as their implementation.--> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>${slf4j.version}</version> + </dependency> + + <!-- This is the concrete implementation of the log4j framework - it is a runtime dependency that needs to be used with the slf4j-log4j12 dependency --> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>${log4j.version}</version> + </dependency> + + <!--Bridge from JCL to SLF4J. Then we go from SLF4J to our desired logging framework (which for DL-Learner interfaces is Log4J). + - JCL is in use by Spring and so this lets us control the output from the Spring libraries in the same way we control anything else. + - This is also a runtime dependency. + --> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + <version>${slf4j.version}</version> + </dependency> + + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-jdk14</artifactId> + <version>${slf4j.version}</version> + </dependency> + <!--END Logging Dependencies--> + </dependencies> </dependencyManagement> @@ -445,8 +519,8 @@ <url>http://maven.jahia.org/maven2/</url> </repository> - <!-- - This is so we can get the 1.3-SNAPSHOT of GWT Maven Plugin cause - 1.2 is broken on the hudson - - Here's a good place to browse the repository: + <!-- - This is so we can get the 1.3-SNAPSHOT of GWT Maven Plugin cause + 1.2 is broken on the hudson - - Here's a good place to browse the repository: https://nexus.codehaus.org --> <repository> <id>maven.codehaus.snapshots</id> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-16 10:03:54
|
Revision: 3406 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3406&view=rev Author: jenslehmann Date: 2011-11-16 10:03:47 +0000 (Wed, 16 Nov 2011) Log Message: ----------- several changes to get closer to get fuzzy DL working Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLPStandard.java trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java Added Paths: ----------- trunk/test/fuzzydll/fuzzytrains.conf Modified: trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2011-11-15 20:14:39 UTC (rev 3405) +++ trunk/components-core/src/main/java/org/dllearner/algorithms/fuzzydll/FuzzyCELOE.java 2011-11-16 10:03:47 UTC (rev 3406) @@ -34,6 +34,7 @@ import org.dllearner.core.AbstractCELA; import org.dllearner.core.AbstractLearningProblem; import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.ComponentAnn; import org.dllearner.core.ComponentInitException; import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.FuzzyClassExpressionLearningAlgorithm; @@ -78,6 +79,7 @@ * @author Jens Lehmann * */ +@ComponentAnn(name="Fuzzy CELOE", shortName="fceloe", version=0.2, description="See Fuzzy DL-Learner paper published at ISDA 2011.") public class FuzzyCELOE extends AbstractCELA implements FuzzyClassExpressionLearningAlgorithm { private static Logger logger = Logger.getLogger(FuzzyCELOE.class); Modified: trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java 2011-11-15 20:14:39 UTC (rev 3405) +++ trunk/components-core/src/main/java/org/dllearner/core/AnnComponentManager.java 2011-11-16 10:03:47 UTC (rev 3406) @@ -50,7 +50,8 @@ // components must be listed here if they should be supported in interfaces // (CLI, GUI, Web Service) and scripts (HTML documentation generator) private static List<String> componentClassNames = new ArrayList<String> ( Arrays.asList(new String[]{ - "org.dllearner.algorithms.celoe.CELOE", + "org.dllearner.algorithms.celoe.CELOE", + "org.dllearner.algorithms.fuzzydll.FuzzyCELOE", "org.dllearner.algorithms.BruteForceLearner", "org.dllearner.algorithms.RandomGuesser", "org.dllearner.algorithms.properties.DisjointObjectPropertyAxiomLearner", @@ -76,10 +77,12 @@ "org.dllearner.kb.SparqlEndpointKS", "org.dllearner.kb.sparql.SparqlKnowledgeSource", "org.dllearner.learningproblems.PosNegLPStandard", + "org.dllearner.learningproblems.FuzzyPosNegLPStandard", "org.dllearner.learningproblems.PosOnlyLP", "org.dllearner.learningproblems.ClassLearningProblem", "org.dllearner.reasoning.FastInstanceChecker", "org.dllearner.reasoning.OWLAPIReasoner", + "org.dllearner.reasoning.fuzzydll.FuzzyOWLAPIReasoner", "org.dllearner.algorithms.ocel.OCEL", "org.dllearner.algorithms.ocel.MultiHeuristic", "org.dllearner.refinementoperators.RhoDRDown", Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLPStandard.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLPStandard.java 2011-11-15 20:14:39 UTC (rev 3405) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLPStandard.java 2011-11-16 10:03:47 UTC (rev 3406) @@ -27,6 +27,7 @@ import java.util.TreeSet; import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.ComponentAnn; import org.dllearner.core.EvaluatedDescription; import org.dllearner.core.fuzzydll.FuzzyUnsupportedCodeException; import org.dllearner.core.options.BooleanConfigOption; @@ -52,6 +53,7 @@ * @author Jens Lehmann * */ +@ComponentAnn(name = "FuzzyPosNegLPStandard", shortName = "fuzzyPosNeg", version = 0.2) public class FuzzyPosNegLPStandard extends FuzzyPosNegLP { // approximation and F-measure Modified: trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java 2011-11-15 20:14:39 UTC (rev 3405) +++ trunk/components-core/src/main/java/org/dllearner/reasoning/fuzzydll/FuzzyOWLAPIReasoner.java 2011-11-16 10:03:47 UTC (rev 3406) @@ -41,6 +41,7 @@ import org.dllearner.core.AbstractKnowledgeSource; import org.dllearner.core.AbstractReasonerComponent; +import org.dllearner.core.ComponentAnn; import org.dllearner.core.ComponentInitException; import org.dllearner.core.options.ConfigEntry; import org.dllearner.core.options.ConfigOption; @@ -128,6 +129,7 @@ * @author Jens Lehmann * */ +@ComponentAnn(name = "Fuzzy OWL API Reasoner", shortName = "foar", version = 0.2) public class FuzzyOWLAPIReasoner extends AbstractReasonerComponent { // private static Logger logger = Logger @@ -172,6 +174,10 @@ private int reasonersComparationDisparityCounter = 0; private URL owlLinkURL; + public FuzzyOWLAPIReasoner() { + + } + public FuzzyOWLAPIReasoner(Set<AbstractKnowledgeSource> sources) { super(sources); } Added: trunk/test/fuzzydll/fuzzytrains.conf =================================================================== --- trunk/test/fuzzydll/fuzzytrains.conf (rev 0) +++ trunk/test/fuzzydll/fuzzytrains.conf 2011-11-16 10:03:47 UTC (rev 3406) @@ -0,0 +1,24 @@ +/** + * Fuzzy Trains Example + * + * Copyright (C) 2011, Josué Iglesias, Jens Lehmann + */ + +// declare some prefixes to use as abbreviations +prefixes = [ ("ex","http://www.example.com/fuzzyTrains.owl#") ] + +// knowledge source definition +ks.type = "OWL File" +ks.fileName = "fuzzyTrains_v5.0.owl" + +// reasoner +reasoner.type = "Fuzzy OWL API Reasoner" +reasoner.sources = { ks } + +// learning problem +lp.type = "fuzzyPosNeg" +lp.positiveExamples = { "ex:east1", "ex:east2" } +lp.negativeExamples = { "ex:west6", "ex:west7" } + +// create learning algorithm to run +alg.type = "Fuzzy CELOE" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-17 17:39:52
|
Revision: 3415 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3415&view=rev Author: jenslehmann Date: 2011-11-17 17:39:45 +0000 (Thu, 17 Nov 2011) Log Message: ----------- modified parser to be able to set fuzzy examples directly Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParser.java trunk/interfaces/src/main/java/org/dllearner/confparser3/conf3.jj trunk/test/fuzzydll/fuzzytrains.conf Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java 2011-11-17 17:00:28 UTC (rev 3414) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java 2011-11-17 17:39:45 UTC (rev 3415) @@ -21,6 +21,7 @@ import java.util.Collection; import java.util.LinkedList; +import java.util.Map; import java.util.Set; import java.util.SortedSet; @@ -53,7 +54,16 @@ protected SortedSet<FuzzyIndividual> fuzzyExamples; + protected Map<Individual,Double> fuzzyEx; + public Map<Individual, Double> getFuzzyEx() { + return fuzzyEx; + } + + public void setFuzzyEx(Map<Individual, Double> fuzzyEx) { + this.fuzzyEx = fuzzyEx; + } + protected boolean useRetrievalForClassification = false; protected UseMultiInstanceChecks useMultiInstanceChecks = UseMultiInstanceChecks.TWOCHECKS; protected double percentPerLengthUnit = 0.05; Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParser.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParser.java 2011-11-17 17:00:28 UTC (rev 3414) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/ConfParser.java 2011-11-17 17:39:45 UTC (rev 3415) @@ -93,6 +93,7 @@ String value="", value1="", value2="", tmp="", tmp2=""; Set<String> values = new HashSet<String>(); Map<String,String> tuples = new HashMap<String,String>(); + Map<String,Double> tuplesD = new HashMap<String,Double>(); ConfFileOption2 option = new ConfFileOption2(); boolean isBeanRef = false; @@ -102,6 +103,7 @@ String propertyValue = ""; Class<?> propertyType; Object val = null; + Double d; beanName = Id(); switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case COMMAND_END: @@ -140,11 +142,11 @@ break; default: jj_la1[2] = jj_gen; - if (jj_2_4(2147483647)) { + if (jj_2_5(2147483647)) { jj_consume_token(14); jj_consume_token(15); val = new HashSet(); propertyType = Set.class; propertyValue = "{}"; - } else if (jj_2_5(4)) { + } else if (jj_2_6(4)) { jj_consume_token(14); label_2: while (true) { @@ -187,37 +189,62 @@ break; default: jj_la1[3] = jj_gen; - if (jj_2_6(2147483647)) { + if (jj_2_7(2147483647)) { jj_consume_token(18); jj_consume_token(19); val = new LinkedList(); propertyType = List.class; propertyValue = "[]"; + } else if (jj_2_8(2147483647)) { + jj_consume_token(18); + label_4: + while (true) { + if (jj_2_3(6)) { + ; + } else { + break label_4; + } + jj_consume_token(20); + tmp = String(); + jj_consume_token(16); + tmp2 = String(); + jj_consume_token(21); + tuples.put(tmp,tmp2); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + tmp2 + "\u005c"), "; + jj_consume_token(16); + } + jj_consume_token(20); + tmp = String(); + jj_consume_token(16); + tmp2 = String(); + jj_consume_token(21); + tuples.put(tmp,tmp2); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + tmp2 + "\u005c")"; + jj_consume_token(19); + val = tuples; propertyType = List.class; propertyValue = "["+ propertyValue + "]"; } else { switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { case 18: jj_consume_token(18); - label_4: + label_5: while (true) { - if (jj_2_3(6)) { + if (jj_2_4(6)) { ; } else { - break label_4; + break label_5; } jj_consume_token(20); tmp = String(); jj_consume_token(16); - tmp2 = String(); + d = Double(); jj_consume_token(21); - tuples.put(tmp,tmp2); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + tmp2 + "\u005c"), "; + tuplesD.put(tmp,d); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + d.toString() + "\u005c"), "; jj_consume_token(16); } jj_consume_token(20); tmp = String(); jj_consume_token(16); - tmp2 = String(); + d = Double(); jj_consume_token(21); - tuples.put(tmp,tmp2); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + tmp2 + "\u005c")"; + tuplesD.put(tmp,d); propertyValue += "(\u005c""+ tmp + "\u005c",\u005c"" + d.toString() + "\u005c")"; jj_consume_token(19); - val = tuples; propertyType = List.class; propertyValue = "["+ propertyValue + "]"; + val = tuplesD; propertyType = List.class; propertyValue = "["+ propertyValue + "]"; break; default: jj_la1[4] = jj_gen; @@ -261,7 +288,7 @@ final public String ComplexId() throws ParseException { Token t1,t2; - if (jj_2_7(2)) { + if (jj_2_9(2)) { t1 = jj_consume_token(ID); jj_consume_token(22); t2 = jj_consume_token(ID); @@ -362,68 +389,106 @@ finally { jj_save(6, xla); } } - private boolean jj_3_5() { - if (jj_scan_token(14)) return true; - Token xsp; - while (true) { - xsp = jj_scanpos; - if (jj_3_1()) { jj_scanpos = xsp; break; } - } - if (jj_3R_5()) return true; - if (jj_scan_token(15)) return true; - return false; + private boolean jj_2_8(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_8(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(7, xla); } } + private boolean jj_2_9(int xla) { + jj_la = xla; jj_lastpos = jj_scanpos = token; + try { return !jj_3_9(); } + catch(LookaheadSuccess ls) { return true; } + finally { jj_save(8, xla); } + } + private boolean jj_3_1() { - if (jj_3R_5()) return true; + if (jj_3R_6()) return true; if (jj_scan_token(16)) return true; return false; } - private boolean jj_3_6() { + private boolean jj_3_7() { if (jj_scan_token(18)) return true; if (jj_scan_token(19)) return true; return false; } - private boolean jj_3_7() { - if (jj_scan_token(ID)) return true; - if (jj_scan_token(22)) return true; - return false; - } - private boolean jj_3_3() { if (jj_scan_token(20)) return true; - if (jj_3R_5()) return true; + if (jj_3R_6()) return true; if (jj_scan_token(16)) return true; - if (jj_3R_5()) return true; + if (jj_3R_6()) return true; if (jj_scan_token(21)) return true; if (jj_scan_token(16)) return true; return false; } - private boolean jj_3R_5() { - if (jj_scan_token(STRING)) return true; + private boolean jj_3R_7() { + if (jj_scan_token(ID)) return true; return false; } private boolean jj_3_2() { - if (jj_3R_6()) return true; + if (jj_3R_7()) return true; if (jj_scan_token(16)) return true; return false; } - private boolean jj_3_4() { + private boolean jj_3_5() { if (jj_scan_token(14)) return true; if (jj_scan_token(15)) return true; return false; } - private boolean jj_3R_6() { + private boolean jj_3_9() { if (jj_scan_token(ID)) return true; + if (jj_scan_token(22)) return true; return false; } + private boolean jj_3R_8() { + if (jj_scan_token(DOUBLE)) return true; + return false; + } + + private boolean jj_3R_6() { + if (jj_scan_token(STRING)) return true; + return false; + } + + private boolean jj_3_4() { + if (jj_scan_token(20)) return true; + if (jj_3R_6()) return true; + if (jj_scan_token(16)) return true; + if (jj_3R_8()) return true; + if (jj_scan_token(21)) return true; + if (jj_scan_token(16)) return true; + return false; + } + + private boolean jj_3_8() { + if (jj_scan_token(18)) return true; + if (jj_scan_token(20)) return true; + if (jj_3R_6()) return true; + if (jj_scan_token(16)) return true; + if (jj_3R_6()) return true; + return false; + } + + private boolean jj_3_6() { + if (jj_scan_token(14)) return true; + Token xsp; + while (true) { + xsp = jj_scanpos; + if (jj_3_1()) { jj_scanpos = xsp; break; } + } + if (jj_3R_6()) return true; + if (jj_scan_token(15)) return true; + return false; + } + /** Generated Token Manager. */ public ConfParserTokenManager token_source; SimpleCharStream jj_input_stream; @@ -443,7 +508,7 @@ private static void jj_la1_init_0() { jj_la1_0 = new int[] {0x200,0x100,0x1e00,0x24000,0x40000,0x1200,0x200,}; } - final private JJCalls[] jj_2_rtns = new JJCalls[7]; + final private JJCalls[] jj_2_rtns = new JJCalls[9]; private boolean jj_rescan = false; private int jj_gc = 0; @@ -668,7 +733,7 @@ private void jj_rescan_token() { jj_rescan = true; - for (int i = 0; i < 7; i++) { + for (int i = 0; i < 9; i++) { try { JJCalls p = jj_2_rtns[i]; do { @@ -682,6 +747,8 @@ case 4: jj_3_5(); break; case 5: jj_3_6(); break; case 6: jj_3_7(); break; + case 7: jj_3_8(); break; + case 8: jj_3_9(); break; } } p = p.next; Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/conf3.jj =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/conf3.jj 2011-11-17 17:00:28 UTC (rev 3414) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/conf3.jj 2011-11-17 17:39:45 UTC (rev 3415) @@ -141,6 +141,7 @@ String value="", value1="", value2="", tmp="", tmp2=""; Set<String> values = new HashSet<String>(); Map<String,String> tuples = new HashMap<String,String>(); + Map<String,Double> tuplesD = new HashMap<String,Double>(); ConfFileOption2 option = new ConfFileOption2(); boolean isBeanRef = false; @@ -150,6 +151,7 @@ String propertyValue = ""; Class<?> propertyType; Object val = null; + Double d; } { beanName=Id() [ "." propertyName = Id() {containsSubOption=true;} ] @@ -180,15 +182,24 @@ { val = values; propertyType = Set.class; propertyValue = "{"+ propertyValue + "}"; isBeanCollection = true;} // empty list | LOOKAHEAD("[" "]") "[" "]" { val = new LinkedList(); propertyType = List.class; propertyValue = "[]";} - // a list with several elements, which tuples + // a list with several elements with tuples // e.g. [("a","b"),("c","d")] - | "[" + | LOOKAHEAD( "[" "(" String() "," String()) + "[" ( LOOKAHEAD(6) "(" tmp=String() "," tmp2=String() ")" { tuples.put(tmp,tmp2); propertyValue += "(\""+ tmp + "\",\"" + tmp2 + "\"), "; } "," )* "(" tmp=String() "," tmp2=String() ")" { tuples.put(tmp,tmp2); propertyValue += "(\""+ tmp + "\",\"" + tmp2 + "\")";} - "]" { val = tuples; propertyType = List.class; propertyValue = "["+ propertyValue + "]";} - ) + "]" { val = tuples; propertyType = List.class; propertyValue = "["+ propertyValue + "]";} + // a list with several elements with doubles + // e.g. [("a",1.0),("c",0.7)] + | "[" + ( LOOKAHEAD(6) "(" tmp=String() "," d=Double() ")" + { tuplesD.put(tmp,d); propertyValue += "(\""+ tmp + "\",\"" + d.toString() + "\"), "; } "," )* + "(" tmp=String() "," d=Double() ")" + { tuplesD.put(tmp,d); propertyValue += "(\""+ tmp + "\",\"" + d.toString() + "\")";} + "]" { val = tuplesD; propertyType = List.class; propertyValue = "["+ propertyValue + "]";} + ) // <CONF_END> { option.setBeanRef(isBeanRef); Modified: trunk/test/fuzzydll/fuzzytrains.conf =================================================================== --- trunk/test/fuzzydll/fuzzytrains.conf 2011-11-17 17:00:28 UTC (rev 3414) +++ trunk/test/fuzzydll/fuzzytrains.conf 2011-11-17 17:39:45 UTC (rev 3415) @@ -19,6 +19,7 @@ lp.type = "fuzzyPosNeg" lp.positiveExamples = { "ex:east1", "ex:east2" } lp.negativeExamples = { "ex:west6", "ex:west7" } +lp.fuzzyEx = [("ex:east1",0.6)] // create learning algorithm to run alg.type = "Fuzzy CELOE" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ji...@us...> - 2011-11-18 10:02:54
|
Revision: 3416 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3416&view=rev Author: jialva Date: 2011-11-18 10:02:43 +0000 (Fri, 18 Nov 2011) Log Message: ----------- DL-Learner fuzzy extension adapted to new DL-Learner configuration and working properly ;) Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java trunk/test/fuzzydll/fuzzytrains.conf Modified: trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java 2011-11-17 17:39:45 UTC (rev 3415) +++ trunk/components-core/src/main/java/org/dllearner/learningproblems/FuzzyPosNegLP.java 2011-11-18 10:02:43 UTC (rev 3416) @@ -20,10 +20,12 @@ package org.dllearner.learningproblems; import java.util.Collection; +import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Set; import java.util.SortedSet; +import java.util.TreeSet; import org.dllearner.core.AbstractLearningProblem; import org.dllearner.core.AbstractReasonerComponent; @@ -61,7 +63,14 @@ } public void setFuzzyEx(Map<Individual, Double> fuzzyEx) { - this.fuzzyEx = fuzzyEx; + fuzzyExamples = new TreeSet<FuzzyIndividual>(); + + Iterator it = fuzzyEx.keySet().iterator(); + + while (it.hasNext()) { + Individual i = (Individual) it.next(); + this.fuzzyExamples.add(new FuzzyIndividual(i.getName(), fuzzyEx.get(i).doubleValue())); + } } protected boolean useRetrievalForClassification = false; Modified: trunk/test/fuzzydll/fuzzytrains.conf =================================================================== --- trunk/test/fuzzydll/fuzzytrains.conf 2011-11-17 17:39:45 UTC (rev 3415) +++ trunk/test/fuzzydll/fuzzytrains.conf 2011-11-18 10:02:43 UTC (rev 3416) @@ -19,7 +19,7 @@ lp.type = "fuzzyPosNeg" lp.positiveExamples = { "ex:east1", "ex:east2" } lp.negativeExamples = { "ex:west6", "ex:west7" } -lp.fuzzyEx = [("ex:east1",0.6)] +lp.fuzzyEx = [("http://www.example.com/fuzzyTrains.owl#east1",1.0),("http://www.example.com/fuzzyTrains.owl#east2",1.0),("http://www.example.com/fuzzyTrains.owl#west6",0.0),("http://www.example.com/fuzzyTrains.owl#west7",0.0)] // create learning algorithm to run alg.type = "Fuzzy CELOE" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jen...@us...> - 2011-11-18 10:26:58
|
Revision: 3417 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3417&view=rev Author: jenslehmann Date: 2011-11-18 10:26:51 +0000 (Fri, 18 Nov 2011) Log Message: ----------- fix which allows to use prefixes in fuzzy examples Modified Paths: -------------- trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java trunk/test/fuzzydll/fuzzytrains.conf Modified: trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java 2011-11-18 10:02:43 UTC (rev 3416) +++ trunk/interfaces/src/main/java/org/dllearner/confparser3/PostProcessor.java 2011-11-18 10:26:51 UTC (rev 3417) @@ -89,12 +89,15 @@ if (keyObject instanceof String) { String keyString = (String) keyObject; + // replace prefixes in the key + for (String prefix : prefixes.keySet()) { + key = keyString.replaceAll(prefix + ":", prefixes.get(prefix)); + } + // if the value is a string, we also replace prefixes there if (value instanceof String) { String valueString = (String) value; for (String prefix : prefixes.keySet()) { - value = valueString.replaceAll(prefix + ":", prefixes.get(prefix)); - key = keyString.replaceAll(prefix + ":", prefixes.get(prefix)); - + value = valueString.replaceAll(prefix + ":", prefixes.get(prefix)); } } } Modified: trunk/test/fuzzydll/fuzzytrains.conf =================================================================== --- trunk/test/fuzzydll/fuzzytrains.conf 2011-11-18 10:02:43 UTC (rev 3416) +++ trunk/test/fuzzydll/fuzzytrains.conf 2011-11-18 10:26:51 UTC (rev 3417) @@ -19,7 +19,7 @@ lp.type = "fuzzyPosNeg" lp.positiveExamples = { "ex:east1", "ex:east2" } lp.negativeExamples = { "ex:west6", "ex:west7" } -lp.fuzzyEx = [("http://www.example.com/fuzzyTrains.owl#east1",1.0),("http://www.example.com/fuzzyTrains.owl#east2",1.0),("http://www.example.com/fuzzyTrains.owl#west6",0.0),("http://www.example.com/fuzzyTrains.owl#west7",0.0)] +lp.fuzzyEx = [("ex:west6",0.0),("ex:west7",0.0)] // create learning algorithm to run alg.type = "Fuzzy CELOE" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |